use of org.hisp.dhis.analytics.dimension.DimensionResponse in project dhis2-core by dhis2.
the class ProgramStageDataElementMapper method map.
@Override
public DimensionResponse map(BaseIdentifiableObject dimension, String prefix) {
ProgramStageDataElement programStageDataElement = (ProgramStageDataElement) dimension;
final DimensionResponse mapped = super.map(programStageDataElement.getDataElement(), prefix).withValueType(programStageDataElement.getDataElement().getValueType().name()).withId(getProgramStageDataElementUid(programStageDataElement));
return Optional.of(programStageDataElement).map(ProgramStageDataElement::getDataElement).map(DataElement::getOptionSet).map(BaseIdentifiableObject::getUid).map(mapped::withOptionSet).orElse(mapped);
}
use of org.hisp.dhis.analytics.dimension.DimensionResponse 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;
}
use of org.hisp.dhis.analytics.dimension.DimensionResponse in project dhis2-core by dhis2.
the class DataElementMapper method map.
@Override
public DimensionResponse map(BaseIdentifiableObject dimension, String prefix) {
DataElement dataElement = (DataElement) dimension;
final DimensionResponse mapped = super.map(dataElement, prefix).withValueType(dataElement.getValueType().name()).withId(String.join(".", prefix, dataElement.getUid()));
return Optional.of(dataElement).map(DataElement::getOptionSet).map(BaseIdentifiableObject::getUid).map(mapped::withOptionSet).orElse(mapped);
}
Aggregations