Status: Code Review (Initial)
Affects Version/s: None
Fix Version/s: None
As of now, the EncounterProviderAndRoles tag uses providerRoles to filter the list of providers in the dropdown/autocomplete.
We need to provide a way to introduce the filtering by userRoles where we can provide a list of roles.
- Should be able to configure list of comma separated userRoles.
- It should fetch all the users which has any of the given roles => and find the associated provider with each user.
- It should not fetch duplicate providers in case, a user has more than one configured roles.
- It should work in dropdown and autocomplete mode.
- The userRoles attribute should be ignored if encounterRoles attribute is present.
- Introduce new attribute in the EncounterProviderAndRoleTag.java.
- Use userRoles to filter the providers in the EncounterProviderAndRoleTag.java.
- Introduce userRoles in ProviderAjaxAutoCompleteWidget.java. Include configured roles on the page similar to encounterRoles.
- Extract userRoles in htmlFormEntry.js and send as part of ajax request parameters.
- Enhance ProviderSearchController.java to accept userRoles as request parameters and use it for filtering.
A sample poc is pushed here for the same.
Originally, it has been discussed as part of this talk thred.