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

Enhance the $everything operation to add support for Practitioners and Organizations #2337

Closed
ewill00 opened this issue May 10, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request needs-design

Comments

@ewill00
Copy link

ewill00 commented May 10, 2021

Is your feature request related to a problem? Please describe.
The FHIR $everything operator that was recently implemented still has a few gaps. At least one of the FHIR UIs would show the Practitioner and Organization information if it was available through $everything

Describe the solution you'd like
The current $everything implementation grabs the subresources using the following method CopmartmentUtil.getCompartmentReourceTypes() all of those resources can then be queried to narrowed down by individual patients. For instance, one of the subresources is Condition representing the conditions for a Patient, and in order to query the conditions for a patient the following query is executed:

GET fhir-server/api/v4/Condition?subject={patient_id}
This pattern can be followed with all the subresources returned from the method mentioned, that however does not include Practitioner and Organization. That sort of makes sense a doctor or a hospital are not subresources of a patient, they are merely related joined by some sort of Encounter.

The purpose of this issue is to investigate with the FHIR team what is the best way to formulate the queries:

Get me all Practitioners that are somehow related to this patient via an encounter (or others ways?)
Get me all Organizations that are somehow related to this patient via an encounter (or others ways?)

Describe alternatives you've considered
Would like to find the most efficient way to get the Organizations or Practitioners associated with a given Patient

Acceptance Criteria
1.
GIVEN [a patient]
WHEN [using the $everything operator]
AND [there are Organizations or Practitioners associated with this Patient]
THEN [return those Organizations or Practitioners]

Additional context

@lmsurpre
Copy link
Member

One potential idea for this is to allow operators to configure exactly what they want to be considered in a patient compartment. See #2143 for more information on that one.

It might also be possible just to write special rules for each resource type, but the thing I like about #2143 is it would give everyone a way of defining their own notion of $everything related to a patient.

@prb112 prb112 added the enhancement New feature or request label May 10, 2021
@lmsurpre
Copy link
Member

Maybe Location too

@sfc42 sfc42 self-assigned this Jan 7, 2022
@sfc42
Copy link
Contributor

sfc42 commented Jan 25, 2022

There were two deliveries for this issue:

#3207
#3243

@tbieste
Copy link
Contributor

tbieste commented Mar 17, 2022

Verified with the following config:

            "everything": {
                "includeTypes": [
                    "Organization",
                    "Practitioner"
                ]
            }

Practitioners and Organizations associated with the Patient are returned in the GET Patient/<id>/$everything results.

@tbieste tbieste closed this as completed Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-design
Projects
None yet
Development

No branches or pull requests

5 participants