dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38557
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19641: Analytics, added support for explicitly defining category option combo ids
------------------------------------------------------------
revno: 19641
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-07-14 13:17:34 +0200
message:
Analytics, added support for explicitly defining category option combo ids
modified:
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.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/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2015-06-19 13:27:23 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2015-07-14 11:17:34 +0000
@@ -1170,7 +1170,19 @@
if ( CATEGORYOPTIONCOMBO_DIM_ID.equals( dimension ) )
{
- DimensionalObject object = new BaseDimensionalObject( dimension, DimensionType.CATEGORY_OPTION_COMBO, null, DISPLAY_NAME_CATEGORYOPTIONCOMBO, new ArrayList<NameableObject>() );
+ List<NameableObject> cocs = new ArrayList<NameableObject>();
+
+ for ( String uid : items )
+ {
+ DataElementCategoryOptionCombo coc = idObjectManager.get( DataElementCategoryOptionCombo.class, uid );
+
+ if ( coc != null )
+ {
+ cocs.add( coc );
+ }
+ }
+
+ DimensionalObject object = new BaseDimensionalObject( dimension, DimensionType.CATEGORY_OPTION_COMBO, null, DISPLAY_NAME_CATEGORYOPTIONCOMBO, cocs );
return Lists.newArrayList( object );
}