openmrs-module-bahmniapps
openmrs-module-bahmniapps copied to clipboard
BAH-790 Functionality to view obs forms based on provider Types
To test this functionality this PR is also needed: https://github.com/Bahmni/default-config/pull/38 This functionality depends on 2 configs mentioned in the above PR.
The first one is enableProviderTypeBasedFormsAccess
which is set to false by default. When its set to false, the regular functionality/workflow takes place i.e. All the Obs Forms are visible to the current provider.
If it is set to true , the Provider Type Based access to forms is enabled i.e. a particular provider is only able to view the Obs forms assigned to them.
In the linked PR , there are 2 provider types: provider1 & provider2 and each have a particular set of forms that they can view.
For this to actually work, providerAttribute types have to be created in OpenMRS with the exact same names as the ones specified in the app.json file. The attribute datatype must be boolean.
Create multiple attributes as per your requirements. Then set the value of the attributes to true for your providers. For example, your Provider is called "Dr.John" who is of type "XYZ" then set the XYZ provider attribute for Dr.John to true.
This will ensure that Dr. John of type XYZ can only view the forms mentioned in the app.json config