← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15458: added PatientList.java and enabled commented out codes

 

------------------------------------------------------------
revno: 15458
committer: sherylyn.marie
branch nick: dhis2
timestamp: Thu 2014-05-29 00:31:17 +0800
message:
  added PatientList.java and enabled commented out codes
modified:
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
  dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.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-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java	2014-05-28 14:47:36 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java	2014-05-28 16:31:17 +0000
@@ -41,7 +41,7 @@
 import org.hisp.dhis.api.mobile.model.LWUITmodel.LostEvent;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Notification;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Patient;
-//import org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList;
+import org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Program;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.ProgramStage;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Relationship;
@@ -59,8 +59,8 @@
     Patient findPatient( int patientId )
         throws NotAllowedException;
     
-//    PatientList findPatients( String patientIds )
-//        throws NotAllowedException;
+    PatientList findPatients( String patientIds )
+        throws NotAllowedException;
 
     String findPatientInAdvanced( String keyword, int orgUnitId, int programId )
         throws NotAllowedException;

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2014-05-28 14:47:36 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2014-05-28 16:31:17 +0000
@@ -54,6 +54,7 @@
 import org.hisp.dhis.api.mobile.model.LWUITmodel.LostEvent;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Notification;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Patient;
+import org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Section;
 import org.hisp.dhis.api.mobile.model.comparator.ActivityComparator;
 import org.hisp.dhis.common.Grid;
@@ -1447,21 +1448,21 @@
         return patientMobile;
     }
     
-//    public org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList findPatients( String patientIds )
-//        throws NotAllowedException
-//    {
-//        PatientList patientlist = new PatientList();
-//        
-//        while ( patientIds.length() > 0 )
-//        {
-//            int patientId = Integer.parseInt( patientIds.substring( 0, patientIds.indexOf( "$" ) ) );
-//            TrackedEntityInstance patient = entityInstanceService.getTrackedEntityInstance( patientId );
-//            patientlist.getPatientList().add( getPatientModel( patient ) );
-//            patientIds = patientIds.substring( patientIds.indexOf( "$" ) + 1, patientIds.length() );
-//        }
-//        
-//        return patientlist;
-//    }
+    public org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList findPatients( String patientIds )
+        throws NotAllowedException
+    {
+        PatientList patientlist = new PatientList();
+        
+        while ( patientIds.length() > 0 )
+        {
+            int patientId = Integer.parseInt( patientIds.substring( 0, patientIds.indexOf( "$" ) ) );
+            TrackedEntityInstance patient = entityInstanceService.getTrackedEntityInstance( patientId );
+            patientlist.getPatientList().add( getPatientModel( patient ) );
+            patientIds = patientIds.substring( patientIds.indexOf( "$" ) + 1, patientIds.length() );
+        }
+        
+        return patientlist;
+    }
 
     @Override
     public String findPatientInAdvanced( String keyword, int orgUnitId, int programId )

=== modified file 'dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java	2014-05-28 14:47:36 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java	2014-05-28 16:31:17 +0000
@@ -54,7 +54,7 @@
 import org.hisp.dhis.api.mobile.model.LWUITmodel.LostEvent;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Notification;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Patient;
-//import org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList;
+import org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.PatientIdentifierAndAttribute;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Program;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.ProgramStage;
@@ -366,15 +366,15 @@
         return activityReportingService.findPatient( Integer.parseInt( patientId ) );
     }
     
-//    @RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findPatients" )
-//    @ResponseBody
-//    public PatientList findPatientsById( @PathVariable
-//    int id, @RequestHeader( "patientIds" )
-//    String patientIds )
-//        throws NotAllowedException
-//    {
-//        return activityReportingService.findPatients( patientIds );
-//    }
+    @RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findPatients" )
+    @ResponseBody
+    public PatientList findPatientsById( @PathVariable
+    int id, @RequestHeader( "patientIds" )
+    String patientIds )
+        throws NotAllowedException
+    {
+        return activityReportingService.findPatients( patientIds );
+    }
 
     @RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findPatientInAdvanced/{programId}" )
     @ResponseBody