← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5905: Fix bug: (patient) Error when running program-stage formula.

 

------------------------------------------------------------
revno: 5905
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-02-10 12:52:52 +0700
message:
  Fix bug: (patient) Error when running program-stage formula.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.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-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java	2012-02-08 13:27:22 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java	2012-02-10 05:52:52 +0000
@@ -763,7 +763,7 @@
         
         if( operator.equals( AGGRERATION_SUM ) )
         {
-            sql = "SELECT pi.programstageinstanceid ";
+            sql = "SELECT psi.programstageinstanceid ";
         }
         
         return sql + "FROM programstageinstance as psi "
@@ -879,6 +879,8 @@
         }
 
         return "SELECT distinct(p.patientid) FROM programinstance as pi "
+                   + "INNER JOIN programstageinstance psi "
+                   + "ON pi.programinstanceid = psi.programinstanceid"
                    + "INNER JOIN patient as p ON pi.patientid = p.patientid  " 
                    + "WHERE psi.programstageid=" + programStageId + " "
                    + "AND psi.executiondate >= '" + startDate