← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12817: [mobile] change findLatestPatient for j2me tracker

 

------------------------------------------------------------
revno: 12817
committer: Hong Em <em.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-10-28 16:53:18 +0700
message:
  [mobile] change findLatestPatient for j2me tracker
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


--
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	2013-10-22 04:01:39 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java	2013-10-28 09:53:18 +0000
@@ -102,7 +102,8 @@
 
     public String findLostToFollowUp( int orgUnitId, String programId )
         throws NotAllowedException;
-    
+
     public Notification handleLostToFollowUp( LostEvent lostEvent )
         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	2013-10-23 08:26:05 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-10-28 09:53:18 +0000
@@ -563,9 +563,8 @@
         if ( isNumber( keyword ) == false )
         {
             OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
-            List<Patient> patients = (List<Patient>) patientService.getPatientByFullname( keyword,
-                organisationUnit );
-            
+            List<Patient> patients = (List<Patient>) patientService.getPatientByFullname( keyword, organisationUnit );
+
             if ( patients.size() > 1 )
             {
                 String patientsInfo = new String();
@@ -1400,8 +1399,7 @@
 
             OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
             String fullName = enrollmentRelationship.getPersonBName();
-            List<Patient> patients = (List<Patient>) patientService.getPatientByFullname( fullName,
-                organisationUnit );
+            List<Patient> patients = (List<Patient>) patientService.getPatientByFullname( fullName, organisationUnit );
 
             // remove the own searcher
             patients = removeIfDuplicated( patients, enrollmentRelationship.getPersonAId() );
@@ -1812,10 +1810,11 @@
     public org.hisp.dhis.api.mobile.model.LWUITmodel.Patient findLatestPatient()
         throws NotAllowedException
     {
-        Patient patient = patientService.getPatient( this.patientId );
-
-        org.hisp.dhis.api.mobile.model.LWUITmodel.Patient patientMobile = getPatientModel( patient );
-        return patientMobile;
+        // Patient patient = patientService.getPatient( this.patientId );
+        //
+        // org.hisp.dhis.api.mobile.model.LWUITmodel.Patient patientMobile =
+        // getPatientModel( patient );
+        return this.getPatientMobile();
     }
 
     @Override
@@ -1910,6 +1909,9 @@
             return patientId;
         }
 
+        Patient patientNew = patientService.getPatient( this.patientId );
+        this.setPatientMobile( getPatientModel( patientNew ) );
+
         return patientId;
 
     }
@@ -2124,4 +2126,17 @@
             return notification;
         }
     }
+
+    private org.hisp.dhis.api.mobile.model.LWUITmodel.Patient patientMobile;
+
+    public org.hisp.dhis.api.mobile.model.LWUITmodel.Patient getPatientMobile()
+    {
+        return patientMobile;
+    }
+
+    public void setPatientMobile( org.hisp.dhis.api.mobile.model.LWUITmodel.Patient patientMobile )
+    {
+        this.patientMobile = patientMobile;
+    }
+
 }