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);
}
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);
}
Aggregations