← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19882: Event analytics, added support for enrollment_date variable

 

------------------------------------------------------------
revno: 19882
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-08-28 12:55:55 +0200
message:
  Event analytics, added support for enrollment_date variable
modified:
  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


--
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-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-08-27 15:28:24 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java	2015-08-28 10:55:55 +0000
@@ -317,6 +317,7 @@
         String[] psi = { quote( "psi" ), "character(11) not null", "psi.uid" };
         String[] pi = { quote( "pi" ), "character(11) not null", "pi.uid" };
         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[] longitude = { quote( "longitude" ), dbl, "psi.longitude" };
         String[] latitude = { quote( "latitude" ), dbl, "psi.latitude" };
@@ -324,7 +325,7 @@
         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, ed, longitude, latitude, ou, oun, ouc ) );
+        columns.addAll( Lists.newArrayList( psi, pi, ps, erd, ed, 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-08-27 22:22:39 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-08-28 10:55:55 +0000
@@ -787,7 +787,11 @@
     {
         if ( ProgramIndicator.VAR_EXECUTION_DATE.equals( var ) )
         {
-            return "executiondate";
+            return "cast(executiondate as date)";
+        }
+        else if ( ProgramIndicator.VAR_ENROLLMENT_DATE.equals( var ) )
+        {
+            return "cast(enrollmentdate as date)";
         }
         else if ( ProgramIndicator.VAR_CURRENT_DATE.equals( var ) )
         {