dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30113
[Bug 1318066] Re: Aggregation queries that evaluate person attributes fail to run
** Changed in: dhis2
Assignee: (unassigned) => Thu Tran (tran-hispvietnam)
** Changed in: dhis2
Status: New => Fix Committed
--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1318066
Title:
Aggregation queries that evaluate person attributes fail to run
Status in DHIS 2:
Fix Committed
Bug description:
Version 2.13 build 13000 dated 2014-05-09 13:19
Example condition:
[PS:50485] AND [CP:gender] ='F'
Error logged:
* INFO 2014-05-09 20:38:29,442 Data values set saved [data element id scheme: null, org unit id scheme: null, dry run: false, async: false, strategy: null, skip check: false] (DataValueSetController.java [http-bio-8080-exec-23])
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT '0' as dataelementid, '0' as categoryoptioncomboid, ou.organisationunitid as sourceid, '0' as periodid,'aggregated_from_tracker' as comment, '201405' as periodIsoDate,'dataelementname' as dataelementname, 'optioncomboid' as categoryoptioncomboname, ou.name as organisationunitname, COUNT(DISTINCT(pi.patientid)) as value FROM programinstance as pi INNER JOIN trackedentityinstance p on p.trackedentityinstanceid=pi.trackedentityinstanceid INNER JOIN programstageinstance psi ON pi.programinstanceid=psi.programinstanceid INNER JOIN organisationunit ou ON ou.organisationunitid=psi.organisationunitid WHERE EXISTS ( SELECT * 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 AND _pdv.dataelementid=50431 AND _psi.organisationunitid in (0) AND _pi.programid = 50484 AND _psi.executionDate>='2014-05-09' AND _psi.executionDate <= '2014-05-09' AND _psi.programstageid = 50485 AND _pdv.value ='Implante 3' ) AND EXISTS (SELECT _p.patientid FROM patient _p WHERE _p.patientid = pi.patientid AND gender ='F' ) GROUP BY ou.organisationunitid, ou.name]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "trackedentityinstance" does not exist
To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1318066/+subscriptions
References