Stream: implementers
Topic: revinclude for PractitionerRole with clinical resource types
Torin Shepard (Jul 16 2021 at 22:27):
What is syntax to get Bundle containing all of the following?
Conditions for a given patient
Practitioners for these Conditions where Practitioner.id=Condition.asserter
PractitionerRoles where PractitionerRole.practitioner = Conditioner.asserter
What does the following do? Look at 3rd parameter.
Condition?patient=[patient_id]&_include=Condition:asserter:Practitioner&_revinclude=PractitionerRole:practitioner
All Conditions for specified patient
plus include Practitioners referenced in Condition.asserter
plus include PractitionerRoles where practitioner references what?
Should this revinclude all PractitionerRolre resources where PractitionerRole.practitioner = Condition.asserter and Condition.recorder?
Is there a syntax to revinclude only the PractitionerRoles that link to Condition.asserter?
Lloyd McKenzie (Jul 16 2021 at 22:37):
The _revinclude will grab all PractitionerRole instances that point to any Practitioners that are the direct result of the searchset - which in this case would be none. You'd need to do _revinclude:iterate=PractitionerRole:practitioner to get PractitionerRoles that pointed to the included Pracitioners from Contiion.asserter. However, typically, you don't want all PractitionerRoles. Instead, what you actually want is to grab the Practitioner (and perhaps the Organization) pointed to by PractitionerRole in those cases where Condition.asserter is a PractitionerRole rather than a Practitioner.
Lloyd McKenzie (Jul 16 2021 at 22:39):
If you only want PractitionerRoles for asserter, you'd say Condition?_include=Condition:asserter:PractitionerRole
Lloyd McKenzie (Jul 16 2021 at 22:40):
I suspect what you want is:
Condition?patient=[some_id]&_include=Condition:asserter&include:iterate=PractitionerRole:practitioner
Knowing all of the PractitionerRoles for a practitioner irrespective of how they were acting and what organization they might work for doesn't seem too useful.
Torin Shepard (Jul 16 2021 at 22:51):
Thank you for responding! I'm trying to solve a problem caused by R4 having PractitionerRole separate from Practitioner. With DSTU2, _include=Condition.asserter would give me Practitioner which included practitionerRole element. With R4, I need an additional parameter on the Condition query to be able to get PractitionerRole resource.
In our update for R4, we have implemented Condition.asserter and recorder as reference to only Practitioner. We will not be supporting these Condition elements as reference to PractitionerRole.
We will be able to support _include=Condition:asserter:Practitioner and/or _include=Condition:recorder:Practitioner
If I understand correctly, adding _include:interate=PractitionerRole:practitioner should cause our FHIR Server to include all PractitionerRoles that point to the Practitioners in Condition.asserter and recorder.
Lloyd McKenzie (Jul 17 2021 at 02:08):
The issue is that if asserter points to Practitioner, you have no idea what role applied - and there could be lots of candidates (and lots of organizations). All you know is "this was asserted by Dr. Smith on behalf of one of the many organizations they work for wearing one of the many hats they work for each organization.
Last updated: Apr 12 2022 at 19:14 UTC