chronic-care / mcc-project

MCC eCare Plan project planning and documentation
Apache License 2.0
0 stars 1 forks source link

Update ecareplanner to use revised Linkage Resource #411

Closed kbertodatti closed 5 days ago

kbertodatti commented 4 months ago

Query for Linkage

For authorized patient https://$ohsu_fhir_server/FHIR/R4/Patient/ohsu.abc123def456:

base_url/Linkage?item=Patient/ohsu.abc123def456

Content of Linkage

{
  "resourceType": "Linkage",
  "item": [
    {
      "type": "source",
      "resource": {
        "reference”: "Patient/04328b77-cb3f-4c41-9ce1-71cf03a47ae3"
      }
    },
    {
      "type": “alternate",
      "resource": {
        "reference”: “Patient/ohsu.abc123def456”,
        "extension": [
          {
            "url": "urn:sds:partition-name",
            “valueUrl": "https://$ohsu_fhir_server/FHIR/R4"
          }
        ]
      }
    }
  ]
}

Content from Linkage resource that needs to go into the HTTP header

A Linkage resource created by the SDS contains two items:

The source (a local Patient reference) can be used to read the local patient and search for related resources. A local Patient will contain minimal elements. It exists primarily for reference.

The alternate (a foreign Patient reference) can be used to read the foreign patient and search for related resources. A foreign Patient will be either (a) a stub that contains minimal elements that exists solely for reference or (b) a Patient resource stored earlier by the application

Additionally, the patient references (local and foreign) can be used to delete (either a logical delete or an expunge). I am currently testing the exact REST operation for accomplishing this.