use of org.hisp.dhis.common.ValueTypedDimensionalItemObject in project dhis2-core by dhis2.
the class DefaultEventAnalyticsService method addEventDataObjects.
/**
* Puts elements into the mapping table. The elements are fetched from the
* query parameters.
*
* @param grid the {@link Grid}.
* @param params the {@link EventQueryParams}.
* @param table the map to add elements to.
* @param dimension the dimension identifier.
*/
private void addEventDataObjects(Grid grid, EventQueryParams params, Map<String, List<EventAnalyticsDimensionalItem>> table, String dimension) {
List<EventAnalyticsDimensionalItem> objects = params.getEventReportDimensionalItemArrayExploded(dimension);
if (objects.isEmpty()) {
ValueTypedDimensionalItemObject eventDimensionalItemObject = dataElementService.getDataElement(dimension);
if (eventDimensionalItemObject == null) {
eventDimensionalItemObject = trackedEntityAttributeService.getTrackedEntityAttribute(dimension);
}
addEventReportDimensionalItems(eventDimensionalItemObject, objects, grid, dimension);
table.put(eventDimensionalItemObject.getDisplayProperty(params.getDisplayProperty()), objects);
} else {
table.put(dimension, objects);
}
}
use of org.hisp.dhis.common.ValueTypedDimensionalItemObject in project dhis2-core by dhis2.
the class BaseDimensionalItemObjectMapper method map.
@Override
public DimensionResponse map(BaseIdentifiableObject dimension, String prefix) {
BaseDimensionalItemObject baseDimensionalItemObject = (BaseDimensionalItemObject) dimension;
DimensionResponse responseWithDimensionType = super.map(dimension, prefix).withDimensionType(baseDimensionalItemObject.getDimensionItemType().name());
if (dimension instanceof ValueTypedDimensionalItemObject) {
ValueTypedDimensionalItemObject valueTypedDimensionalItemObject = (ValueTypedDimensionalItemObject) dimension;
return responseWithDimensionType.withValueType(valueTypedDimensionalItemObject.getValueType().name());
}
return responseWithDimensionType;
}
Aggregations