fastenhealth / fasten-onprem

Fasten is an open-source, self-hosted, personal/family electronic medical record aggregator, designed to integrate with 100,000's of insurances/hospitals/clinics
GNU General Public License v3.0
1.63k stars 85 forks source link

Cerner: PDF Binary documents are not syncing correctly (404) #204

Open AnalogJ opened 1 year ago

AnalogJ commented 1 year ago

Debugging notes:

GET /r4/11e960ca-465e-403d-a8ac-REDACTED/Binary/XR-12928REDACTED
HTTP/1.1
Host: fhir-myrecord.cerner.com
Accept: application/json+fhir
 404 - 404 Not Found [{"resourceType":"OperationOutcome","issue":[{"severity":"error","code":"not-found","details":{"text":"Resource not found"}}]}]

However XML-12928REDACTED works correctly


The consumer must populate the Accept header with either application/fhir+json or the format returned in the attachment.contentType of the referring resource. If the Accept header is application/fhir+json, a FHIR Binary resource is returned with the raw data populated in Binary.data. If the Accept header is anything else, the raw data will be returned instead of a FHIR Binary resource. For more information, see the HL7® FHIR® Binary documentation.

Note: in order to retrieve documents with the application/pdf content type, Cerner’s Clinical Reporting (XR) solution must be installed for the client site you are loading data from. For additional information about Cerner’s Clinical Reporting (XR) solution see Cerner’s Clinical Reporting (XR) Reference Pages.

AnalogJ commented 1 year ago

Trying to replicate this issue using Cerner open sandbox:

curl -H "Accept: application/fhir+json" "https://fhir-open.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/DocumentReference/201512321"
{
  "resourceType": "DocumentReference",
  "id": "201512321",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2022-12-20T16:44:06.000Z"
  },
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Document Reference</b></p><p><b>Patient Name</b>: Smart II, Nancyu Nha Eeeeee</p><p><b>Document Type</b>: Admission Note Physician</p><p><b>Document Title</b>: Hip - Labral Tear</p><p><b>Service Start Date</b>: Dec 20, 2022  4:44 P.M. UTC</p><p><b>Service End Date</b>: Dec 20, 2023  4:44 P.M. UTC</p><p><b>Document Status</b>: Final</p><p><b>Verifying Provider</b>: Portal, Portal</p></div>"
  },
  "identifier": [
    {
      "system": "https://fhir.cerner.com/ceuuid",
      "value": "CE87caf4b7-9397-4667-9897-702218017c9e-201512321-2022122016440600"
    }
  ],
  "status": "current",
  "docStatus": "final",
  "type": {
    "coding": [
      {
        "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/72",
        "code": "2820507",
        "display": "Admission Note Physician",
        "userSelected": true
      },
      {
        "system": "http://loinc.org",
        "code": "83805-2",
        "userSelected": false
      }
    ],
    "text": "Admission Note Physician"
  },
  "category": [
    {
      "coding": [
        {
          "system": "http://loinc.org",
          "code": "83805-2",
          "userSelected": false
        }
      ]
    },
    {
      "coding": [
        {
          "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category",
          "code": "clinical-note",
          "display": "Clinical Note",
          "userSelected": false
        }
      ],
      "text": "Clinical Note"
    },
    {
      "coding": [
        {
          "system": "http://loinc.org",
          "code": "67852-4",
          "userSelected": false
        }
      ]
    }
  ],
  "subject": {
    "reference": "Patient/12724066",
    "display": "Smart II, Nancyu Nha Eeeeee"
  },
  "date": "2022-12-20T16:44:06Z",
  "author": [
    {
      "reference": "Practitioner/12742069",
      "display": "Portal, Portal"
    }
  ],
  "authenticator": {
    "reference": "Practitioner/12742069",
    "display": "Portal, Portal"
  },
  "custodian": {
    "reference": "Organization/675844",
    "display": "Model Hospital"
  },
  "content": [
    {
      "attachment": {
        "contentType": "application/pdf",
        "url": "https://fhir-open.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/Binary/XR-201512321",
        "title": "Hip - Labral Tear",
        "creation": "2022-12-20T16:44:04.000Z"
      },
      "format": {
        "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem",
        "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient",
        "display": "mimeType Sufficient"
      }
    },
    {
      "attachment": {
        "contentType": "application/xml",
        "url": "https://fhir-open.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/Binary/XML-201512321",
        "title": "Hip - Labral Tear",
        "creation": "2022-12-20T16:44:04.000Z"
      },
      "format": {
        "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem",
        "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient",
        "display": "mimeType Sufficient"
      }
    }
  ],
  "context": {
    "encounter": [
      {
        "reference": "Encounter/97953477"
      }
    ],
    "period": {
      "start": "2022-12-20T16:44:04Z",
      "end": "2023-12-20T16:44:04Z"
    },
    "related": [
      {
        "reference": "DiagnosticReport/201512321"
      }
    ]
  }
}
curl -H "Accept: application/fhir+json" "https://fhir-open.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/Binary/XR-201512321" | jq

RESULT: Worked.
AnalogJ commented 1 year ago

Issue opened with Cerner - https://forums.oracle.com/ords/apexds/post/binary-document-404-error-0893