← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13847: Attempted bugfix for case aggregation

 

------------------------------------------------------------
revno: 13847
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-01-24 23:40:25 +0200
message:
  Attempted bugfix for case aggregation
modified:
  dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.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-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java	2014-01-24 08:41:50 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java	2014-01-24 21:40:25 +0000
@@ -297,6 +297,7 @@
                 sql += "FROM ";
                 boolean hasDataelement = hasDataelementCriteria( caseExpression );
                 boolean hasPatient = hasPatientCriteria( caseExpression );
+                
                 if ( hasPatient && hasDataelement )
                 {
                     sql += " programinstance as pi ";
@@ -311,7 +312,9 @@
                 }
                 else
                 {
-                    sql += " programstageinstance psi INNER JOIN organisationunit ou ON ou.organisationunitid=psi.organisationunitid ";
+                    sql += " programinstance as pi ";
+                    sql += " INNER JOIN programstageinstance psi ON pi.programinstanceid=psi.programinstanceid ";
+                    sql += " INNER JOIN organisationunit ou ON ou.organisationunitid=psi.organisationunitid ";
                 }
 
                 sql += " WHERE "