← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10897: Add date-diff for date-dataelement and report-date.

 

------------------------------------------------------------
revno: 10897
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-05-20 15:41:33 +0700
message:
  Add date-diff for date-dataelement and report-date.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationCondition.java
  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
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/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-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationCondition.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationCondition.java	2013-05-17 08:24:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationCondition.java	2013-05-20 08:41:33 +0000
@@ -85,7 +85,7 @@
 
     public static String OBJECT_PROGRAM_PROPERTY_ENROLLEMENT_DATE = "enrollmentDate";
     
-    public static String MINUS_OPERATOR = "MINUS";
+    public static String MINUS_OPERATOR = "DATEDIFF";
 
     public static String AUTO_STORED_BY = "DHIS-SYSTEM";
 

=== 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-17 08:24:11 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java	2013-05-20 08:41:33 +0000
@@ -720,7 +720,6 @@
         sql = sql.replaceAll( IN_CONDITION_END_SIGN, ")" );
         sql = sql.replaceAll( IS_NULL, " " );
 
-        System.out.println("\n\n minusSQLMap " + minusSQLMap );
         for ( int key = 0; key < idx; key++ )
         {
             sql = sql.replace( CaseAggregationCondition.MINUS_OPERATOR + "_" + key, minusSQLMap.get( key ) );

=== 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-17 08:47:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-05-20 08:41:33 +0000
@@ -396,8 +396,9 @@
 display_on_all_orgunits = Display on all organisation units
 other_program_stages = Other program stages
 minus = Minus
-minus_with_dateOfIncident = MINUS TO INCIDENT DATE
-minus_with_enrollmentDate = MINUS TO ENROLLMENT DATE
+minus_with_dateOfIncident = DATE-DIFF ( xxx, INCIDENT DATE )
+minus_with_enrollmentDate = DATE-DIFF ( xxx, ENROLLMENT DATE )
+minus_with_executionDate = DATE-DIFF ( xxx, REPORT DATE )
 and_operator = AND
 or_operator = OR
 combine_operator = COMBINE

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationForm.vm	2013-05-17 08:47:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationForm.vm	2013-05-20 08:41:33 +0000
@@ -136,13 +136,14 @@
 			<input type='button' class="nornal-button" onclick='insertBoolValue( "false" );' value="$i18n.getString( 'no' )" />
 			<input type='button' class="nornal-button" onclick='insertOperator( "is null" );' value="==NULL" />
 			<input type='button' class="nornal-button" onclick='insertOperator( "is not null" );' value="!=NULL" />
-			<br><br>
+			&nbsp;&nbsp;&nbsp;
 			<input type='button' style="width:54px;" onclick='insertOperator( "AND" );' value="$i18n.getString( 'and_operator' )" />
 			<input type='button' style="width:54px;" onclick='insertOperator( "OR" );' value="$i18n.getString( 'or_operator' )" />
-			&nbsp;&nbsp;&nbsp;
+			<br><br>
 			<input type='button' style="width:92px;" onclick='insertOperator( "COMBINE" );' value="$i18n.getString( 'combine_operator' )" />
-			<input type='button' style="width:150px;" onclick='insertOperator( "MINUS( , dateOfIncident) " );' value="$i18n.getString('minus_with_dateOfIncident')" />
-			<input type='button' style="width:150px;" onclick='insertOperator( "MINUS( , enrollmentDate) " );' value="$i18n.getString('minus_with_enrollmentDate')" />
+			<input type='button' style="width:150px;" onclick='insertOperator( "DATEDIFF( , dateOfIncident) " );' value="$i18n.getString('minus_with_dateOfIncident')" />
+			<input type='button' style="width:150px;" onclick='insertOperator( "DATEDIFF( , enrollmentDate) " );' value="$i18n.getString('minus_with_enrollmentDate')" />
+			<input type='button' style="width:150px;" onclick='insertOperator( "DATEDIFF( , executionDate) " );' value="$i18n.getString('minus_with_executionDate')" />
 			&nbsp;&nbsp;&nbsp;
 			<input type='button' style="width:45px;" align="right" alt="$i18n.getString( 'clear' )" onclick="byId('aggregationCondition').value='';" value="$i18n.getString('clear')" />
 		</td>