MDM Expansion

Once MDM is enabled and multiple linked resources exist, it can be useful to search across all linked resources.

For example, consider the following MDM links in your repository:

Patient/101 --> Patient/103

Patient/102 --> Patient/103

This indicates that both Patient/101 and Patient/102 are MDM-matched to the same Golden Resource (Patient/103). If you want to retrieve all observations for Patient/101, including observations from all of its linked resources, you can achieve this by first querying the $mdm-query-links endpoint and then making a subsequent request, such as the following:

GET http://localhost:7001/oracle-fhir-server/fhir /Observation?subject=Patient/101,Patient/102,Patient/103

But Healthcare Data Repository FHIR can also uses :mdm parameter to achieve the above steps.

GET http://localhost:7001/oracle-fhir-server/fhir /Observation?subject:mdm=Patient/101

The two above HTTP requests will return the same result.

Example Response:
{
  "resourceType" : "Bundle",
  "id" : "ab0f5f6d-d357-4557-b40b-21844de532e3",
  "meta" : {
    "lastUpdated" : "2025-01-29T12:41:09.655+05:30"
  },
  "type" : "searchset",
  "total" : 2,
  "link" : [ {
    "relation" : "self",
    "url" : "http://localhost:7001/oracle-fhir-server/fhir/Observation?subject%3Amdm=Patient%2F101"
  } ],
  "entry" : [ {
    "fullUrl" : "http://localhost:7001/oracle-fhir-server/fhir/Observation/106",
    "resource" : {
      "resourceType" : "Observation",
      "id" : "106",
      "meta" : {
        "versionId" : "1",
        "lastUpdated" : "2025-01-29T12:37:59.098+05:30",
        "source" : "#YjymkN51CHOThY6o"
      },
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: example</p><p><b>status</b>: final</p><p><b>category</b>: Vital Signs <span>(Details : {http://terminology.hl7.org/CodeSystem/observation-category code 'vital-signs' = 'Vital Signs', given as 'Vital Signs'})</span></p><p><b>code</b>: Body Weight <span>(Details : {LOINC code '29463-7' = 'Body weight', given as 'Body Weight'}; {LOINC code '3141-9' = 'Body weight Measured', given as 'Body weight Measured'}; {SNOMED CT code '27113001' = 'Body weight', given as 'Body weight'}; {http://acme.org/devices/clinical-codes code 'body-weight' = 'body-weight', given as 'Body Weight'})</span></p><p><b>subject</b>: <a>Patient/example</a></p><p><b>encounter</b>: <a>Encounter/example</a></p><p><b>effective</b>: 28/03/2016</p><p><b>value</b>: 185 lbs<span> (Details: UCUM code [lb_av] = 'lb_av')</span></p></div>"
      },
      "status" : "final",
      "category" : [ {
        "coding" : [ {
          "system" : "http://terminology.hl7.org/CodeSystem/observation-category",
          "code" : "vital-signs",
          "display" : "Vital Signs"
        } ]
      } ],
      "code" : {
        "coding" : [ {
          "system" : "http://loinc.org",
          "code" : "29463-7",
          "display" : "Body Weight"
        }, {
          "system" : "http://loinc.org",
          "code" : "3141-9",
          "display" : "Body weight Measured"
        }, {
          "system" : "http://snomed.info/sct",
          "code" : "27113001",
          "display" : "Body weight"
        }, {
          "system" : "http://acme.org/devices/clinical-codes",
          "code" : "body-weight",
          "display" : "Body Weight"
        } ]
      },
      "subject" : {
        "reference" : "Patient/101"
      },
      "effectiveDateTime" : "2016-03-28",
      "valueQuantity" : {
        "value" : 185,
        "unit" : "lbs",
        "system" : "http://unitsofmeasure.org",
        "code" : "[lb_av]"
      }
    },
    "search" : {
      "mode" : "match"
    }
  }, {
    "fullUrl" : "http://localhost:7001/oracle-fhir-server/fhir/Observation/107",
    "resource" : {
      "resourceType" : "Observation",
      "id" : "107",
      "meta" : {
        "versionId" : "1",
        "lastUpdated" : "2025-01-29T12:39:30.538+05:30",
        "source" : "#82pb9z1fbhPUIRff"
      },
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: example</p><p><b>status</b>: final</p><p><b>category</b>: Vital Signs <span>(Details : {http://terminology.hl7.org/CodeSystem/observation-category code 'vital-signs' = 'Vital Signs', given as 'Vital Signs'})</span></p><p><b>code</b>: Body Weight <span>(Details : {LOINC code '29463-7' = 'Body weight', given as 'Body Weight'}; {LOINC code '3141-9' = 'Body weight Measured', given as 'Body weight Measured'}; {SNOMED CT code '27113001' = 'Body weight', given as 'Body weight'}; {http://acme.org/devices/clinical-codes code 'body-weight' = 'body-weight', given as 'Body Weight'})</span></p><p><b>subject</b>: <a>Patient/example</a></p><p><b>encounter</b>: <a>Encounter/example</a></p><p><b>effective</b>: 28/03/2016</p><p><b>value</b>: 185 lbs<span> (Details: UCUM code [lb_av] = 'lb_av')</span></p></div>"
      },
      "status" : "final",
      "category" : [ {
        "coding" : [ {
          "system" : "http://terminology.hl7.org/CodeSystem/observation-category",
          "code" : "vital-signs",
          "display" : "Vital Signs"
        } ]
      } ],
      "code" : {
        "coding" : [ {
          "system" : "http://loinc.org",
          "code" : "29463-7",
          "display" : "Body Weight"
        }, {
          "system" : "http://loinc.org",
          "code" : "3141-9",
          "display" : "Body weight Measured"
        }, {
          "system" : "http://snomed.info/sct",
          "code" : "27113001",
          "display" : "Body weight"
        }, {
          "system" : "http://acme.org/devices/clinical-codes",
          "code" : "body-weight",
          "display" : "Body Weight"
        } ]
      },
      "subject" : {
        "reference" : "Patient/102"
      },
      "effectiveDateTime" : "2017-03-28",
      "valueQuantity" : {
        "value" : 195,
        "unit" : "lbs",
        "system" : "http://unitsofmeasure.org",
        "code" : "[lb_av]"
      }
    },
    "search" : {
      "mode" : "match"
    }
  } ]
}

To support MDM expansion, the Healthcare Data Repository FHIR server should be enabled with the following property in hdr_fhir.yaml properties file: allow_mdm_expansion: true