=== 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 2011-12-26 10:07:59 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java 2011-12-28 05:10:42 +0000 @@ -204,7 +204,7 @@ Period period ) { String sql = convertCondition( aggregationCondition, orgunit, period ); - + Collection patientIds = aggregationConditionStore.executeSQL( sql ); if ( patientIds == null ) @@ -798,11 +798,11 @@ sql = "SELECT pi.patientid "; } - return sql + "FROM programstageinstance as psi " - + "INNER JOIN programinstance as pgi ON psi.programinstanceid = pgi.programinstanceid " - + "INNER JOIN patient as pi ON pi.patientid = pgi.patientid " + "WHERE pgi.programid=" + programId + " " - + "AND pi.organisationunitid = " + orgunitId + " " + "AND pgi.enrollmentdate >= '" + startDate - + "' AND pgi.enrollmentdate <= '" + endDate + "' "; + return sql + "FROM programinstance as pgi " + + "INNER JOIN patient as pi ON pi.patientid = pgi.patientid " + + "WHERE pgi.programid=" + programId + " " + + "AND pi.organisationunitid = " + orgunitId + " " + "AND pgi.enrollmentdate >= '" + startDate + + "' AND pgi.enrollmentdate <= '" + endDate + "' "; } private String getSQL( List conditions, List operators ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm 2011-12-05 05:00:07 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm 2011-12-28 05:10:42 +0000 @@ -29,7 +29,7 @@ - #foreach( $dataElementGroup in $dataElementGroups) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm 2011-12-05 05:00:07 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm 2011-12-28 05:10:42 +0000 @@ -31,7 +31,7 @@ - #foreach( $dataElementGroup in $dataElementGroups)