← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20047: Event analytics. Added support for due date.

 

------------------------------------------------------------
revno: 20047
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-09-08 19:39:20 +0200
message:
  Event analytics. Added support for due date.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.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/program/ProgramIndicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2015-09-07 17:36:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2015-09-08 17:39:20 +0000
@@ -65,6 +65,7 @@
     public static final String KEY_CONSTANT = "C";
 
     public static final String VAR_EXECUTION_DATE = "execution_date";
+    public static final String VAR_DUE_DATE = "due_date";
     public static final String VAR_INCIDENT_DATE = "incident_date";
     public static final String VAR_ENROLLMENT_DATE = "enrollment_date";
     public static final String VAR_CURRENT_DATE = "current_date";

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java	2015-09-04 10:49:08 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java	2015-09-08 17:39:20 +0000
@@ -319,13 +319,14 @@
         String[] ps = { quote( "ps" ), "character(11) not null", "ps.uid" };
         String[] erd = { quote( "enrollmentdate" ), "timestamp", "pi.enrollmentdate" };
         String[] ed = { quote( "executiondate" ), "timestamp", "psi.executiondate" };
+        String[] dd = { quote( "duedate" ), "timestamp", "psi.duedate" };
         String[] longitude = { quote( "longitude" ), dbl, "psi.longitude" };
         String[] latitude = { quote( "latitude" ), dbl, "psi.latitude" };
         String[] ou = { quote( "ou" ), "character(11) not null", "ou.uid" };
         String[] oun = { quote( "ouname" ), "character varying(230) not null", "ou.name" };
         String[] ouc = { quote( "oucode" ), "character varying(50)", "ou.code" };
 
-        columns.addAll( Lists.newArrayList( psi, pi, ps, erd, ed, longitude, latitude, ou, oun, ouc ) );
+        columns.addAll( Lists.newArrayList( psi, pi, ps, erd, ed, dd, longitude, latitude, ou, oun, ouc ) );
 
         if ( table.hasProgram() && table.getProgram().isRegistration() )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-09-07 20:02:22 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-09-08 17:39:20 +0000
@@ -334,7 +334,7 @@
                     date = currentDate;
                 }
 
-                // TODO ProgramIndicator.VAR_EXECUTION_DATE;
+                // TODO ProgramIndicator.VAR_EXECUTION_DATE, DUE_DATE
 
                 if ( date != null )
                 {
@@ -729,7 +729,7 @@
      * based on the given expression. Wraps the count variables with
      * <code>nullif</code> to avoid potential division by zero.
      *
-     * @param var        the program indicator variable.
+     * @param var the program indicator variable.
      * @param expression the program indicator expression.
      * @return a SQL select clause.
      */
@@ -739,6 +739,10 @@
         {
             return "executiondate";
         }
+        else if ( ProgramIndicator.VAR_DUE_DATE.equals( var ) )
+        {
+            return "duedate";
+        }
         else if ( ProgramIndicator.VAR_ENROLLMENT_DATE.equals( var ) )
         {
             return "enrollmentdate";

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties	2015-09-08 15:56:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties	2015-09-08 17:39:20 +0000
@@ -1008,6 +1008,7 @@
 #-- Program indicators --------------------------------------------------------#
 
 execution_date=Execution date
+due_date=Due date
 incident_date=Incident date
 enrollment_date=Enrollment date
 current_date=Current date

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm	2015-08-28 10:23:48 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm	2015-09-08 17:39:20 +0000
@@ -79,6 +79,7 @@
 					<td>
 						<select multiple id="expression-variables" name="expression-variables" size="7" style="width:100%" ondblclick="insertVariable('expression');" >
 							<option value="execution_date">$i18n.getString( "execution_date" )</option>
+							<option value="due_date">$i18n.getString( "due_date" )</option>
 							<option value="incident_date">$i18n.getString( "incident_date" )</option>
 							<option value="enrollment_date">$i18n.getString( "enrollment_date" )</option>
 							<option value="current_date">$i18n.getString( "current_date" )</option>
@@ -223,6 +224,7 @@
 					<td>
 						<select multiple id="filter-variables" name="filter-variables" size="7" style="width:100%" ondblclick="insertVariable('filter');" >
 							<option value="execution_date">$i18n.getString( "execution_date" )</option>
+							<option value="due_date">$i18n.getString( "due_date" )</option>
 							<option value="incident_date">$i18n.getString( "incident_date" )</option>
 							<option value="enrollment_date">$i18n.getString( "enrollment_date" )</option>
 							<option value="current_date">$i18n.getString( "current_date" )</option>