Written and maintained by CASRAI Editorial Board
Last updated
C-CDA to FHIR conversion is the health informatics process of parsing clinical documents encoded in the HL7 Consolidated Clinical Document Architecture Release 2.1 (C-CDA R2.1 XML) and transforming their header metadata, human-readable narrative blocks, and machine-readable clinical entries into discrete HL7 Fast Healthcare Interoperability Resources (FHIR Release 4) JSON or XML resources conforming to the US Core FHIR Implementation Guide. Because national health information exchange frameworks—such as Carequality, CommonWell Health Alliance, Direct Secure Messaging, and the Trusted Exchange Framework and Common Agreement (TEFCA)—still exchange hundreds of millions of C-CDA Continuity of Care Documents (CCDs) and Discharge Summaries annually, automated C-CDA-to-FHIR translation pipelines are foundational to modern EHR integration, clinical data aggregators, and real-world data (RWD) research repositories.
What Is the Difference Between C-CDA and FHIR? (HL7 CDA vs. FHIR Compared)
Although both standards are published by Health Level Seven International (HL7) and map to the same federal USCDI clinical vocabulary standards (SNOMED CT, LOINC, RxNorm, ICD-10-CM, and CVX), HL7 CDA / C-CDA and HL7 FHIR are built on fundamentally different data paradigms:
| Architectural Dimension | HL7 C-CDA (Consolidated CDA R2.1) | HL7 FHIR (Release 4 / US Core) |
|---|---|---|
| Core Data Paradigm | Document-Centric Snapshot: A point-in-time, legally attested clinical summary (e.g., CCD, Discharge Summary, Referral Note) packaged as a single indivisible file | Resource-Centric Graph: Modular, independently addressable clinical objects (Patient, Condition, Observation) linked by RESTful URI references |
| Underlying Information Model | Derived from the abstract HL7 v3 Reference Information Model (RIM) (Act, Entity, Role, Participation, classCode, moodCode) |
Pragmatic 80/20 domain object model designed directly around clinical and administrative developer workflows; uses extensions for local data |
| Wire Serialization | Deeply nested XML validated against W3C XML Schema (XSD) and Schematron rules triggered by ISO Object Identifiers (templateId OIDs) |
Lightweight JSON (most common), XML, or RDF Turtle validated against FHIR StructureDefinition profiles and FHIRPath invariants |
| Transport & Query Granularity | Exchanged as whole documents via IHE XDS.b/XCA SOAP web services or Direct S/MIME; retrieving one lab result requires downloading the entire XML document | Queried granularly over HTTPS RESTful APIs (e.g., GET /Observation?patient=123&code=4548-4) or exported asynchronously via Bulk FHIR NDJSON |
| Human Readability Contract | Mandatory CDA Narrative Block (<text>): A CDA document is legally defined by its human-readable XHTML-like narrative table; coded <entry> elements are secondary |
Optional DomainResource.text XHTML narrative summary; primary interoperability relies on structured JSON attributes and MustSupport elements |
How Do You Map C-CDA Sections (Problems, Medications, Allergies) to FHIR Resources?
In a C-CDA R2.1 document, the <ClinicalDocument> header contains patient demographics, authors, custodians, and encounter metadata, while the <structuredBody> contains clinical <section> blocks identified by both a LOINC section code and a C-CDA Section Template OID. Inside each section, machine-readable clinical data are nested in RIM <entry> wrappers (typically a Concern Act wrapping an Observation or SubstanceAdministration).
The table below details the canonical HL7 C-CDA-to-FHIR R4 mapping across the core clinical sections:
| C-CDA Section Name | Section LOINC Code | C-CDA R2.1 Section & Entry Template OIDs | Target US Core FHIR R4 Resource | Key Element & Status Mapping Rules |
|---|---|---|---|---|
Document Header (recordTarget, author, encompassingEncounter) |
Document code (e.g., 34133-9 CCD) |
US Realm Header: 2.16.840.1.113883.10.20.22.1.1 |
Composition, Patient, Practitioner, Organization, Encounter |
recordTarget/patientRole maps to Patient; encompassingEncounter maps to Encounter; header metadata binds into Composition |
| Problems Section | 11450-4 (Problem list – Reported) |
Section: ...22.2.5.1Problem Concern Act: ...22.4.3Problem Observation: ...22.4.4 |
Condition (US Core Condition Problems and Health Concerns) |
Problem Observation value (SNOMED CT / ICD-10-CM) → Condition.code; Observation status + Concern Act statusCode → Condition.clinicalStatus; effectiveTime/low → onsetDateTime |
| Medications Section | 10160-0 (History of Medication use) |
Section: ...22.2.1.1Medication Activity: ...22.4.16 |
MedicationRequest (or MedicationStatement) |
consumable/manufacturedProduct (RxNorm) → medicationCodeableConcept; moodCode="INT" (intent) vs. "EVN" (event) determines intent and status; doseQuantity & routeCode → dosageInstruction |
| Allergies and Intolerances Section | 48765-2 (Allergies, adverse reactions) |
Section: ...22.2.6.1Allergy Concern Act: ...22.4.30Allergy Intolerance Obs: ...22.4.7 |
AllergyIntolerance |
participant/participantRole/playingEntity (RxNorm/UNII/SNOMED) → AllergyIntolerance.code; Reaction Observation (...22.4.9) → reaction.manifestation; Severity (...22.4.8) → reaction.severity |
| Results Section (Laboratory & Diagnostic) | 30954-2 (Relevant diagnostic tests/lab data) |
Section: ...22.2.3.1Result Organizer: ...22.4.1Result Observation: ...22.4.2 |
DiagnosticReport + Observation (Laboratory Result) |
Result Organizer maps to DiagnosticReport (with result[] references); each nested Result Observation maps to an Observation with LOINC code, UCUM valueQuantity, and referenceRange |
| Vital Signs Section | 8716-3 (Vital signs) |
Section: ...22.2.4.1Vital Signs Organizer: ...22.4.26Vital Sign Observation: ...22.4.27 |
Observation (US Core Vital Signs Profiles) |
Systolic and diastolic blood pressure observations inside the same organizer are combined into a single FHIR Observation (85354-9) with two component slices |
| Procedures Section | 47519-4 (History of Procedures) |
Section: ...22.2.7.1Procedure Activity Procedure: ...22.4.14 |
Procedure |
code (CPT / SNOMED CT / ICD-10-PCS) → Procedure.code; statusCode → Procedure.status; effectiveTime → performedDateTime or performedPeriod |
| Immunizations Section | 11369-6 (History of Immunization) |
Section: ...22.2.2.1Immunization Activity: ...22.4.52 |
Immunization |
consumable CVX code → Immunization.vaccineCode; negationInd="true" maps to status = "not-done" with statusReason |
Note: All abbreviated template OIDs above begin with the HL7 C-CDA root prefix 2.16.840.1.113883.10.20.22.*.
What Is the HL7 C-CDA on FHIR Implementation Guide?
While many integration engines extract standalone FHIR resources from a C-CDA file, discarding the document container loses the legal attestation, section layout, and narrative context of the original clinical document. To preserve full document fidelity in FHIR, the HL7 Structured Documents Work Group published the HL7 C-CDA on FHIR Implementation Guide (canonical URL http://hl7.org/fhir/us/ccda).
Under C-CDA on FHIR, a clinical document is represented as a FHIR Bundle with Bundle.type = "document":
Bundle.entry[0]MUST be aCompositionResource: TheCompositionresource acts as the direct FHIR equivalent of the C-CDA XML header and<structuredBody>. It carries the LOINC document type code (e.g.,34133-9for a Continuity of Care Document),subject(Patientreference),encounter,author, andattester.Composition.section[]Array: Each C-CDA section (Problems, Medications, Allergies, Results) becomes aComposition.sectionelement containing the section’s LOINCcode, the human-readable XHTML narrative table insection.text, and an array ofsection.entry[]references pointing to the discrete US Core FHIR resources packaged in the remainder of theBundle.- Cross-Paradigm Mapping Specification: In 2023–2024, HL7 expanded this work via the C-CDA to and from US Core Mapping Implementation Guide, providing formal FHIR StructureMap / ConceptMap rules to ensure consistent bidirectional transformation between C-CDA R2.1 templates and US Core STU 6.1.0 profiles.
Four Critical Technical Pitfalls in C-CDA to FHIR Conversion
Engineering a production C-CDA-to-FHIR converter (using tools such as the open-source LinuxForHealth / Microsoft FHIR Converter, Smile CDR, or Rhapsody/Mirth pipelines) requires handling four structural edge cases:
- Reconciling Outer Concern Act Status vs. Inner Observation Status: In C-CDA, a Problem Concern Act (
...22.4.3) tracks whether a clinician is actively monitoring a concern (activevs.completed), while the nested Problem Observation (...22.4.4) tracks the clinical state of the disease itself. Mapping the outer Concern Act’sstatusCodedirectly toCondition.clinicalStatuswithout inspecting the inner Problem Observation status observation (2.16.840.1.113883.10.20.22.4.6) frequently misclassifies resolved conditions as active. - Handling RIM Negation (
negationInd="true") and NullFlavors: In HL7 v3/C-CDA, stating “No Known Allergies” is encoded by settingnegationInd="true"on an Allergy Intolerance Observation with a generic ” propensity to adverse reactions” code. A naive converter that ignores thenegationIndXML attribute will invert the clinical meaning and record an active allergy! Compliant converters inspectnegationInd="true"and map it to the specific SNOMED CT negated concept (e.g.,716186003No known allergy) orverificationStatus = "refuted". - Unlinked Narrative Text (
<originalText>References): C-CDA entries often omit inline display strings on coded elements and instead use an XPointer reference (<originalText><reference value="#prob-1"/></originalText>) pointing to a<content ID="prob-1">span inside the section’s XHTML narrative block. A parser must dereference these internal XML IDs to populateCodeableConcept.textin FHIR. - Multi-Document Deduplication and Provenance: When a patient’s record is queried across Carequality or TEFCA, an EHR may receive 15 overlapping C-CDA documents from different hospitals, each repeating the same chronic diagnoses and medications with different local XML
<id>values. Post-conversion pipelines must attach a FHIRProvenanceresource linking each extracted resource back to its source C-CDADocumentReferenceand perform terminology-aware deduplication (matching RxNorm SCD/SBD codes and SNOMED CT hierarchies).
Frequently Asked Questions
What is the difference between C-CDA and FHIR?
C-CDA (Consolidated Clinical Document Architecture) is a document-centric HL7 v3 XML standard that packages a patient’s clinical summary into a single static document snapshot containing mandatory human-readable narrative tables and RIM-based coded entries. FHIR (Fast Healthcare Interoperability Resources) is a modular, API-centric standard that exposes individual clinical data elements (such as Patient, Condition, MedicationRequest, and Observation) as discrete JSON or XML resources over RESTful HTTPS endpoints.
How do you map C-CDA sections (Problems, Medications, Allergies) to FHIR resources?
A C-CDA-to-FHIR converter matches each C-CDA section by its LOINC code and template OID and transforms its nested entries into US Core FHIR R4 resources: the Problems section (LOINC 11450-4, OID 2.16.840.1.113883.10.20.22.2.5.1) maps to FHIR Condition; the Medications section (LOINC 10160-0, OID ...22.2.1.1) maps to MedicationRequest or MedicationStatement; and the Allergies section (LOINC 48765-2, OID ...22.2.6.1) maps to AllergyIntolerance.
What is the HL7 C-CDA on FHIR Implementation Guide?
The HL7 C-CDA on FHIR Implementation Guide (http://hl7.org/fhir/us/ccda) is the official HL7 specification that defines how to represent complete clinical documents (such as Continuity of Care Documents, Discharge Summaries, and Referral Notes) natively in FHIR using a Bundle of type document led by a profiled Composition resource that organizes US Core FHIR resources into standard LOINC-coded document sections.







