The requirement: - Patient list in OHRI should be filtered based on the sessionLocation at the time the patient is registered.
Use case: - One OpenMRS instance is deployed for use by facilities countrywide. Users log in from their facilities (choose login location) and would like to view only patients registered in that facility. Change in sessionLocation should reload the patient list with patients registered in the “changed-to” facility.
Have you implemented this or a similar functionality? How did you go about it?
One suggested solution is to record the sessionLocation as a person attribute mapped to a “Managing Organization” PersonAttributeType metadata.
What would this entail?
Add Managing Organization - PersonAttributeType metadata in the iniz config
Registration module (REST-WS) to create person attribute subresource
Registration module (FHIR) to include Patient.managingOrganization in Patient resource
Translator updated to map FHIR.Patient.managingOrganization to/from org.openmrs.PersonAttribute & org.openmrs.PersonAttributeType
FHIR2 searchPatients to factor in filtering by managingOrganization search/query param
We have deployed the datafilter module and noted the following:
The locations dropdown in the login page in refapp-2.x is not populated. Understandably because at this point, the user is not known (session not established).
The locations dropdown in the login page in OHRI/O3 is populated properly. The locations (basis/bases) in the dropdown are those linked to the sessionUser (entity) in datafilter_entity_basis_map
This so far is a non-issue as @asen123 can confirm that there is imminent complete upgrade to O3.
The challenge we have is; we have a sessionUser (entity) linked to a location (Hope Clinic) (basis) in datafilter_entity_basis_map and a patient (entity) linked to the same location (Hope Clinic) (basis) in datafilter_entity_basis_mapBUT, the patient list is blank with a 504 - Gateway timeout.
The superuser doesn’t face this challenge (No 504 - Gateway timeout error), all patients are loaded successfully.