Convert - CDA to FHIR (R4)

This operation converts a CDA document into a FHIR R4 bundle.

Guides

See the Programming Guide for general principles that apply to all Convert API operations.

Endpoint

POST /convert/v1/cdatofhirr4

Input

The input is a single CDA document for a single patient, in XML format.

Supported Formats

Supported CDA formats/versions are:

  • C-CDA R1.1/R2.1
  • HITSP C32 CDAs

Query Parameters

patientId string

Optional resource ID for the Patient. See programming guide for details.

patientIdentifier string

Optional business identifier for the Patient resource. If specified, patientIdentifierSystem must also be present. See programming guide for details.

patientIdentifierSystem string

System that provided the patientIdentifier. If specified, patientIdentifier must also be present. See programming guide for details.

includeOriginalCda boolean

Whether to include the original CDA document in the FHIR bundle. Default is false.

includeStandardizedCda boolean

Whether to include the standardized CDA document in the FHIR bundle. Default is false.

Request Headers

Header Value
x-api-key YOUR_API_KEY, obtained from the Developer Portal
content-type application/xml
accept application/fhir+json or application/xml

Output

The output is a FHIR R4 Bundle containing the data parsed from the input, along with an OperationOutcome resource detailing the results (including warnings or errors) of the conversion process. See Output FHIR R4 Bundles for details.

Details

The following sections provide additional details about the message handling.

Standardization and Uplift

The Convert API standardizes and enhances the output into a consistent format suitable for downstream processing. See Understanding Uplift for details.

Include Original CDA

Using the includeOriginalCda or includeStandardizedCda query parameters, you can specify whether the original CDA and/or a standardized version of the original CDA are included in the output bundle. For each CDA included, there will be:

  • A Binary resource with the document content.
  • A DocumentationReference with its metadata. The Type.Code field will identify whether it is a Cda (the original) or StandardizedCda.

Example

Try It
Try out the operations, with examples, in the Developer Portal Sandbox.

CDA documents and FHIR Bundles are verbose, so this just shows a small sample to illustrate how the data is structured. For a more complete example, try out the API in the Developer Portal Sandbox.

For example, a patient node in the CDA XML:

Sample Input
  <patient classCode="PSN" determinerCode="INSTANCE">
      <name>
          <given>John</given>
          <family>Smith</family>
      </name>
      ... 
  </patient>

would be converted to a Patient resource in the FHIR bundle:

Sample Output
  "resource": {
    "resourceType": "Patient",
    "id": "35b77437-425d-419c-90b5-af4bc433ebe9",
    "name": [
        {
            "use": "official",
            "family": "Smith",
            "given": [
                "John"
            ]
        }
    ],
    ...
  }

For details on the output fields, refer to the FHIR Specification.