dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26365
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13067: Event analytics, reflecting change in coordinates to lat/long
------------------------------------------------------------
revno: 13067
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-11-29 12:54:56 +0100
message:
Event analytics, reflecting change in coordinates to lat/long
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-30 16:31:33 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2013-11-29 11:54:56 +0000
@@ -89,7 +89,8 @@
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_LONGITUDE = "longitude";
+ private static final String ITEM_LATITUDE = "latitude";
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";
@@ -202,7 +203,8 @@
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_LONGITUDE, "Longitude" ) );
+ grid.addHeader( new GridHeader( ITEM_LATITUDE, "Latitude" ) );
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-30 16:31:33 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java 2013-11-29 11:54:56 +0000
@@ -178,7 +178,7 @@
public Grid getEvents( EventQueryParams params, Grid grid )
{
- String sql = "select psi,ps,executiondate,coordinates,ouname,oucode," + getSelectColumns( params ) + " ";
+ String sql = "select psi,ps,executiondate,longitude,latitude,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-11-27 19:02:17 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java 2013-11-29 11:54:56 +0000
@@ -180,6 +180,8 @@
public List<String[]> getDimensionColumns( AnalyticsTable table )
{
+ final String dbl = statementBuilder.getDoubleColumnType();
+
List<String[]> columns = new ArrayList<String[]>();
Collection<OrganisationUnitLevel> levels =
@@ -233,12 +235,13 @@
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[] longitude = { "longitude", dbl, "psi.longitude" };
+ String[] latitude = { "latitude", dbl, "psi.latitude" };
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, cord, ou, oun, ouc ) );
+ columns.addAll( Arrays.asList( gender, isdead, psi, ps, ed, longitude, latitude, ou, oun, ouc ) );
return columns;
}