dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15337
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5516: Made method in patient datavaluestore more robust
------------------------------------------------------------
revno: 5516
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-12-21 09:50:50 +0100
message:
Made method in patient datavaluestore more robust
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/hibernate/HibernatePatientDataValueStore.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/hibernate/HibernatePatientDataValueStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/hibernate/HibernatePatientDataValueStore.java 2011-07-08 05:52:59 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/hibernate/HibernatePatientDataValueStore.java 2011-12-21 08:50:50 +0000
@@ -27,6 +27,7 @@
package org.hisp.dhis.patientdatavalue.hibernate;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -101,6 +102,11 @@
@SuppressWarnings( "unchecked" )
public Collection<PatientDataValue> get( Collection<ProgramStageInstance> programStageInstances )
{
+ if ( programStageInstances == null || programStageInstances.isEmpty() )
+ {
+ return new ArrayList<PatientDataValue>();
+ }
+
return getCriteria( Restrictions.in( "programStageInstance", programStageInstances ) ).list();
}