← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14384: Fixed bug - The resutt of aggregate formulas with IS_NULL expression is wrong.

 

------------------------------------------------------------
revno: 14384
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-03-25 13:23:18 +0700
message:
  Fixed bug - The resutt of aggregate formulas with IS_NULL expression is wrong.
modified:
  dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm


--
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-03-20 10:38:01 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java	2014-03-25 06:23:18 +0000
@@ -548,7 +548,7 @@
                 }
                 else
                 {
-                    condition = getConditionForProgramStage( ids[0], operator, orgunitIds, startDate, endDate );
+                    condition = getConditionForProgramStage( ids[0], orgunitIds, startDate, endDate );
                 }
             }
             else if ( info[0].equalsIgnoreCase( OBJECT_PROGRAM_STAGE_PROPERTY ) )
@@ -635,6 +635,11 @@
                 sql += " AND _pdv.value ";
             }
         }
+        
+        if( !isExist )
+        {
+            sql = "(" + sql + " ) AND " + getConditionForProgramStage( programStageId, orgunitIds, startDate, endDate ) + ")";
+        }
 
         return sql;
     }
@@ -730,7 +735,7 @@
      * [PS:1]
      * 
      */
-    private String getConditionForProgramStage( String programStageId, String operator, Collection<Integer> orgunitIds,
+    private String getConditionForProgramStage( String programStageId, Collection<Integer> orgunitIds,
         String startDate, String endDate )
     {
         String sql = " EXISTS ( SELECT _psi.programstageinstanceid FROM programstageinstance _psi "

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm	2014-02-20 16:11:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm	2014-03-25 06:23:18 +0000
@@ -80,7 +80,7 @@
 					<select id="caseProperty" name="caseProperty" size="10" ondblclick="insertInfo(this, false);" onclick="getSuggestedValues(this.id, 'caSuggestedValues' )">
 						#foreach($attribute in $attributes)
 							#if($attribute.valueType=='age')
-								#set($attId=$patientAttribute.id + ".age")
+								#set($attId=$attribute.id + ".age")
 								<option suggested="" title="$attribute.displayName" value="[CA:$attId]">$attribute.displayName</option>
 							#else
 								<option suggested="" title="$attribute.displayName" value="[CA:$attribute.id]">$attribute.displayName</option>