Skip to content

Commit ea073c8

Browse files
getMostRecentArrivalSource in animal record (#1019)
* getMostRecentArrivalSource in animal record * Fix most recent arrival dem provider
1 parent a648590 commit ea073c8

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

ehr/api-src/org/labkey/api/ehr/demographics/AnimalRecord.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,7 @@ public interface AnimalRecord
9898

9999
Date getMostRecentArrival();
100100

101+
String getMostRecentArrivalSource();
102+
101103
Integer getDaysSinceWeight();
102104
}

ehr/api-src/org/labkey/api/ehr/demographics/SourceDemographicsProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public SourceDemographicsProvider(Module module)
3939
protected Collection<FieldKey> getFieldKeys()
4040
{
4141
Set<FieldKey> keys = new HashSet<>();
42-
keys.add(FieldKey.fromString("date"));
42+
keys.add(FieldKey.fromString("mostRecentArrival"));
4343
keys.add(FieldKey.fromString("fromCenter"));
4444
keys.add(FieldKey.fromString("source"));
4545
keys.add(FieldKey.fromString("type"));

ehr/src/org/labkey/ehr/demographics/AnimalRecordImpl.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,20 @@ public Date getMostRecentArrival()
300300
{
301301
List<Map<String, Object>> rows = (List)_props.get("source");
302302
if (!rows.isEmpty())
303-
return (Date)rows.get(0).get("date");
303+
return (Date)rows.get(0).get("mostRecentArrival");
304+
}
305+
306+
return null;
307+
}
308+
309+
@Override
310+
public String getMostRecentArrivalSource()
311+
{
312+
if (_props.containsKey("source"))
313+
{
314+
List<Map<String, Object>> rows = (List)_props.get("source");
315+
if (!rows.isEmpty())
316+
return (String)rows.get(0).get("source/meaning");
304317
}
305318

306319
return null;

0 commit comments

Comments
 (0)