Skip to content

Commit 2c83e52

Browse files
BAH-2433 | fixed. custom display message for chief complaint data in the bundle
1 parent 45c6ece commit 2c83e52

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

api/src/main/java/org/bahmni/module/hip/Config.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public enum Config {
3232
IMAGE("Image"),
3333
PATIENT_VIDEO("Patient Video"),
3434
CONCEPT_DETAILS_CONCEPT_CLASS("Concept Details"),
35+
CHIEF_COMPLAINT_CODED("Chief Complaint Coded"),
36+
SIGN_SYMPTOM_DURATION("Sign/symptom duration"),
37+
CHIEF_COMPLAINT_DURATION("Chief Complaint Duration"),
3538

3639
//Physical_Examination_Ignoring_Form_List
3740
Forms_To_Ignore_In_Physical_Examination("Discharge Summary, Death Note, Delivery Note, Opioid Substitution Therapy - Intake, Opportunistic Infection, " +

omod/src/main/java/org/bahmni/module/hip/web/service/FHIRResourceMapper.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.hl7.fhir.r4.model.Enumerations;
2525
import org.hl7.fhir.r4.model.Annotation;
2626
import org.hl7.fhir.r4.model.MarkdownType;
27+
import org.hl7.fhir.r4.model.StringType;
2728

2829
import org.openmrs.DrugOrder;
2930
import org.openmrs.EncounterProvider;
@@ -230,12 +231,19 @@ public Condition mapToCondition(OpenMrsCondition openMrsCondition, Patient patie
230231
public Observation mapToObs(Obs obs) {
231232
Concept concept = initializeEntityAndUnproxy(obs.getConcept());
232233
obs.setConcept(concept);
233-
// if (obs.getGroupMembers().size() > 0 && Config.CONCEPT_DETAILS_CONCEPT_CLASS.getValue().equals(obs.getConcept().getConceptClass().getName()) && obs.getFormFieldNamespace() != null) {
234-
// Obs[] groupMembersArray = new Obs[obs.getGroupMembers().size()];
235-
// groupMembersArray = obs.getGroupMembers().toArray(groupMembersArray);
236-
// obs.setValueText(groupMembersArray[0].getValueCoded().getDisplayString() + " " + "since" + " " + groupMembersArray[2].getValueNumeric() + " " + groupMembersArray[1].getValueCoded().getDisplayString());
237-
// }
238234
Observation observation = observationTranslator.toFhirResource(obs);
235+
if (obs.getGroupMembers().size() > 0 && Config.CONCEPT_DETAILS_CONCEPT_CLASS.getValue().equals(obs.getConcept().getConceptClass().getName()) && obs.getFormFieldNamespace() != null) {
236+
String chiefComplaintCoded = null, signOrSymptomDuration = null, chiefComplaintDuration = null;
237+
for (Obs childObs : obs.getGroupMembers()) {
238+
if(childObs.getConcept().getName().getName().equals(Config.CHIEF_COMPLAINT_CODED.getValue()))
239+
chiefComplaintCoded = childObs.getValueCoded().getDisplayString();
240+
if(childObs.getConcept().getName().getName().equals(Config.SIGN_SYMPTOM_DURATION.getValue()))
241+
signOrSymptomDuration = childObs.getValueNumeric().toString();
242+
if(childObs.getConcept().getName().getName().equals(Config.CHIEF_COMPLAINT_DURATION.getValue()))
243+
chiefComplaintDuration = childObs.getValueCoded().getDisplayString();
244+
}
245+
observation.setValue(new StringType(chiefComplaintCoded + " " + "since" + " " + signOrSymptomDuration + " " + chiefComplaintDuration));
246+
}
239247
observation.addNote(new Annotation(new MarkdownType(obs.getComment())));
240248
return observation;
241249
}

0 commit comments

Comments
 (0)