dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24963
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12289: Event aggregate analytics
------------------------------------------------------------
revno: 12289
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-09-27 22:35:13 +0200
message:
Event aggregate analytics
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
--
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-09-27 18:32:05 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2013-09-27 20:35:13 +0000
@@ -104,6 +104,7 @@
// -------------------------------------------------------------------------
//TODO order the event analytics tables up front to avoid default sorting in queries
+ //TODO filter items support
public Grid getAggregatedEventData( EventQueryParams params )
{
@@ -115,7 +116,11 @@
// Headers
// ---------------------------------------------------------------------
- grid.addHeader( new GridHeader( ITEM_DIM_ID, "Item" ) );
+ for ( QueryItem item : params.getItems() )
+ {
+ grid.addHeader( new GridHeader( item.getItem().getUid(), item.getItem().getName() ) );
+ }
+
grid.addHeader( new GridHeader( PERIOD_DIM_ID, "Period" ) );
grid.addHeader( new GridHeader( ORGUNIT_DIM_ID, "Organisation unit" ) );
grid.addHeader( new GridHeader( "value", "Value" ) );
=== 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-09-27 18:32:05 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java 2013-09-27 20:35:13 +0000
@@ -98,13 +98,15 @@
int value = rowSet.getInt( "value" );
String ou = rowSet.getString( params.getOrganisationUnitLevel() );
+ grid.addRow();
+
for ( QueryItem queryItem : params.getItems() )
{
- String itemValue = rowSet.getString( queryItem.getItem().getUid() );
- String item = queryItem.getItem().getName() + ": " + itemValue;
-
- grid.addRow().addValue( item ).addValue( null ).addValue( ou ).addValue( value );
+ String item = rowSet.getString( queryItem.getItem().getUid() );
+ grid.addValue( item );
}
+
+ grid.addValue( null ).addValue( ou ).addValue( value );
}
return grid;