Skip to content

Commit

Permalink
BAH-3092 | add capability to show primary diagnosis in OT list view
Browse files Browse the repository at this point in the history
Co-authored-by: Ashish Kurian <[email protected]>
  • Loading branch information
kavitha-sundararajan and Ashish Kurian committed Jul 5, 2023
1 parent 3af2c72 commit 30331d9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ui/app/ot/controller/listViewController.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ angular.module('bahmni.ot')
var attributesRelatedToBed = [{heading: 'Status Change Notes', sortInfo: 'notes'},
{heading: 'Bed Location', sortInfo: 'bedLocation'},
{heading: 'Bed ID', sortInfo: 'bedNumber'}];

return listViewAttributes.concat(getSurgicalAttributesTableInfo(), attributesRelatedToBed);
var primaryDiagnosisInfo = [{heading: 'Primary Diagnoses', sortInfo: 'patientObservations'}];
return listViewAttributes.concat(getSurgicalAttributesTableInfo(), attributesRelatedToBed, primaryDiagnosisInfo);
}

function getFilteredSurgicalAttributeTypes () {
Expand Down
16 changes: 15 additions & 1 deletion ui/app/ot/mappers/SurgicalBlockMapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ Bahmni.OT.SurgicalBlockMapper = function () {
return mappedAttributes;
};

var mapPrimaryDiagnoses = function (diagnosisObs) {
var primaryDiagnosesNames = _.filter(diagnosisObs, function (diagnosis) {
var obsGroupList = diagnosis.obsGroup.display.split(": ")[1].split(", ");
return _.includes(obsGroupList, "Primary");
}).map(function (diagnosis) {
if (diagnosis.concept.display == "Non-coded Diagnosis") {
return diagnosis.value;
}
return diagnosis.value.display;
}).join(", ");
return primaryDiagnosesNames;
};

var mapSurgicalAppointment = function (openMrsSurgicalAppointment, attributeTypes, surgeonsList) {
var surgicalAppointmentAttributes = mapOpenMrsSurgicalAppointmentAttributes(openMrsSurgicalAppointment.surgicalAppointmentAttributes, surgeonsList);
return {
Expand All @@ -43,7 +56,8 @@ Bahmni.OT.SurgicalBlockMapper = function () {
status: openMrsSurgicalAppointment.status,
bedLocation: (openMrsSurgicalAppointment.bedLocation || ""),
bedNumber: (openMrsSurgicalAppointment.bedNumber || ""),
surgicalAppointmentAttributes: new Bahmni.OT.SurgicalBlockMapper().mapAttributes(surgicalAppointmentAttributes, attributeTypes)
surgicalAppointmentAttributes: new Bahmni.OT.SurgicalBlockMapper().mapAttributes(surgicalAppointmentAttributes, attributeTypes),
primaryDiagnosis: mapPrimaryDiagnoses(openMrsSurgicalAppointment.patientObservations) || ""
};
};

Expand Down
2 changes: 1 addition & 1 deletion ui/app/ot/services/surgicalAppointmentService.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ angular.module('bahmni.ot')
v: "custom:(id,uuid," +
"provider:(uuid,person:(uuid,display),attributes:(attributeType:(display),value,voided))," +
"location:(uuid,name),startDatetime,endDatetime,surgicalAppointments:(id,uuid,patient:(uuid,display,person:(age))," +
"actualStartDatetime,actualEndDatetime,status,notes,sortWeight,bedNumber,bedLocation,surgicalAppointmentAttributes))"
"actualStartDatetime,actualEndDatetime,status,notes,sortWeight,bedNumber,bedLocation,surgicalAppointmentAttributes,patientObservations))"
},
withCredentials: true
});
Expand Down
3 changes: 3 additions & 0 deletions ui/app/ot/views/listView.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<td>
{{appointment.bedNumber}}
</td>
<td class="list-view-primary-diagnosis">
{{appointment.primaryDiagnosis}}
</td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 4 additions & 0 deletions ui/app/styles/ot/_ot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ div[ng-app="ot"] {
.status-cancelled {
background: #fcb6b6;
}
.list-view-primary-diagnosis {
min-width: 300px;
white-space: normal;
}
}
}

Expand Down

0 comments on commit 30331d9

Please sign in to comment.