Search in sources :

Example 1 with CollectionConverter

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

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

Example 3 with CollectionConverter

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

the class PihPatientDataLibrary method getAllDossierNumberIdentifiers.

@DocumentedDefinition("allDossierNumbers.identifier")
public PatientDataDefinition getAllDossierNumberIdentifiers() {
    PatientIdentifierDataDefinition pdd = new PatientIdentifierDataDefinition();
    pdd.setTypes(Arrays.asList(getDossierNumberType()));
    CollectionConverter cc = new CollectionConverter(new PropertyConverter(PatientIdentifier.class, "identifier"), false, new ComparableComparator());
    return new ConvertedPatientDataDefinition(pdd, cc);
}
Also used : PatientIdentifierDataDefinition(org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition) PropertyConverter(org.openmrs.module.reporting.data.converter.PropertyConverter) ComparableComparator(org.apache.commons.collections.comparators.ComparableComparator) CollectionConverter(org.openmrs.module.reporting.data.converter.CollectionConverter) PatientIdentifier(org.openmrs.PatientIdentifier) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Aggregations

CollectionConverter (org.openmrs.module.reporting.data.converter.CollectionConverter)3 ChainedConverter (org.openmrs.module.reporting.data.converter.ChainedConverter)2 PropertyConverter (org.openmrs.module.reporting.data.converter.PropertyConverter)2 DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)2 ComparableComparator (org.apache.commons.collections.comparators.ComparableComparator)1 PatientIdentifier (org.openmrs.PatientIdentifier)1 Person (org.openmrs.Person)1 Provider (org.openmrs.Provider)1 CollectionElementConverter (org.openmrs.module.reporting.data.converter.CollectionElementConverter)1 ObjectFormatter (org.openmrs.module.reporting.data.converter.ObjectFormatter)1 ConvertedEncounterDataDefinition (org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition)1 EncounterProviderDataDefinition (org.openmrs.module.reporting.data.encounter.definition.EncounterProviderDataDefinition)1 ConvertedPatientDataDefinition (org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition)1 PatientIdentifierDataDefinition (org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition)1