Retrieve Documents Using Document Query Endpoints (FHIR)

This topic provides information on retrieving documents using FHIR in Oracle Health Clinical Data Exchange.

  1. Log in to Oracle Health Clinical Data Exchange and select View Payer Hub.
  2. Review your Payer Profile ID.
  3. Select Get FHIR Client ID to obtain an OAuth 2.0 client ID.
  4. Obtain the Oracle Health Clinical Data Exchange FHIR endpoint and the OAuth 2.0 Token Provider from the payer profile ID resource.
  5. Configure your application to retrieve the insured patient's documents using the client ID, token provider, and FHIR endpoint.
Oracle Health Clinical Data Exchange receives and processes documents using the following process:
  1. The payer system receives ADT messages using a configured notification delivery endpoint.
  2. The system extracts the applicable data such as encounter ID, and then prepares the FHIR request and maps the data extracted from the ADT messages in the request.
  3. The system sends a request to query the endpoint configured in the service.
  4. If the patient match and encounter coverage checks are successful, the system receives a response that includes applicable clinical documents.

See REST APIs for Oracle Health Clinical Data Exchange on Oracle Help Center for more information.

See the below example of an ADT message that is delivered to a notification delivery endpoint. In the below example, the following values represent the following data elements:
  • xxxxx: This value represents the financial identification number (FIN).
  • yyyyy: This value represents the financial organization ID.
  • zzzzz: This value represents the FHIR tenant ID.
MSH|^~\&|fhirTenantId^zzzzz^UUID|HNA500||^1.99.888.7.66666.5.444.33.2.1^ISO|20241021220538||ADT^A04|Q104785659T118867590X0||2.3||||||8859/1
EVN|A04|20240423000000
PID|1||1234^^&&1.99.888.7.66666.5.444.33.2.1&ISO~2604321189^^^&1.99.888.7.66666.5.444.33.2.1&ISO||CDEXHUB^TESTPATIENT^^^^^L||20000310|M|||STREET ADDRESS 1^STREET ADDRESS 2^OP^ST^12345^US^H^^""|||||||xxxxx^^^FIN&yyyyy&ISO^FIN NBR^""|9876xxxxx|||Not Hispanic, Latino, or Spanish Origin
PV1|1|O|MX Clinic 2^""^""^MX Clinic 2^^^MX Clinic 2|""||""^""^""^""^^^""|953^Testuser^Testuser^^^^^^PERSONNEL PRIMARY IDENTIFIER^^^^PPI^""|||""|""|""|""|""|""|""|SYSTEMSYSTEM^SYSTEM^SYSTEM^Cerner^^^^^External Id^^^^EXTID^""|CLI||CM||""||||||||||||||""|""|""|MX Clinic 2||DIS|||20240423000000-0500|20240520235959-0500
IN1|1|3654331^Oracle Health^^^Oracle Health|3808059|Oracle Health|123 MAIN STREET^^ANYWHERE^ST^12345^US^B^^""||(816)555-0123^WPN^""|3480||0||20240401000000-0500|||CM|CDEXHUB^TESTING^^^^^L|CD:158|20000310|STREET ADDRESS 1^STREET ADDRESS 2^OP^ST^12345^US^H^^""|""||1|||||||||||||CM||||||||M||""||""||9439034

See the below examples of a patient query request and response for retrieving a patient ID.

Request:

curl "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/fhir/r4/1234567-1234-1234-1234-123456789101/Patient?family=patient&given=test&birthdate=1900-01-01&phone=8165550123" -H 'Authorization: Bearer <token>' 

Response:

{
    "resourceType": "Bundle",
    "total": 1,
    "entry":
    [
        {
            "fullUrl": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/1234567-1234-1234-1234-123456789101/Patient/0123456789",
            "resource":
            {
                "resourceType": "Patient",
                "id": "0123456789",
                "identifier":
                [
                    {
                        "use": "usual",
                        "type":
                        {
                            "coding":
                            [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                    "code": "MR",
                                    "display": "Medical record number"
                                }
                            ]
                        },
                        "system": "1.99.888.7.66666.5.444.33.2.1",
                        "value": "0123456789"
                    },
                    {
                        "use": "usual",
                        "type":
                        {
                            "coding":
                            [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                    "code": "MR",
                                    "display": "Medical record number"
                                }
                            ]
                        },
                        "system": "12345678123456781234567812345678_2.99.888.7.66666.5.444.33.2.1",
                        "value": "1234"
                    },
                    {
                        "use": "official",
                        "type":
                        {
                            "coding":
                            [
                                {
                                    "system": "http://hl7.org/fhir/sid/us-ssn",
                                    "code": "SSN"
                                }
                            ],
                            "text": "SSN"
                        },
                        "system": "http://hl7.org/fhir/sid/us-ssn",
                        "value": "991113333"
                    }
                ],
                "name":
                [
                    {
                        "use": "official",
                        "family": "DEO",
                        "given":
                        [
                            "TEST"
                        ]
                    }
                ],
                "telecom":
                [
                    {
                        "system": "phone",
                        "value": "816-555-0123",
                        "use": "home"
                    }
                ],
                "gender": "male",
                "birthDate": "1987-01-23",
                "address":
                [
                    {
                        "use": "home",
                        "text": "1234, MAIN ST, ST 12345",
                        "line":
                        [
                            "1234, MAIN ST"
                        ],
                        "city": "ANYWHERE",
                        "state": "ST",
                        "postalCode": "12345"
                    }
                ]
            }
        }
    ]
}

See the below examples of a document query request and response for retrieving clinical documents for a specific patient encounter.

Request:

curl "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/fhir/r4/1234567-1234-1234-1234-123456789101/DocumentReference?patient=0123456789&encounter=12345678123456781234567812345678_2.99.888.7.66666.5.444.33.2.1%7C12345"" -H 'Authorization: Bearer <token>'

Response:

{
    "resourceType": "Bundle",
    "total": 3,
    "entry":
    [
        {
            "fullUrl": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/1234567-1234-1234-1234-123456789101/DocumentReference/urn:uuid:76d91416-fbca-3274-94b3-9d4291e268b8",
            "resource":
            {
                "resourceType": "DocumentReference",
                "id": "urn:uuid:76d91416-fbca-3274-94b3-9d4291e268b8",
                "meta":
                {
                    "versionId": "1",
                    "lastUpdated": "2024-05-13T20:55:09.000Z"
                },
                "masterIdentifier":
                {
                    "system": "urn:ietf:rfc:3986",
                    "value": "2.25.290832971677299890675432599767631684550.200728962"
                },
                "identifier":
                [
                    {
                        "use": "official",
                        "system": "urn:ietf:rfc:3986",
                        "value": "urn:uuid:76d91416-fbca-3274-94b3-9d4291e268b8"
                    },
                    {
                        "system": "https://fhir.cerner.com/ceuuid",
                        "value": "CE87caf4b7-9397-4667-9897-702218017c9e-200728962-2024051320551000"
                    }
                ],
                "status": "current",
                "docStatus": "final",
                "type":
                {
                    "coding":
                    [
                        {
                            "system": "https://fhir.cerner.com/dacc6494-e336-45ad-8729-b789ff8663c6/codeSet/72",
                            "code": "166336503",
                            "display": "Wound Clinic Office Note"
                        },
                        {
                            "system": "http://loinc.org",
                            "code": "96352-0",
                            "display": "Wound care management Outpatient Note"
                        }
                    ]
                },
                "category":
                [
                    {
                        "coding":
                        [
                            {
                                "system": "http://loinc.org",
                                "code": "96352-0",
                                "display": "Wound care management Outpatient Note"
                            }
                        ]
                    },
                    {
                        "coding":
                        [
                            {
                                "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category",
                                "code": "clinical-note",
                                "display": "Clinical Note"
                            }
                        ]
                    }
                ],
                "subject":
                {
                    "reference": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/1234567-1234-1234-1234-123456789101/Patient/0123456789",
                    "display": "TEST PATIENT"
                },
                "date": "2024-05-12T19:00:00.000Z",
                "author":
                [
                    {
                        "type": "Practitioner",
                        "identifier":
                        {
                            "use": "official",
                            "type":
                            {
                                "coding":
                                [
                                    {
                                        "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                        "code": "NPI",
                                        "display": "National provider identifier"
                                    }
                                ]
                            },
                            "system": "urn:ietf:rfc:3986",
                            "value": "SYSTEMSYSTEM"
                        },
                        "display": "SYSTEM SYSTEM"
                    }
                ],
                "authenticator":
                {
                    "type": "Practitioner",
                    "identifier":
                    {
                        "use": "official",
                        "type":
                        {
                            "coding":
                            [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                    "code": "NPI",
                                    "display": "National provider identifier"
                                }
                            ]
                        },
                        "value": "SYSTEMSYSTEM"
                    },
                    "display": "SYSTEM SYSTEM"
                },
                "description": "Wound Care",
                "securityLabel":
                [
                    {
                        "coding":
                        [
                            {
                                "system": "2.16.840.1.113883.5.25",
                                "code": "N",
                                "display": "Normal"
                            }
                        ]
                    }
                ],
                "content":
                [
                    {
                        "attachment":
                        {
                            "contentType": "text/xml",
                            "language": "en",
                            "url": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/1234567-1234-1234-1234-123456789101/Binary/urn:uuid:76d91416-fbca-3274-94b3-9d4291e268b8",
                            "creation": "2024-05-12"
                        },
                        "format":
                        {
                            "system": "1.3.6.1.4.1.19376.1.2.3",
                            "code": "urn:hl7-org:sdwg:ccda-nonXMLBody:2.1",
                            "display": "HTML Document"
                        }
                    }
                ],
                "context":
                {
                    "encounter":
                    [
                        {
                            "extension":
                            [
                                {
                                    "url": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/StructureDefinition/custom-attribute/encounter-start-datetime",
                                    "valueDateTime": "2024-05-10T05:00:00Z"
                                }
                            ],
                            "identifier":
                            {
                                "system": "12345678123456781234567812345678_1.99.888.7.66666.5.444.33.2.1",
                                "value": "12345"
                            }
                        }
                    ],
                    "period":
                    {
                        "end": "2024-05-12"
                    },
                    "sourcePatientInfo":
                    {
                        "identifier":
                        {
                            "system": "1.99.888.7.66666.5.444.33.2.1",
                            "value": "0123456789"
                        },
                        "display": "PATIENT TEST"
                    }
                }
            }
        },
        {
            "fullUrl": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/1234567-1234-1234-1234-123456789101/DocumentReference/urn:uuid:26ad7f5a-546e-3e86-bb69-bdbe4e6e69a2",
            "resource":
            {
                "resourceType": "DocumentReference",
                "id": "urn:uuid:26ad7f5a-546e-3e86-bb69-bdbe4e6e69a2",
                "meta":
                {
                    "versionId": "1",
                    "lastUpdated": "2024-05-13T20:50:16.000Z"
                },
                "masterIdentifier":
                {
                    "system": "urn:ietf:rfc:3986",
                    "value": "2.25.290832971677299890675432599767631684550.200728960"
                },
                "identifier":
                [
                    {
                        "use": "official",
                        "system": "urn:ietf:rfc:3986",
                        "value": "urn:uuid:26ad7f5a-546e-3e86-bb69-bdbe4e6e69a2"
                    },
                    {
                        "system": "https://fhir.cerner.com/ceuuid",
                        "value": "CE87caf4b7-9397-4667-9897-702218017c9e-200728960-2024051320501800"
                    }
                ],
                "status": "current",
                "docStatus": "final",
                "type":
                {
                    "coding":
                    [
                        {
                            "system": "https://fhir.cerner.com/dacc6494-e336-45ad-8729-b789ff8663c6/codeSet/72",
                            "code": "2820547",
                            "display": "Procedure Note"
                        },
                        {
                            "system": "http://loinc.org",
                            "code": "28570-0",
                            "display": "Procedure note"
                        }
                    ]
                },
                "category":
                [
                    {
                        "coding":
                        [
                            {
                                "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category",
                                "code": "clinical-note",
                                "display": "Clinical Note"
                            }
                        ]
                    },
                    {
                        "coding":
                        [
                            {
                                "system": "http://loinc.org",
                                "code": "28570-0",
                                "display": "Procedure note"
                            }
                        ]
                    }
                ],
                "subject":
                {
                    "reference": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/fhir/r4/1234567-1234-1234-1234-123456789101/Patient/0123456789",
                    "display": "PATIENT TEST"
                },
                "date": "2024-05-12T19:00:00.000Z",
                "author":
                [
                    {
                        "type": "Practitioner",
                        "identifier":
                        {
                            "use": "official",
                            "type":
                            {
                                "coding":
                                [
                                    {
                                        "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                        "code": "NPI",
                                        "display": "National provider identifier"
                                    }
                                ]
                            },
                            "system": "urn:ietf:rfc:3986",
                            "value": "SYSTEMSYSTEM"
                        },
                        "display": "SYSTEM SYSTEM"
                    }
                ],
                "authenticator":
                {
                    "type": "Practitioner",
                    "identifier":
                    {
                        "use": "official",
                        "type":
                        {
                            "coding":
                            [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                    "code": "NPI",
                                    "display": "National provider identifier"
                                }
                            ]
                        },
                        "value": "SYSTEMSYSTEM"
                    },
                    "display": "SYSTEM SYSTEM"
                },
                "description": "Biopsy Procedure",
                "securityLabel":
                [
                    {
                        "coding":
                        [
                            {
                                "system": "2.16.840.1.113883.5.25",
                                "code": "N",
                                "display": "Normal"
                            }
                        ]
                    }
                ],
                "content":
                [
                    {
                        "attachment":
                        {
                            "contentType": "text/xml",
                            "language": "en",
                            "url": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/1234567-1234-1234-1234-123456789101/Binary/urn:uuid:26ad7f5a-546e-3e86-bb69-bdbe4e6e69a2",
                            "creation": "2024-05-12"
                        },
                        "format":
                        {
                            "system": "1.3.6.1.4.1.19376.1.2.3",
                            "code": "urn:hl7-org:sdwg:ccda-nonXMLBody:2.1",
                            "display": "HTML Document"
                        }
                    }
                ],
                "context":
                {
                    "encounter":
                    [
                        {
                            "extension":
                            [
                                {
                                    "url": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/StructureDefinition/custom-attribute/encounter-start-datetime",
                                    "valueDateTime": "2024-05-10T05:00:00Z"
                                }
                            ],
                            "identifier":
                            {
                                "system": "12345678123456781234567812345678_2.99.888.7.66666.5.444.33.2.1",
                                "value": "12345"
                            }
                        }
                    ],
                    "period":
                    {
                        "end": "2024-05-12"
                    },
                    "sourcePatientInfo":
                    {
                        "identifier":
                        {
                            "system": "1.99.888.7.66666.5.444.33.2.1",
                            "value": "0123456789"
                        },
                        "display": "PATIENT TEST"
                    }
                }
            }
        },
        {
            "fullUrl": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/1234567-1234-1234-1234-123456789101/DocumentReference/urn:uuid:7bc1700d-b565-4dc5-8c05-038909d57edb",
            "resource":
            {
                "resourceType": "DocumentReference",
                "id": "urn:uuid:7bc1700d-b565-4dc5-8c05-038909d57edb",
                "masterIdentifier":
                {
                    "system": "urn:ietf:rfc:3986",
                    "value": "1.3.6.1.4.1.21367.2010.5988262"
                },
                "identifier":
                [
                    {
                        "use": "official",
                        "system": "urn:ietf:rfc:3986",
                        "value": "urn:uuid:7bc1700d-b565-4dc5-8c05-038909d57edb"
                    }
                ],
                "status": "current",
                "docStatus": "final",
                "type":
                {
                    "coding":
                    [
                        {
                            "system": "http://loinc.org",
                            "code": "34133-9",
                            "display": "Summary of Episode Note"
                        }
                    ]
                },
                "category":
                [
                    {
                        "coding":
                        [
                            {
                                "system": "http://loinc.org",
                                "code": "34133-9",
                                "display": "Summary of Episode Note"
                            }
                        ]
                    }
                ],
                "subject":
                {
                    "reference": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/1234567-1234-1234-1234-123456789101/Patient/0123456789",
                    "display": "PATIENTTWO TEST"
                },
                "date": "2024-10-24T11:56:43.099Z",
                "author":
                [
                    {
                        "type": "Practitioner",
                        "identifier":
                        {
                            "use": "official",
                            "type":
                            {
                                "coding":
                                [
                                    {
                                        "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                        "code": "NPI",
                                        "display": "National provider identifier"
                                    }
                                ]
                            },
                            "system": "urn:ietf:rfc:3986",
                            "value": "Cerner HIE"
                        },
                        "display": "Cerner HIE"
                    }
                ],
                "authenticator":
                {
                    "type": "Practitioner",
                    "identifier":
                    {
                        "use": "official",
                        "type":
                        {
                            "coding":
                            [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                    "code": "NPI",
                                    "display": "National provider identifier"
                                }
                            ]
                        },
                        "value": "Cerner HIE"
                    },
                    "display": "Cerner HIE"
                },
                "custodian":
                {
                    "type": "Organization",
                    "identifier":
                    {
                        "use": "official",
                        "type":
                        {
                            "coding":
                            [
                                {
                                    "system": "urn:ietf:rfc:3986",
                                    "code": "urn:oid",
                                    "display": "OID"
                                }
                            ]
                        },
                        "value": ""
                    },
                    "display": "Model Clinic 1"
                },
                "description": "CCD for Encounter: 12345-1.99.888.7.66666.5.444.33.2.1",
                "securityLabel":
                [
                    {
                        "coding":
                        [
                            {
                                "system": "2.16.840.1.113883.5.25",
                                "code": "N",
                                "display": "Normal"
                            }
                        ]
                    }
                ],
                "content":
                [
                    {
                        "attachment":
                        {
                            "contentType": "text/xml",
                            "language": "en-us",
                            "url": "https://cell1.query.cdexhub.us-chicago-1.oci.oraclecloud.com/r4/1234567-1234-1234-1234-123456789101/Binary/urn:uuid:7bc1700d-b565-4dc5-8c05-038909d57edb",
                            "size": 120879,
                            "hash": "466cdc04d0c6cd12bb6aa18ae3f08c895ef1eb1d",
                            "creation": "2024-10-24"
                        },
                        "format":
                        {
                            "system": "1.3.6.1.4.1.19376.1.2.3",
                            "code": "urn:ihe:pcc:xphr:2007",
                            "display": "HL7 CCD Document"
                        }
                    }