← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10289: [mobile] fix bug patient can enroll single event more than once

 

------------------------------------------------------------
revno: 10289
committer: Long <Long@Long-Laptop>
branch nick: dhis2
timestamp: Mon 2013-03-18 16:30:19 +0700
message:
  [mobile] fix bug patient can enroll single event more than once
modified:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.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-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java	2013-03-15 08:55:20 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java	2013-03-18 09:30:19 +0000
@@ -306,7 +306,14 @@
         for ( Program program : programService.getPrograms( patient.getOrganisationUnit() ) )
 
         {
-            if ( (program.isSingleEvent() && program.isRegistration()) || !program.isSingleEvent() )
+            if ( program.isSingleEvent() && program.isRegistration() )
+            {
+                if ( programInstanceService.getProgramInstances( patient, program ).size() == 0 )
+                {
+                    programs.add( program );
+                }
+            }
+            else if ( !program.isSingleEvent() )
             {
                 if ( programInstanceService.getProgramInstances( patient, program, false ).size() == 0 )
                 {