Skip to content

Commit

Permalink
(fix): Program details NEP (#2045)
Browse files Browse the repository at this point in the history
  • Loading branch information
makombe authored Nov 5, 2024
1 parent 343ff97 commit 32d4889
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -989,13 +989,14 @@ public Object getPatientHivCarePanel(@RequestParam("patientUuid") String patient
}

CalculationResult tbPatientClassification = EmrCalculationUtils.evaluateForPatient(TbPatientClassificationCalculation.class, null, patient);
if(tbPatientClassification != null){
Obs obs = (Obs) tbPatientClassification.getValue();
if(obs.getValueCoded().equals(Dictionary.getConcept(Dictionary.SMEAR_POSITIVE_NEW_TUBERCULOSIS_PATIENT))) {
tbResponseObj.put("tbPatientClassification", "New tuberculosis patient");
}
else {
tbResponseObj.put("tbPatientClassification", obs.getValueCoded().getName().getName());
if (tbPatientClassification != null) {
Obs obs = (Obs) tbPatientClassification.getValue();
if (obs != null && obs.getValueCoded() != null) {
Concept valueCoded = obs.getValueCoded();
String classification = valueCoded.equals(Dictionary.getConcept(Dictionary.SMEAR_POSITIVE_NEW_TUBERCULOSIS_PATIENT))
? "New tuberculosis patient"
: valueCoded.getName().getName();
tbResponseObj.put("tbPatientClassification", classification);
}
}

Expand Down Expand Up @@ -1069,7 +1070,7 @@ public Object getPatientHivCarePanel(@RequestParam("patientUuid") String patient
//Check mch enrollment and followup forms
} else if(hivEnrollmentStatusObs != null || hivFollowUpStatusObs != null) {
String regimenName = null;
if(hivFollowUpStatusObs != null){
if(hivFollowUpStatusObs != null && hivFollowUpStatusObs.getValueCoded() != null) {
mchMotherResponseObj.put("hivStatus", hivFollowUpStatusObs.getValueCoded().getName().getName());
mchMotherResponseObj.put("hivStatusDate", hivFollowUpStatusObs.getValueDatetime());
}else {
Expand Down Expand Up @@ -1198,8 +1199,10 @@ public Object getPatientHivCarePanel(@RequestParam("patientUuid") String patient
if (milestones.size() > 0) {
StringBuilder sb = new StringBuilder();
for (Obs milestone : milestones) {
sb.append(milestone.getValueCoded().getName().toString());
sb.append(", ");
if(milestone.getValueCoded() != null) {
sb.append(milestone.getValueCoded().getName().toString());
sb.append(", ");
}
}
joined = sb.substring(0, sb.length() - 2);
mchChildResponseObj.put("milestonesAttained", joined);
Expand Down

0 comments on commit 32d4889

Please sign in to comment.