Search in sources :

Example 1 with NullValueConverter

use of org.openmrs.module.reporting.data.converter.NullValueConverter 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 2 with NullValueConverter

use of org.openmrs.module.reporting.data.converter.NullValueConverter 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)

Aggregations

ChainedConverter (org.openmrs.module.reporting.data.converter.ChainedConverter)2 DataSetRowConverter (org.openmrs.module.reporting.data.converter.DataSetRowConverter)2 ListConverter (org.openmrs.module.reporting.data.converter.ListConverter)2 NullValueConverter (org.openmrs.module.reporting.data.converter.NullValueConverter)2 DataSetRow (org.openmrs.module.reporting.dataset.DataSetRow)2