← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10937: Fixed bug - Don't run aggregate query builder formulas.

 

------------------------------------------------------------
revno: 10937
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-05-22 21:56:12 +0700
message:
  Fixed bug - Don't run aggregate query builder formulas.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties


--
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-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java	2013-05-20 08:41:33 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java	2013-05-22 14:56:12 +0000
@@ -315,11 +315,11 @@
             {
                 if ( operator.equals( CaseAggregationCondition.AGGRERATION_COUNT ) )
                 {
-                    sql += operator + " (distinct(pi.patientid) ) as value ";
+                    sql += " count (distinct(pi.patientid) ) as value ";
                 }
                 else
                 {
-                    sql += operator + " (distinct(psi.programinstanceid ) ) as value ";
+                    sql += " count (psi.programinstanceid ) as value ";
                 }
 
                 sql += "FROM programstageinstance as psi ";
@@ -540,14 +540,14 @@
 
             sql = "select periodid from period where periodtypeid=" + periodTypeId + " and startdate='" + start
                 + "' and enddate='" + end + "'";
-            int periodid = 0;
+            Integer periodid = null;
             SqlRowSet rs = jdbcTemplate.queryForRowSet( sql );
             if ( rs.next() )
             {
                 periodid = rs.getInt( "periodid" );
             }
 
-            if ( periodid == 0 )
+            if ( periodid == null)
             {
                 String insertSql = "insert into period (periodtypeid,startdate,enddate) " + " VALUES " + "("
                     + periodTypeId + ",'" + start + "','" + end + "' )";

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-05-21 10:43:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-05-22 14:56:12 +0000
@@ -405,4 +405,5 @@
 filter_by_type = Filter by type
 orgunit_group = Organisation unit group
 enrollement_date = Enrollement date
-days_since_incident_date = Days since incident date
\ No newline at end of file
+days_since_incident_date = Days since incident date
+view_all = View all
\ No newline at end of file