Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAH-790 Functionality to view obs forms based on provider Types #260

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

krishnanspace
Copy link
Contributor

To test this functionality this PR is also needed: Bahmni/default-config#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

var extensions = clinicalAppConfigService.getAllConceptSetExtensions($stateParams.conceptSetGroupName);
var configs = clinicalAppConfigService.getAllConceptsConfig();
var visitType = configurations.encounterConfig().getVisitTypeByUuid($scope.consultation.visitTypeUuid);
$scope.context = {visitType: visitType, patient: $scope.patient};
var enablePrivilegeTypeBasedFormsAccess = appService.getAppDescriptor().getConfigValue('enablePrivilegeTypeBasedFormsAccess');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krishnanspace
both enablePrivilegeTypeBasedFormsAccess and privilegeTypeBasedFormsAccess don't match with the one mentioned in the PR raised default-config.

privilegeNames.push(match[1]);
}
}));
return privilegeNames;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krishnanspace What exactly does privilegeNames return ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants