dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25540
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12698: Fix bugs in Aggregate Query Builder formulas.
------------------------------------------------------------
revno: 12698
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-16 11:53:40 +0700
message:
Fix bugs in Aggregate Query Builder formulas.
modified:
dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.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/jdbc/JdbcCaseAggregationConditionManager.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java 2013-10-13 05:30:40 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java 2013-10-16 04:53:40 +0000
@@ -346,6 +346,7 @@
if( hasDataelement)
{
sql += " programinstance as pi ";
+ sql += " INNER JOIN patient p on p.patientid=pi.patientid ";
sql += " INNER JOIN programstageinstance psi ON pi.programinstanceid=psi.programinstanceid ";
sql += " INNER JOIN organisationunit ou ON ou.organisationunitid=psi.organisationunitid ";
}
@@ -1009,7 +1010,7 @@
private String getConditionForMinusDataElement( Collection<Integer> orgunitIds, Integer programStageId,
Integer dataElementId, String compareSide, String startDate, String endDate )
{
- return " EXISTS ( SELECT_pdv.value FROM patientdatavalue _pdv inner join programstageinstance _psi "
+ return " EXISTS ( SELECT _pdv.value FROM patientdatavalue _pdv inner join programstageinstance _psi "
+ " ON _pdv.programstageinstanceid=_psi.programstageinstanceid "
+ " JOIN programinstance _pi ON _pi.programinstanceid=_psi.programinstanceid "
+ " WHERE psi.programstageinstanceid=_pdv.programstageinstanceid "