Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-2260

Add Encounter.providers property and deprecate old Encounter.provider property

    Details

    • Complexity:
      High

      Description

      Once we've introduced an EncounterProvider domain object, we need to update Encounter to use it to support multiple providers. (We do need an explicit domain object for EncounterProvider but we should include a few helper methods so that regular API users don't need to know about it.)

      Remove the "provider" property on the Encounter object.

      • Deprecating its setter and getter
        • getProvider() should return the person record for one provider on the encounter.
          • exactly which to return is unspecified
          • multiple sequential calls to getProvider() (without modifying the encounter) should consistently return the same provider
        • setProvider(Person) should (hackily) search for a Provider for this person, and add that provider to the encounter with the EncounterRole "unknown", removing any other providers with that role from the encounter.

      Add a new "providers" property.

      • List<EncounterProvider> getProviders() // plain getter
      • Map<EncounterRole, List<Provider>> getProvidersByRole() // convenience method
      • List<Provider> getProvidersByRole(EncounterRole)
      • void addEncounterProvider(EncounterProvider)
      • void addProvider(EncounterRole, Provider)
      • void setProvider(EncounterRole, Provider) // removes/voids any providers who previously had that role

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                raff Rafal Korytkowski
                Reporter:
                darius Darius Jazayeri [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: