Search in sources :

Example 1 with CodedObsConverter

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

the class BaseEncounterDataSetManager method addSymptomPresentOrAbsentColumn.

protected void addSymptomPresentOrAbsentColumn(EncounterDataSetDefinition dsd, String columnName, String symptomPresentQuestion, String symptomAbsentQuestion, String symptomAnswer, Object valueIfPresent, Object valueIfAbsent) {
    Concept presentConcept = Metadata.getConcept(symptomPresentQuestion);
    Concept absentConcept = Metadata.getConcept(symptomAbsentQuestion);
    Concept answerConcept = Metadata.getConcept(symptomAnswer);
    MultipleObsForEncounterDataDefinition d = new MultipleObsForEncounterDataDefinition();
    d.addQuestion(presentConcept);
    d.addQuestion(absentConcept);
    CodedObsConverter converter = new CodedObsConverter();
    converter.addOption(presentConcept.getUuid(), answerConcept.getUuid(), valueIfPresent);
    converter.addOption(absentConcept.getUuid(), answerConcept.getUuid(), valueIfAbsent);
    addColumn(dsd, columnName, d, converter);
}
Also used : Concept(org.openmrs.Concept) CodedObsConverter(org.openmrs.module.pihcore.reporting.converter.CodedObsConverter) MultipleObsForEncounterDataDefinition(org.openmrs.module.pihcore.reporting.encounter.definition.MultipleObsForEncounterDataDefinition)

Example 2 with CodedObsConverter

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

the class MultipleObsForEncounterDataEvaluatorTest method addSymptomPresentOrAbsentColumn.

protected void addSymptomPresentOrAbsentColumn(EncounterDataSetDefinition dsd, String columnName, String symptomPresentQuestion, String symptomAbsentQuestion, String symptomAnswer, Object valueIfPresent, Object valueIfAbsent) {
    Concept presentConcept = Metadata.getConcept(symptomPresentQuestion);
    Concept absentConcept = Metadata.getConcept(symptomAbsentQuestion);
    Concept answerConcept = Metadata.getConcept(symptomAnswer);
    MultipleObsForEncounterDataDefinition d = new MultipleObsForEncounterDataDefinition();
    d.addQuestion(presentConcept);
    d.addQuestion(absentConcept);
    CodedObsConverter converter = new CodedObsConverter();
    converter.addOption(presentConcept.getUuid(), answerConcept.getUuid(), valueIfPresent);
    converter.addOption(absentConcept.getUuid(), answerConcept.getUuid(), valueIfAbsent);
    dsd.addColumn(columnName.toUpperCase(), d, "", converter);
}
Also used : Concept(org.openmrs.Concept) CodedObsConverter(org.openmrs.module.pihcore.reporting.converter.CodedObsConverter) MultipleObsForEncounterDataDefinition(org.openmrs.module.pihcore.reporting.encounter.definition.MultipleObsForEncounterDataDefinition)

Aggregations

Concept (org.openmrs.Concept)2 CodedObsConverter (org.openmrs.module.pihcore.reporting.converter.CodedObsConverter)2 MultipleObsForEncounterDataDefinition (org.openmrs.module.pihcore.reporting.encounter.definition.MultipleObsForEncounterDataDefinition)2