MDMbox Docs

Referencing operation

The $referencing operation finds all FHIR resources in the database that reference a given resource. This is useful when preparing a merge plan — you need to know which related resources (Encounters, Observations, etc.) need their references updated.

Request

POST /api/fhir/Patient/123/$referencing
Content-Type: application/json
{
  "resourceType": "Parameters",
  "parameter": [
    {"name": "type", "valueString": "Encounter"},
    {"name": "type", "valueString": "Observation"},
    {"name": "count", "valueInteger": 50},
    {"name": "offset", "valueInteger": 0}
  ]
}

Parameters

NameTypeRequiredDescription
typevalueStringNoResource types to search (repeatable). If omitted, searches all types.
countvalueIntegerNoMaximum results per type (default: 100)
offsetvalueIntegerNoPagination offset (default: 0)

Response

A FHIR Bundle containing all resources that reference the target:

{
  "resourceType": "Bundle",
  "type": "searchset",
  "total": 3,
  "entry": [
    {
      "resource": {
        "resourceType": "Encounter",
        "id": "enc-1",
        "subject": {"reference": "Patient/123"}
      }
    },
    {
      "resource": {
        "resourceType": "Observation",
        "id": "obs-1",
        "subject": {"reference": "Patient/123"}
      }
    }
  ]
}

See also

Last updated: