Search Based on Parameters _include and _revinclude
The _include parameter returns resources referenced by the matching resources, while _revinclude returns resources that reference the matching resources.
As defined by the FHIR specification, both _include and _revinclude use the following syntax:
<SourceResourceType>:<searchParameter>[:<TargetResourceType>]
|
Component |
Description |
|---|---|
|
<SourceResourceType> |
Resource containing the reference |
|
<searchParameter> |
Reference-type search parameter |
|
<TargetResourceType> |
Optional: Specific target resource type when multiple target types are possible |
-
You can combine the _include or _revinclude parameter with other search parameters.
-
You can use multiple _include and _revinclude parameters together in a single search request.
-
The _include and _revinclude parameters are also supported in searches using an HTTP POST request.
Examples
_include
-
Return MedicationRequests and any referenced Practitioner, PractitionerRole, Organization, Patient, RelatedPerson, or Device:
GET https://api.eu10.health-data.cloud.sap/instance123/fhir/MedicationRequest?_include=MedicationRequest:requester
-
Return all Accounts with name “HACC” and all their associated Patients:
GET https://api.eu10.health-data.cloud.sap/instance123/fhir/Account?name=HACC&_include=Account:subject:Patient
-
Return all female Patients along with their associated Organization resources:
GET https://api.eu10.health-data.cloud.sap/instance123/fhir/Patient?gender=female&_include=Patient:organization
_revinclude
-
Return the matching Patient resources along with all Observation resources whose subject reference points to those patients:
GET https://api.eu10.health-data.cloud.sap/instance123/Patient?_revinclude=Observation:subject:Patient
-
Return Patient “123” along with all Claim resources where the patient is identified as the recipient of the products or services being claimed:
GET https://api.eu10.health-data.cloud.sap/instance123/Patient?_id=123&_revinclude=Claim:patient
-
Return the Organization named “WHO” along with all Account resources managed by that organization:
GET https://api.eu10.health-data.cloud.sap/instance123/Organization?name=WHO&_revinclude=Account:owner
Restriction
:iterate modifier is not supported.
