Search in sources :

Example 1 with ListConverter

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

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

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

the class DataConverterLibrary method getListItemConverter.

public DataConverter getListItemConverter(Integer index, DataConverter... converters) {
    ChainedConverter ret = new ChainedConverter();
    ret.addConverter(new ListConverter(index, Object.class));
    for (DataConverter converter : converters) {
        ret.addConverter(converter);
    }
    return ret;
}
Also used : ChainedConverter(org.openmrs.module.reporting.data.converter.ChainedConverter) ListConverter(org.openmrs.module.reporting.data.converter.ListConverter) DataConverter(org.openmrs.module.reporting.data.converter.DataConverter)

Example 4 with ListConverter

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

the class DataConverterLibrary method getLastListItemConverter.

public DataConverter getLastListItemConverter(DataConverter... converters) {
    ChainedConverter ret = new ChainedConverter();
    ret.addConverter(new ListConverter(TimeQualifier.LAST, 1, Object.class));
    for (DataConverter converter : converters) {
        ret.addConverter(converter);
    }
    return ret;
}
Also used : ChainedConverter(org.openmrs.module.reporting.data.converter.ChainedConverter) ListConverter(org.openmrs.module.reporting.data.converter.ListConverter) DataConverter(org.openmrs.module.reporting.data.converter.DataConverter)

Aggregations

ChainedConverter (org.openmrs.module.reporting.data.converter.ChainedConverter)4 ListConverter (org.openmrs.module.reporting.data.converter.ListConverter)4 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