Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
OpenMRS has the privilege based access control implementations. Like that one, we implemented a Location based Access control system. It will manage the access to the services based on the locations. Some implementations want to register the users and patients (the persons also) in certain selected locations. Then access them based on the location that someone has logged in. That way, if someone is logged in a certain location, they should see only those encounters, observations, and patients registered in that location. This project was initiated into the Google Summer of Code 2018.
Module Code Repository: https://github.com/openmrs/openmrs-module-locationbasedaccess
Initially, the Location Based Access Control module provides a feature to track the patients based on the given locations. Other features will be extended and will be added into this module soon. Read the following Deployment Steps to install and run the location based access control module in your OpenMRS distribution.
The minimum required version of the OpenMRS Core is version 1.9. If you haven't updated version of OpenMRS Core, you should update the OpenMRS Core before using Location based access control module.
The minimum required version of the App UI module is version 1.9. If you haven't updated version of App UI module, you should update the App UI module before using Location based access control module.
The minimum required version of the UI Framework module is version 3.9. If you haven't updated version of UI Framework module, you should update the UI Framework module before using Location based access control module.
The minimum required version of the Admin UI module is version 1.2.4. If you haven't updated version of Admin UI module, you should update the Admin UI module before using Location based access control module.
The minimum required version of the Reference Application module is version 2.9.0. If you haven't updated version of Reference Application module, you should update the Reference Application module before using Location based access control module.
Patients should be allocated with the locations when they are registering into the OpenMRS to track them by Location Based Access Control module. OpenMRS Administrator or the privileged user should do some changes in the Patient Registration Dashboard to allow the locations allocations for the patient registrations. Location Based Access control module provides a fragment for this requirement, and It should be added through the App definition for the Patient Registration Dashboard.
Please follow these steps to change the App definition of the Patient Registration Dashboard,
Save the new App configuration.
If you have any issues on Registration App Configuration, please read this detail documentation.
Custom Registration App Configuration with Location Selection App Definition
You can use this following custom fragment section to add the Location Selection Fragment for the Location Based Access Control Module.
{ "id": "referenceapplication.registrationapp.myRegWithLoc", "instanceOf": "registrationapp.registerPatient", "label": "Register Patient", "description": "Create a new Patient Record", "extensions": [ { "id": "referenceapplication.registrationapp.registerPatient.homepageLink", "extensionPointId": "org.openmrs.referenceapplication.homepageLink", "type": "link", "label": "referenceapplication.app.registerPatient.label", "url": "registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.myRegWithLoc", "icon": "icon-user", "order": 1, "requiredPrivilege": "App: registrationapp.registerPatient" } ], "config": { "afterCreatedUrl": "/coreapps/clinicianfacing/patient.page?patientId={{patientId}}", "sections": [ { "id": "contactInfo", "label": "registrationapp.patient.contactInfo.label", "questions": [ { "legend": "Person.address", "fields": [ { "type": "personAddress", "label": "registrationapp.patient.address.question", "widget": { "providerName": "uicommons", "fragmentId": "field/personAddress" } } ] }, { "legend": "registrationapp.patient.phone.label", "id": "phoneNumberLabel", "fields": [ { "type": "personAttribute", "label": "registrationapp.patient.phone.question", "formFieldName": "phoneNumber", "uuid": "14d4f066-15f5-102d-96e4-000c29c2a5d7", "widget": { "providerName": "uicommons", "fragmentId": "field/text" }, "cssClasses": ["phone"] } ] } ] }, { "id": "relationships-info", "label": "registrationapp.person.relationship", "questions": [ { "legend": "registrationapp.person.relationship.label", "header": "registrationapp.person.relationship.question", "fields": [ { "type": "personRelationships", "widget": { "providerName": "registrationapp", "fragmentId": "field/personRelationship" } } ] } ] }, { "id": "accesslocation-info", "label": "Access Location", "questions": [ { "legend": "Patient Location ", "id": "patientLocationLabel", "fields": [ { "type": "personAttribute", "label": "Select Location", "formFieldName": "locationId", "uuid": "0a93cbc6-5d65-4886-8091-47a25d3df944", "widget": { "providerName": "locationbasedaccess", "fragmentId": "field/locations" } } ] } ] } ] } }
Requirments
If you want to get this feature, then you need to update your Admin UI Module to v1.2.4 or later, You can get Admin UI Module from this link to get the OMOD of the v1.2.4-SNAPSHOT for your testing purposes (clone this repository and type mvn clean install to get the OMOD of v1.2.4-SNAPSHOT from the project).
You can assign the accessible locations to the users through the Manage Account dashboard.
Requirments
If you want to get this feature, then you need to update your Reference Application Module to v2.9.0 or later, You can get Reference Application Module from this link to get the OMOD of the v2.9.0-SNAPSHOT for your testing purposes (clone this repository and type mvn clean install to get the OMOD of v2.9.0-SNAPSHOT from the project).
Location selection in the user login screen will be disabled through the Location based access control module since it can be fetched automatically through the location user property. The location based access control module will create a global property with name as "referenceapplication.locationUserPropertyName" and value as "locationUuid" while module starts (if a global property not exists in this name).
It will follow these steps while a user tries to login,
If you want to disable this feature to get the login screen with location selector, Go to System Administration → Global Properties, and then delete the global property named as "referenceapplication.locationUserPropertyName" or set the value as "false" to that global property.
Major features from this module are,
Notice
Location Based Access control module will not restrict the ADMIN user to access the data from different locations. It will only add the restrictions to the users who have the less privileges from the Admin (Eg : Doctors, Nurses, Data Entry Operators).
Please follow these steps to remove the Location based access control module from your system ,
Location Based Access Control GSoC project