Querying linked data
A matched entity is stored as multiple resources connected by a Linkage. Use the standard FHIR R4 search interactions to retrieve linked data (see Searching FHIR resources).
- Get all resources linked to a patient
-
Use the
itemsearch parameter to find the patient'sLinkage, and_include=Linkage:itemto return the linked resources in the same bundle:GET /Linkage?item=Patient/patient-A&_include=Linkage:item - Get all linkages in the data store
-
Return every
Linkagealong with its linked resources:GET /Linkage?_include=Linkage:item&_count=100 - Count the linkages in the data store
-
GET /Linkage?_summary=count - Get clinical data across a linked patient
-
To retrieve another resource type (such as
Observation) for a patient and everyone linked to them, first read theLinkageto get the linked patient IDs:GET /Linkage?item=Patient/patient-A&_include=Linkage:itemThen search the target resource type across those IDs:
GET /Observation?patient=Patient/patient-A,Patient/patient-B,Patient/patient-C