Bed Management - Wards having other parent location are also visible

bed-management
Tags: #<Tag:0x00007f73f4b77a40>
(sameer gije) #1

Bahmni ver 0.91. When logged in to a location wards and beds of other location are also seen.

Here is the view of location hierarchy and the corresponding wards.

Shouldn’t it show wards only for the logged in location?

(Angshuman Sarkar) #2

The login location on Bahmni only symbolizes where a clinical encounter/visit is happening. It does not limit the ward view.

(sameer gije) #3

Yes, I noticed it and so to meet the requirements (to show only those wards which are at the logged in location - physical location), I added this code in bahmniapps/ui/app/bedmanagement/controllers/bedManagementController.js

var loadAllWards = function () {
    return spinner.forPromise(wardService.getWardsList().success(function (wardsList) {
        $scope.wards = _.filter(wardsList.results, function(result) { return (result.ward.parentLocation.uuid == $scope.$root.visitLocationUuid) });
    }));
};
(Angshuman Sarkar) #4

I am not sure if the product itself will support such code. If you want the product to support this, please raise this as a feature request and discuss in the PAT calls.

1 Like