There’s growing interest in migrating the provider role functionality from the Provider Management Module into OpenMRS Core. This suggestion was initially discussed in PROV-110.
This was discussed on today’s platform team call but if any one has reservations or insights on the best way moving forward on that, feel free to chime in.
Thanks @mherman22 , I think it would be great to use the opportunity of an upcoming major version release to move at least some of the provider management functionality into core - with a focus on those things that many downstream modules already leverage.
Specifically, one thing the providermanagement module already does (presumably as agreed upon long ago with an eye to merging one day into core) is actually modify the core provider table, by adding a foreign key reference to a provider role.
So, at minimum, I would say that we want to:
Add the ProviderRole domain object to core (this is Openmrs Metadata)
Add a providerRole property to Provider (and corresponding data model change)
One area to discuss would be whether to keep ProviderRole relatively lean, or to migrate in the relationshipTypes, superviseeProviderRoles, and/or providerAttributeTypes properties that are part of ProviderRole within the module. For expediency (and since these are relatively little-used features of the module), it may be preferable to choose not to include these, and then to retain them in the provider management module (with whatever code tweaks is needed to support them as something that is not part of the core data model).
I think the main thing is to move into core the capability to “Get all Radiologists” or “Get all Pharmacists” or say “Current user can do / see this because they are X type of provider”.
For existing implementations already using the Provider Management module in production.
If we move providerRole into Core, any downstream modules referencing it from providermanagement will need to be refactored abit i guess.
Won’t we need a migration path and compatibility layer for modules that still expect the extended data model ?
On the testing + QA side of things , I think regression testing across core modules (esp. HTML Form Entry, Reporting, etc.) will be important to ensure that roles are interpreted consistently after the migration.
Subject: Feedback on Migrating Provider Roles to Core (from PROV-110)
Hi everyone,
Thanks for raising this important topic.
I think migrating the provider role functionality into OpenMRS Core could be a good long-term move — especially if it’s widely used and the Provider Management Module is becoming more of a core requirement across implementations.
That said, I do have a few questions and thoughts:
Backward Compatibility: For implementations currently relying on the Provider Management Module, will there be a clear migration path? What steps would be needed to avoid disruptions?
Data Model: Would the existing Core Provider or Person model be updated to accommodate roles directly, or would we bring in the current ProviderRole structure as-is?
Deprecation Plan: If this moves forward, will the Provider Management Module be deprecated officially, or still supported for legacy use cases?
I’m also curious how others are currently using provider roles — whether it’s basic categorization (e.g. doctor, nurse) or something more hierarchical or dynamic.
Looking forward to hearing more insights. Thanks again for opening this up for discussion!
I was actually thinking of bringing relationshiptypes, superviseeproviderroles and providerattributetypes properties along because of specifically this method purgeProviderRole(). And the intention is not to tamper with the existing logic in this particular commit that moves provider role to core.
My gut is to vote strongly for not migrating stuff like the superivseeprovider roles as these are infrequently used and a little cumbersome, but I haven’t dug into the code in much detail. We wouldn’t officially deprecate the Provider Management module, but I don’t think it would need to be bundled into the Ref App anymore… I think the main functionality used is just the provider roles functionality. I will try to look into this a little more before the end of the week and weigh in with a potential migration plan.
Yeah, and specifically, when we add the Provider Role object to core we wouldn’t include the provider attribute, supervisee provider role and relationship type tables, ie we’d just define the provider role table more or less as defined here:
And then we just add the Provider Role property to the Provider object.
Ideally, we could create a new version of the Provider Management module that cuts out the functionality that has been migrated to core, but I don’t think its a dealbreaker if we don’t do that immediately.