Search in sources :

Example 1 with ChainedConverter

use of org.openmrs.module.reporting.data.converter.ChainedConverter in project openmrs-module-pihcore by PIH.

the class DataConverterLibrary method getObsValueCodedConceptCode.

public DataConverter getObsValueCodedConceptCode(String conceptSourceName) {
    ChainedConverter ret = new ChainedConverter();
    ret.addConverter(getObsValueCodedConverter());
    ret.addConverter(new ConceptCodeFromConceptConverter(conceptSourceName));
    return ret;
}
Also used : ChainedConverter(org.openmrs.module.reporting.data.converter.ChainedConverter) ConceptCodeFromConceptConverter(org.openmrs.module.reporting.data.converter.ConceptCodeFromConceptConverter)

Example 2 with ChainedConverter

use of org.openmrs.module.reporting.data.converter.ChainedConverter in project openmrs-module-pihcore by PIH.

the class DataConverterLibrary method getLastDataSetItemConverter.

public DataConverter getLastDataSetItemConverter(String columnName, Object nullReplacement) {
    ChainedConverter ret = new ChainedConverter();
    ret.addConverter(new ListConverter(TimeQualifier.LAST, 1, DataSetRow.class));
    ret.addConverter(new DataSetRowConverter(columnName));
    if (nullReplacement != null) {
        ret.addConverter(new NullValueConverter(nullReplacement));
    }
    return ret;
}
Also used : ChainedConverter(org.openmrs.module.reporting.data.converter.ChainedConverter) NullValueConverter(org.openmrs.module.reporting.data.converter.NullValueConverter) DataSetRowConverter(org.openmrs.module.reporting.data.converter.DataSetRowConverter) ListConverter(org.openmrs.module.reporting.data.converter.ListConverter) DataSetRow(org.openmrs.module.reporting.dataset.DataSetRow)

Example 3 with ChainedConverter

use of org.openmrs.module.reporting.data.converter.ChainedConverter in project openmrs-module-pihcore by PIH.

the class DataConverterLibrary method getDataSetItemConverter.

public DataConverter getDataSetItemConverter(Integer index, String columnName, Object nullReplacement) {
    ChainedConverter ret = new ChainedConverter();
    ret.addConverter(new ListConverter(index, DataSetRow.class));
    ret.addConverter(new DataSetRowConverter(columnName));
    if (nullReplacement != null) {
        ret.addConverter(new NullValueConverter(nullReplacement));
    }
    return ret;
}
Also used : ChainedConverter(org.openmrs.module.reporting.data.converter.ChainedConverter) NullValueConverter(org.openmrs.module.reporting.data.converter.NullValueConverter) DataSetRowConverter(org.openmrs.module.reporting.data.converter.DataSetRowConverter) ListConverter(org.openmrs.module.reporting.data.converter.ListConverter) DataSetRow(org.openmrs.module.reporting.dataset.DataSetRow)

Example 4 with ChainedConverter

use of org.openmrs.module.reporting.data.converter.ChainedConverter in project openmrs-module-pihcore by PIH.

the class PihEncounterDataLibrary method getAllProviders.

@DocumentedDefinition
public EncounterDataDefinition getAllProviders() {
    EncounterProviderDataDefinition dd = new EncounterProviderDataDefinition();
    dd.setSingleProvider(false);
    ChainedConverter itemConverter = new ChainedConverter(new PropertyConverter(Provider.class, "person"), new PropertyConverter(Person.class, "personName"), new ObjectFormatter("{givenName} {familyName}"));
    return new ConvertedEncounterDataDefinition(dd, new CollectionConverter(itemConverter, false, null), new ObjectFormatter(", "));
}
Also used : ChainedConverter(org.openmrs.module.reporting.data.converter.ChainedConverter) ObjectFormatter(org.openmrs.module.reporting.data.converter.ObjectFormatter) ConvertedEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition) PropertyConverter(org.openmrs.module.reporting.data.converter.PropertyConverter) EncounterProviderDataDefinition(org.openmrs.module.reporting.data.encounter.definition.EncounterProviderDataDefinition) Person(org.openmrs.Person) CollectionConverter(org.openmrs.module.reporting.data.converter.CollectionConverter) Provider(org.openmrs.Provider) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 5 with ChainedConverter

use of org.openmrs.module.reporting.data.converter.ChainedConverter in project openmrs-module-pihcore by PIH.

the class DataConverterLibrary method getObsValueCodedPresentConverter.

public DataConverter getObsValueCodedPresentConverter(Concept valueCoded) {
    ChainedConverter converter = new ChainedConverter();
    converter.addConverter(new CollectionConverter(getObsValueCodedConverter(), false, null));
    converter.addConverter(new CollectionElementConverter(valueCoded, true, false));
    return converter;
}
Also used : ChainedConverter(org.openmrs.module.reporting.data.converter.ChainedConverter) CollectionElementConverter(org.openmrs.module.reporting.data.converter.CollectionElementConverter) CollectionConverter(org.openmrs.module.reporting.data.converter.CollectionConverter)

Aggregations

ChainedConverter (org.openmrs.module.reporting.data.converter.ChainedConverter)7 ListConverter (org.openmrs.module.reporting.data.converter.ListConverter)4 CollectionConverter (org.openmrs.module.reporting.data.converter.CollectionConverter)2 DataConverter (org.openmrs.module.reporting.data.converter.DataConverter)2 DataSetRowConverter (org.openmrs.module.reporting.data.converter.DataSetRowConverter)2 NullValueConverter (org.openmrs.module.reporting.data.converter.NullValueConverter)2 DataSetRow (org.openmrs.module.reporting.dataset.DataSetRow)2 Person (org.openmrs.Person)1 Provider (org.openmrs.Provider)1 CollectionElementConverter (org.openmrs.module.reporting.data.converter.CollectionElementConverter)1 ConceptCodeFromConceptConverter (org.openmrs.module.reporting.data.converter.ConceptCodeFromConceptConverter)1 ObjectFormatter (org.openmrs.module.reporting.data.converter.ObjectFormatter)1 PropertyConverter (org.openmrs.module.reporting.data.converter.PropertyConverter)1 ConvertedEncounterDataDefinition (org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition)1 EncounterProviderDataDefinition (org.openmrs.module.reporting.data.encounter.definition.EncounterProviderDataDefinition)1 DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)1