Provider/Privilege Role and Create provider account inconsistent

@slubwama, i have decided to start a post about this since we have reproduced it together and you delayed to. Our Roles and privileges support adding Provider rights to a given user which i think was used before we introduced the Provider object in the platform, From when we added the provider table it looks like we now have to manually Create a Provider accounts for users in-order to assign them Provider rights which as well seems to have phased out the Provider Role and Manage Provider privilege functioning. The simple quick fix aka work around is to add a liquibase changeset either through a module or the platform that loops through all users and finds out all those that are actually assigned the Provider management roles/privileges and create provider accounts for each of them (could actually already be in the platform), this would only work for the old users and not for the current assignments of this role/privilege.

Is this a challenge any way or there’s a workaround that people are using to make these two distict approaches usable? if it is, we need this as part of the platform probably and also make the two ways to make users act as providers in OpenMRS Platform consistent and usable else eliminate one

1 Like

@k_joseph and @slubwama,

The short answer is that from the perspective of the current platform:

  • There is only one way to do things: it’s to use the Provider table.
    • From the API perspective, if you want to make a user a provider, you need to create both User and Provider accounts for that person. The Admin UI module in the reference application has a UI for “Manage Accounts” that attempts to unify these things.
  • There is nothing special about a Role with name=Provider
    • Before OpenMRS 1.9 used to be special, but that has been removed from all recent and supported versions of the platform.

So, in general, any implementation that’s on a recent version of the platform should be moving the Provider table approach, and not trying to preserve the role-named-“Provider” approach.

As part of OpenMRS 1.9 there is a liquibase changeset that creates Provider accounts for everyone who was listed as the provider of an encounter. But it seems that we never automatically created provider accounts for users who had the Provider role when upgrading to 1.9.

1 Like

@k_joseph, have you seen this yet?

2 Likes

We could really use a separate place to record the metadata of organizational roles and to define default application roles & privileges as well as whether a provider record should be created for any given organizational role. This would allow us to clean up the mess & confusion from organizational roles, application roles, and provider assignments. For example, allowing an administrator could say “a typical Clinical Officer should be assigned these application roles & privileges and get a provider record” and “a typical Data Entry Assistant get these other application roles & privileges and does not get a provider record.” This would allow us to finally get rid of roles like “Provider” or “Nurse” within our authorization engine (i.e., role and privilege tabes), which we should never be coding against anyway. Maybe an “organizationroles” module would help get us there.

In any case, it does make sense to help admins creating users new accounts for providers to be able to create the user account and provider record more easily.

2 Likes

Love that idea, @burke.

@jthomas, can we have this be included for Design Call?

1 Like

Apologies for my delayed response @ayeung. There is time on tomorrows design forum (Wednesday, May 11 @ 6-7pm UTC) or on Monday’s (May 16 @4-5pm UTC). Do you have a preference? Also are there particular people you would like to make sure are on the call?

Thanks, @jthomas. Probably @burke, @darius, and @k_joseph.

Great. I will put this on the schedule for Monday’s design forum then unless @burke @darius or @k_joseph can’t make it.

1 Like