C-CDA / FHIR Converter
This page describes C-CDA built-in module which provides API to convert C-CDA documents to FHIR documents and backward.
C-CDA (Consolidated Clinical Document Architecture) is a standard that has been widely adopted in the healthcare industry for exchanging clinical documents. Based on the HL7 Clinical Document Architecture (CDA) standard, it provides a structured approach to capturing and sharing patient information in a consistent manner. However, with the healthcare industry moving towards the more modern FHIR standard, there is now a growing need to convert data between C-CDA and FHIR. Furthermore, the § 170.315(g)(9) ONC criterion mandates that EHR systems must import and export patient data in C-CDA format.
To meet these data exchange requirements, Aidbox offers a module that performs C-CDA to FHIR and FHIR to C-CDA conversions. This module applies a set of rules consistently in both directions, ensuring a robust and reliable conversion process. In addition to data conversion, the module also provides endpoints for validating C-CDA documents and for persisting FHIR data extracted from C-CDA documents.
Below is the list of supported C-CDA sections, their corresponding OIDs and aliases. Section aliases are used to configure C-CDA endpoints to specify a list of sections to process.
Value | Section OID(s) | FHIR resource |
---|---|---|
goals | 2.16.840.1.113883.10.20.22.2.60 | Goal |
problems | 2.16.840.1.113883.10.20.22.2.5.1 | Condition |
medications | 2.16.840.1.113883.10.20.22.2.1.1 | MedicationStatement |
immunizations | 2.16.840.1.113883.10.20.22.2.2 2.16.840.1.113883.10.20.22.2.2.1 2.16.840.1.113883.10.20.22.4.52 | Immunization |
payers | 2.16.840.1.113883.10.20.22.2.18 | Coverage |
vital-signs | 2.16.840.1.113883.10.20.22.2.4.1 | Observation |
social-history | 2.16.840.1.113883.10.20.22.2.17 | Observation |
procedures | 2.16.840.1.113883.10.20.22.2.7.1 | Procedure |
encounters | 2.16.840.1.113883.10.20.22.2.22.1 | Encounter |
plan-of-treatment | 2.16.840.1.113883.10.20.22.2.10 | Procedure, Observation, Encounter, Goal |
allergies | 2.16.840.1.113883.10.20.22.2.6.1 | AllergyIntolerance |
results | 2.16.840.1.113883.10.20.22.2.3.1 | Observation |
To perform C-CDA to FHIR conversion without storing FHIR resources in the Aidbox database, use the
/ccda/v2/to-fhir
endpoint. Simply POST
C-CDA XML document in request body as in the following example:POST /ccda/v2/to-fhir
Authorization: .....
Content-Type: application/cda+xml
<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:hl7-org:v3" ...>
....
</ClinicalDocument>
Please note the
Content-Type: application/cda+xml
header. Any other MIME type will be rejected by this endpoint.If conversion was successful, you'll get a FHIR Document as a result. Accordingly to the FHIR Documents specification, the first resource in the resulting bundle is Composition resource containing document header information as well as the list of document sections.
// POST /ccda/to-fhir
// HTTP/1.1 200 OK
{
"resourceType" : "Bundle",
"type" : "document",
"entry" : [ {
"resource" : {
"resourceType": "Composition",
"date" : "2015-06-22",
"section" : [ {
"code" : {
"coding" : [ {
"code" : "48765-2",
"display" : "48765-2",
"system" : "http://loinc.org"
} ]
},
"title" : "ALLERGIES AND ADVERSE REACTIONS",
"author" : [ {
"uri" : "urn:uuid:f7a93b9c-f490-dee8-a1ce-e3bf5f0360cc"
} ],
"entry" : [ {
"uri" : "urn:uuid:468e2476-2095-240f-84b6-8f05b0d97637"
}, {
"uri" : "urn:uuid:5082dbe5-1c5a-326a-a72b-a0d73216a679"
} ],
"text" : {
"div" : "<table width='100%' border='1'>\n<thead>\n<tr>\n<th>\nSubstance\n</th>\n<th>\nReaction\n</th>\n<th>\nSeverity\n</th>\n<th>\nStatus\n</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\n<content ID='product1'>\nPenicillin G\n</content>\n</td>\n<td>\n<content ID='reaction1'>\nHives\n</content>\n</td>\n<td>\n<content ID='severity1'>\nModerate\n</content>\n</td>\n<td>\nActive\n</td>\n</tr>\n<tr>\n<td>\n<content ID='product2'>\nAmpicillin\n</content>\n</td>\n<td>\n<content ID='reaction2'>\nHives\n</content>\n</td>\n<td>\n<content ID='severity2'>\nModerate\n</content>\n</td>\n<td>\nActive\n</td>\n</tr>\n</tbody>\n</table>",
"status" : "generated"
}
}, {
"code" : {
"coding" : [ {
"code" : "10160-0",
"display" : "HISTORY OF MEDICATION USE",
"system" : "http://loinc.org"
} ]
},
"title" : "MEDICATIONS",
"entry" : [ {
"uri" : "urn:uuid:4ddb05da-b1e6-685a-5c08-f28210d31d5d"
}, {
"uri" : "urn:uuid:6f87fc48-b173-97c0-a5fd-1b7e483d5c67"
}, {
"uri" : "urn:uuid:b8b29b52-ecb1-7e69-bee9-52af94d0c174"
} ]
....
In case of error, OperationOutcome resource will be returned:
// POST /ccda/v2/to-fhir
// HTTP/1.1 422 Unprocessable Entity