=== 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-02-22 18:31:40 +0000 +++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2015-03-04 16:26:17 +0000 @@ -839,11 +839,11 @@ for ( String param : dimensionParams ) { String dimension = DimensionalObjectUtils.getDimensionFromParam( param ); - List options = DimensionalObjectUtils.getDimensionItemsFromParam( param ); + List items = DimensionalObjectUtils.getDimensionItemsFromParam( param ); - if ( dimension != null && options != null ) + if ( dimension != null && items != null ) { - list.addAll( getDimension( dimension, options, null, format, false ) ); + list.addAll( getDimension( dimension, items, null, format, false ) ); } } } @@ -867,7 +867,7 @@ List dataSets = new ArrayList<>(); List operandDataElements = new ArrayList<>(); - options: + itemLoop: for ( String uid : items ) { if ( uid != null && uid.startsWith( KEY_DE_GROUP ) ) @@ -881,7 +881,7 @@ dataElementGroups.add( group ); } - continue options; + continue itemLoop; } Indicator in = indicatorService.getIndicator( uid ); @@ -889,7 +889,7 @@ if ( in != null ) { indicators.add( in ); - continue options; + continue itemLoop; } DataElement de = dataElementService.getDataElement( uid ); @@ -897,7 +897,7 @@ if ( de != null ) { dataElements.add( de ); - continue options; + continue itemLoop; } DataSet ds = dataSetService.getDataSet( uid ); @@ -905,7 +905,7 @@ if ( ds != null ) { dataSets.add( ds ); - continue options; + continue itemLoop; } DataElementOperand dc = operandService.getDataElementOperandByUid( uid ); @@ -913,7 +913,7 @@ if ( dc != null ) { operandDataElements.add( dc.getDataElement() ); - continue options; + continue itemLoop; } throw new IllegalQueryException( "Data dimension option identifier does not reference any option: " + uid ); @@ -1112,7 +1112,7 @@ OrganisationUnitGroupSet ougs = organisationUnitGroupService.getOrganisationUnitGroupSet( dimension ); - if ( ougs != null ) + if ( ougs != null && ougs.isDataDimension() ) { List ous = asList( organisationUnitGroupService.getOrganisationUnitGroupsByUid( items ) ); @@ -1123,7 +1123,7 @@ DataElementGroupSet degs = dataElementService.getDataElementGroupSet( dimension ); - if ( degs != null ) + if ( degs != null && degs.isDataDimension() ) { List des = asList( dataElementService.getDataElementGroupsByUid( items ) ); @@ -1134,7 +1134,7 @@ CategoryOptionGroupSet cogs = categoryService.getCategoryOptionGroupSet( dimension ); - if ( cogs != null ) + if ( cogs != null && cogs.isDataDimension() ) { List cogz = asList( categoryService.getCategoryOptionGroupsByUid( items ) ); @@ -1219,7 +1219,7 @@ boolean orgUnitHierarchy = hierarchyMeta && DimensionType.ORGANISATIONUNIT.equals( dimension.getDimensionType() ); // ----------------------------------------------------------------- - // If dimension is not fixed and has no options, insert all options + // If dimension is not fixed and has no options, insert all items // ----------------------------------------------------------------- if ( !FIXED_DIMS.contains( dimension.getDimension() ) && items.isEmpty() )