← Back to team overview

dhis2-devs team mailing list archive

[Bug 1318072] [NEW] Aggregation queries that evaluate Age at visit fail to run

 

Public bug reported:

Version 2.13  build 13000 dated 2014-05-09 13:19

Example condition:

[PS:50485] AND [PC:DATE@executionDate#-DATE@birthDate#] > 16801

Error logged:

* INFO  2014-05-09 21:14:30,012 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-14])
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 programstageinstance psi ON pi.programinstanceid=psi.programinstanceid  INNER JOIN organisationunit ou ON ou.organisationunitid=psi.organisationunitid  WHERE  EXISTS ( SELECT _psi.programstageinstanceid FROM programstageinstance _psi WHERE _psi.programstageinstanceid=psi.programstageinstanceid AND _psi.programstageid=50485  AND _psi.executiondate >= '2014-05-09' AND _psi.executiondate <= '2014-05-09' AND _psi.organisationunitid in (0)    ) AND   EXISTS ( SELECT _psi.programstageinstanceid from programstageinstance _psi WHERE _psi.programstageinstanceid=psi.programstageinstanceid AND ( _psi.executionDate BETWEEN '2014-05-09' AND '2014-05-09') AND DATE(executionDate)-DATE(birthDate) > 16801
 ) GROUP BY ou.organisationunitid, ou.name]; nested exception is org.postgresql.util.PSQLException: ERROR: column "birthdate" does not exist

** Affects: dhis2
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1318072

Title:
  Aggregation queries that evaluate Age at visit fail to run

Status in DHIS 2:
  New

Bug description:
  Version 2.13  build 13000 dated 2014-05-09 13:19

  Example condition:

  [PS:50485] AND [PC:DATE@executionDate#-DATE@birthDate#] > 16801

  Error logged:

  * INFO  2014-05-09 21:14:30,012 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-14])
  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 programstageinstance psi ON pi.programinstanceid=psi.programinstanceid  INNER JOIN organisationunit ou ON ou.organisationunitid=psi.organisationunitid  WHERE  EXISTS ( SELECT _psi.programstageinstanceid FROM programstageinstance _psi WHERE _psi.programstageinstanceid=psi.programstageinstanceid AND _psi.programstageid=50485  AND _psi.executiondate >= '2014-05-09' AND _psi.executiondate <= '2014-05-09' AND _psi.organisationunitid in (0)    ) AND   EXISTS ( SELECT _psi.programstageinstanceid from programstageinstance _psi WHERE _psi.programstageinstanceid=psi.programstageinstanceid AND ( _psi.executionDate BETWEEN '2014-05-09' AND '2014-05-09') AND DATE(executionDate)-DATE(birthDate) > 16801
   ) GROUP BY ou.organisationunitid, ou.name]; nested exception is org.postgresql.util.PSQLException: ERROR: column "birthdate" does not exist

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1318072/+subscriptions


Follow ups

References