Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,7 @@ public interface AnimalRecord

Date getMostRecentArrival();

String getMostRecentArrivalSource();

Integer getDaysSinceWeight();
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SourceDemographicsProvider(Module module)
protected Collection<FieldKey> getFieldKeys()
{
Set<FieldKey> keys = new HashSet<>();
keys.add(FieldKey.fromString("date"));
keys.add(FieldKey.fromString("mostRecentArrival"));
keys.add(FieldKey.fromString("fromCenter"));
keys.add(FieldKey.fromString("source"));
keys.add(FieldKey.fromString("type"));
Expand Down
15 changes: 14 additions & 1 deletion ehr/src/org/labkey/ehr/demographics/AnimalRecordImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,20 @@ public Date getMostRecentArrival()
{
List<Map<String, Object>> rows = (List)_props.get("source");
if (!rows.isEmpty())
return (Date)rows.get(0).get("date");
return (Date)rows.get(0).get("mostRecentArrival");
}

return null;
}

@Override
public String getMostRecentArrivalSource()
{
if (_props.containsKey("source"))
{
List<Map<String, Object>> rows = (List)_props.get("source");
if (!rows.isEmpty())
return (String)rows.get(0).get("source/meaning");
}

return null;
Expand Down