dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #33436
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17060: Fixed bug - Exception thrown when to run aggregate query builder with programstage as *.
------------------------------------------------------------
revno: 17060
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-10-11 21:27:16 +0700
message:
Fixed bug - Exception thrown when to run aggregate query builder with programstage as *.
modified:
dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.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-10-04 15:48:07 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java 2014-10-11 14:27:16 +0000
@@ -1000,8 +1000,13 @@
private String getConditionForProgramStage( String programStageId, Collection<Integer> orgunitIds )
{
String sql = " EXISTS ( SELECT _psi.programstageinstanceid FROM programstageinstance _psi "
- + "WHERE _psi.programstageinstanceid=psi.programstageinstanceid " + "AND _psi.programstageid="
- + programStageId + " AND _psi.executiondate >= '" + PARAM_PERIOD_START_DATE
+ + "WHERE _psi.programstageinstanceid=psi.programstageinstanceid ";
+ if ( !programStageId.equals( IN_CONDITION_GET_ALL ) )
+ {
+ sql += "AND _psi.programstageid=" + programStageId;
+ }
+
+ sql+= " AND _psi.executiondate >= '" + PARAM_PERIOD_START_DATE
+ "' AND _psi.executiondate <= '" + PARAM_PERIOD_END_DATE + "' AND _psi.organisationunitid in ("
+ TextUtils.getCommaDelimitedString( orgunitIds ) + ") ";
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2014-10-07 15:18:38 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2014-10-11 14:27:16 +0000
@@ -168,7 +168,6 @@
message = message.replace( TrackedEntityInstanceReminder.TEMPLATE_MESSSAGE_ORGUNIT_NAME, organisationunitName );
message = message.replace( TrackedEntityInstanceReminder.TEMPLATE_MESSSAGE_DAYS_SINCE_DUE_DATE, daysSinceDueDate );
-
SchedulingProgramObject schedulingProgramObject = new SchedulingProgramObject();
schedulingProgramObject.setProgramStageInstanceId( programstageinstanceid );
schedulingProgramObject.setPhoneNumber( rs.getString( "phonenumber" ) );