← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7709: Sort events of each patient by due-date in multi individual data records.

 

------------------------------------------------------------
revno: 7709
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-07-26 11:32:29 +0700
message:
  Sort events of each patient by due-date in multi individual data records.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstancesAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm


--
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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java	2012-06-07 04:23:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java	2012-07-26 04:32:29 +0000
@@ -50,6 +50,7 @@
 import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.program.ProgramStageInstanceService;
 import org.hisp.dhis.program.comparator.ProgramStageInstanceComparator;
+import org.hisp.dhis.program.comparator.ProgramStageInstanceDueDateComparator;
 
 public class GetDataRecordsAction
     extends ActionPagingSupport<Patient>
@@ -244,12 +245,11 @@
                 for ( ProgramInstance programInstance : _programInstances )
                 {
                     programInstanceMap.put( patient, programInstance );
-
                     programInstances.add( programInstance );
-
+                    
                     List<ProgramStageInstance> programStageInstanceList = new ArrayList<ProgramStageInstance>(
                         programInstance.getProgramStageInstances() );
-                    Collections.sort( programStageInstanceList, new ProgramStageInstanceComparator() );
+                    Collections.sort( programStageInstanceList, new ProgramStageInstanceDueDateComparator() );
 
                     programStageInstanceMap.put( programInstance, programStageInstanceList );
                     programStageInstances.addAll( programStageInstanceList );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstancesAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstancesAction.java	2012-06-27 05:12:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstancesAction.java	2012-07-26 04:32:29 +0000
@@ -161,8 +161,7 @@
                 {
                     programStageInstances.addAll( programInstance.getProgramStageInstances() );
                     Collections.sort( programStageInstances, new ProgramStageInstanceDueDateComparator() );
-                                        statusMap = programStageInstanceService.statusProgramStageInstances( programInstance
-                        .getProgramStageInstances() );
+                    statusMap = programStageInstanceService.statusProgramStageInstances( programInstance.getProgramStageInstances() );
                 }
                 else
                 {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-07-25 08:44:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-07-26 04:32:29 +0000
@@ -66,7 +66,7 @@
 complete=Complete
 case_aggregation_form=Person aggregation form
 dataset_list=Dataset List
-multiple_individual_records=Multiple Individual records
+multiple_individual_records=Multiple individual records
 intro_case_aggregation=Generate routine data values from patient data by month (or other intervals if desired) and organisation unit.
 from=From
 to=To

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm	2012-06-25 04:46:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm	2012-07-26 04:32:29 +0000
@@ -11,7 +11,8 @@
 								<td>
 									<input type='button' class='patient-object' value='$patient.getFullName()' onclick='javascript:showPatientHistory( "$patient.id" );' title='$i18n.getString( "patient_details_and_history" )'>
 								</td>
-								#foreach( $programStageInstance in $programInstance.programStageInstances )
+								#set($programStageInstances = $programStageInstanceMap.get($programInstance) )
+								#foreach( $programStageInstance in $programStageInstances )
 									<td>
 										<img src='images/rightarrow.png'>
 									</td>