← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8286: Improve program-tracking.

 

------------------------------------------------------------
revno: 8286
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-09-27 16:35:24 +0700
message:
  Improve program-tracking.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js


--
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/patient/hibernate/HibernatePatientStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java	2012-09-27 08:56:59 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java	2012-09-27 09:35:24 +0000
@@ -362,6 +362,7 @@
         String orderBy = "";
         boolean hasIdentifier = false;
         boolean isSearchEvent = false;
+        boolean isPriorityEvent = false;
 
         for ( String searchKey : searchKeys )
         {
@@ -423,6 +424,7 @@
             else if ( keys[0].equals( Patient.PREFIX_PROGRAM_EVENT_BY_STATUS ) )
             {
                 isSearchEvent = true;
+                isPriorityEvent = Boolean.parseBoolean( keys[5] );
                 patientWhere += patientOperator + "pgi.patientid=p.patientid and ";
                 patientWhere += "pgi.programid=" + id + " and ";
                 patientWhere += "psi.duedate>='" + keys[2] + "' and psi.duedate<='" + keys[3] + "' and ";
@@ -431,7 +433,7 @@
                 String operatorStatus = "";
                 String condition = " and ( ";
 
-                for ( int index = 5; index < keys.length; index++ )
+                for ( int index = 6; index < keys.length; index++ )
                 {
                     int statusEvent = Integer.parseInt( keys[index] );
                     switch ( statusEvent )
@@ -525,8 +527,11 @@
             String subSQL = " ,MIN( psi.programstageinstanceid ) as programstageinstanceid, min(pgs.name) as programstagename, min(psi.duedate) as duedate ";
             sql = sql + subSQL + from + " inner join programinstance pgi on " + " (pgi.patientid=p.patientid) "
                 + " inner join programstageinstance psi on " + " (psi.programinstanceid=pgi.programinstanceid) "
-                + " inner join programstage pgs on (pgs.programstageid=psi.programstageid) "
-                + " inner join patientattributevalue pav on p.patientid=pav.patientid ";
+                + " inner join programstage pgs on (pgs.programstageid=psi.programstageid) ";
+            if( isPriorityEvent )
+            {
+                sql += " inner join patientattributevalue pav on p.patientid=pav.patientid ";
+            }
             orderBy = " ORDER BY duedate DESC ";
             from = " ";
         }
@@ -550,7 +555,7 @@
         {
             sql += statementBuilder.limitRecord( min, max );
         }
-
+        
         return sql;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2012-09-27 08:00:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2012-09-27 09:35:24 +0000
@@ -52,6 +52,7 @@
 					+ "_" + getFieldValue('startDueDate')
 					+ "_" + getFieldValue('endDueDate')
 					+ "_" + getFieldValue('orgunitId')
+					+ "_false"
 					+ "_" + getFieldValue('statusEvent');
 	
 	showLoader();
@@ -78,6 +79,7 @@
 					+ "_" + getFieldValue('startDueDate')
 					+ "_" + getFieldValue('endDueDate')
 					+ "_" + getFieldValue('orgunitId')
+					+ "_false"
 					+ "_" + getFieldValue('statusEvent');
 	var params = "searchTexts=" + searchTexts;
 		params += "&listAll=fase";

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-26 08:42:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-27 09:35:24 +0000
@@ -209,7 +209,7 @@
 		var startDueDate = getFieldValue('startDueDate');
 		var endDueDate = getFieldValue('endDueDate');
 		params += '&searchTexts=stat_' + getFieldValue('programIdAddPatient') 
-			   + '_' + startDueDate + '_' + endDueDate + '_' + statusEvent;
+			   + '_' + startDueDate + '_' + endDueDate + '_false_' + statusEvent;
 		if( statusEvent != '3' && statusEvent != '4' && statusEvent != '0' )
 		{
 			params += "_" + getFieldValue('orgunitId');

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2012-09-25 02:50:39 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2012-09-27 09:35:24 +0000
@@ -58,7 +58,7 @@
 	var programId = getFieldValue('programIdAddPatient');
 	var searchTexts = "stat_" + programId + "_" 
 				+ startDate + "_" + endDate + "_" 
-				+ getFieldValue('orgunitId') + "_4";
+				+ getFieldValue('orgunitId') + "_true_4";
 	
 	showLoader();
 	jQuery('#listEventDiv').load('getSMSPatientRecords.action',