← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5907: Fix bug: Add orgunit condition for program-stage condition.

 

------------------------------------------------------------
revno: 5907
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-02-10 15:00:11 +0700
message:
  Fix bug: Add orgunit condition for program-stage condition.
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-10 05:52:52 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java	2012-02-10 08:00:11 +0000
@@ -880,11 +880,11 @@
 
         return "SELECT distinct(p.patientid) FROM programinstance as pi "
                    + "INNER JOIN programstageinstance psi "
-                   + "ON pi.programinstanceid = psi.programinstanceid"
+                   + "ON pi.programinstanceid = psi.programinstanceid "
                    + "INNER JOIN patient as p ON pi.patientid = p.patientid  " 
                    + "WHERE psi.programstageid=" + programStageId + " "
                    + "AND psi.executiondate >= '" + startDate
-                   + "' AND psi.executiondate <= '" + endDate + "' ";
+                   + "' AND psi.executiondate <= '" + endDate + "' AND p.organisationunitid = " + orgunitId + " ";
     }
     
     private String getSQL( String aggregateOperator, List<String> conditions, List<String> operators )