← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12837: Event analytics, added coordinates of event

 

------------------------------------------------------------
revno: 12837
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-30 17:31:33 +0100
message:
  Event analytics, added coordinates of event
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.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/event/data/DefaultEventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2013-10-16 19:06:05 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2013-10-30 16:31:33 +0000
@@ -89,6 +89,7 @@
     private static final String ITEM_EVENT = "psi";
     private static final String ITEM_PROGRAM_STAGE = "ps";
     private static final String ITEM_EXECUTION_DATE = "eventdate";
+    private static final String ITEM_COORDINATES = "coordinates";
     private static final String ITEM_ORG_UNIT = "ou";
     private static final String ITEM_ORG_UNIT_NAME = "ouname";
     private static final String ITEM_ORG_UNIT_CODE = "oucode";
@@ -201,6 +202,7 @@
         grid.addHeader( new GridHeader( ITEM_EVENT, "Event" ) );
         grid.addHeader( new GridHeader( ITEM_PROGRAM_STAGE, "Program stage" ) );
         grid.addHeader( new GridHeader( ITEM_EXECUTION_DATE, "Event date" ) );
+        grid.addHeader( new GridHeader( ITEM_COORDINATES, "Coordinates" ) );
         grid.addHeader( new GridHeader( ITEM_ORG_UNIT_NAME, "Organisation unit name" ) );
         grid.addHeader( new GridHeader( ITEM_ORG_UNIT_CODE, "Organisation unit code" ) );
         grid.addHeader( new GridHeader( ITEM_ORG_UNIT, "Organisation unit" ) );

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-10-16 21:11:00 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-10-30 16:31:33 +0000
@@ -178,7 +178,7 @@
     
     public Grid getEvents( EventQueryParams params, Grid grid )
     {
-        String sql = "select psi,ps,executiondate,ouname,oucode," + getSelectColumns( params ) + " ";
+        String sql = "select psi,ps,executiondate,coordinates,ouname,oucode," + getSelectColumns( params ) + " ";
 
         // ---------------------------------------------------------------------
         // Criteria

=== 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	2013-10-24 11:03:46 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java	2013-10-30 16:31:33 +0000
@@ -231,11 +231,12 @@
         String[] psi = { "psi", "character(11) not null", "psi.uid" };
         String[] ps = { "ps", "character(11) not null", "ps.uid" };
         String[] ed = { "executiondate", "date", "psi.executiondate" };
+        String[] cord = { "coordinates", "character varying(100)", "psi.coordinates" };
         String[] ou = { "ou", "character(11) not null", "ou.uid" };
         String[] oun = { "ouname", "character varying(230) not null", "ou.name" };
         String[] ouc = { "oucode", "character varying(50)", "ou.code" };
         
-        columns.addAll( Arrays.asList( gender, isdead, psi, ps, ed, ou, oun, ouc ) );
+        columns.addAll( Arrays.asList( gender, isdead, psi, ps, ed, cord, ou, oun, ouc ) );
         
         return columns;
     }