Stream: Da Vinci/plan-net-connectathon
Topic: Iterative include and revinclude
Lee Surprenant (May 14 2020 at 21:34):
Scenario 5a is a doosey: {{url}}/Practitioner?identifier=1230782571&_revinclude=PractitionerRole:practitioner&_include=PractitionerRole:organization
Lee Surprenant (May 14 2020 at 21:34):
Our server rejects that with
{
"resourceType": "OperationOutcome",
"id": "ac-1e-23-d8-de0de6ae-b3c4-45e9-910e-4cef9a025264",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "The join resource type must match the resource type being searched."
},
"expression": [
"<empty>"
]
}
]
}
Lee Surprenant (May 14 2020 at 21:34):
and I think its right
Lee Surprenant (May 14 2020 at 21:35):
I think that query is trying to say "_revinclude practitionerRoles for this practitioner and then include all the organizations referenced from those practitionerRoles"
Lee Surprenant (May 14 2020 at 21:36):
but per https://www.hl7.org/fhir/search.html#include I think it would need an iterate
modifier to do that
Lee Surprenant (May 14 2020 at 21:36):
The inclusion process can be iterative, if (and only if) the modifier :iterate is included. For example, this search returns all Medication Request resources and their prescribing Practitioner Resources for the matching Medication Dispense resources:
GET [base]/MedicationDispense?_include=MedicationDispense:prescription
&_include:iterate=MedicationRequest:performer&criteria...
Lee Surprenant (May 14 2020 at 21:37):
I'd imagine the query could be re-written to avoid this...let me know if you'd like me to try my hand at that
Saul Kravitz (May 14 2020 at 22:30):
@Stephen MacVicar
Last updated: Apr 12 2022 at 19:14 UTC