CDA2FHIR Converter - RESTful API

Convert CDA XML documents to FHIR JSON Bundle format programmatically.

API Request

You can use this API endpoint to convert CDA documents to FHIR format programmatically. Here is an example using curl:

curl -X POST http://hdu.cdcmeta.com/cda2fhir/api/ \
  -F "cda_file=@path_to_your_cda_file.xml"

API Response

The API response contains JSON. It contains a FHIR JSON Bundle or an error message in case of failure.

Example of a successful response

{
  "resourceType": "Bundle",
  "type": "batch",
  "entry": [
    {
      "fullUrl": "urn:uuid:e8b66b6b-b5ee-1fa4-15de-840ff3ce5da8",
      "resource": {
        "resourceType": "Composition",
        "id": "e8b66b6b-b5ee-1fa4-15de-840ff3ce5da8",
        "identifier": {
          "use": "official",
          "value": "2.16.840.1.113883.9.9.9.9.9"
        },
        "status": "final",
        "type": {
          "coding": [
            {
              "code": "55751-2",
              "display": "Public Health Case Report",
              "system": "http://loinc.org"
            }
          ]
        },
        "date": "2020-11-07T09:44:21-05:00",
        "title": "Initial Public Health Case Report",
        "confidentiality": "N",
        "attester": [
          {
            "party": {
              "reference": "Practitioner/"
            }
          }
        ],
        "section": [
          {
            "title": "Plan of Treatment",
            "text": {
              "status": "generated",
              "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Plan of Treatment</div>"
            },
            "code": {
              "coding": [
                {
                  "code": "18776-5",
                  "display": "Plan of Treatment",
                  "system": "http://loinc.org"
                }
              ]
            },
            "mode": "snapshot"
          },
          {
            "title": "Encounters",
            ...
          }
        ]
      }
    }
  ]
}

Example of an error response

{
  "error": "Failed to render FHIR",
  "message": "RenderingError",
  "cause": "filter 'format_as_date_time': unexpected error: Malformed HL7 datetime 2020111501000, on line 48"
}

← Back to CDA2FHIR Converter