#Overview
C-CDA (Consolidated Clinical Document Architecture) is an XML-based standard for clinical document exchange. When accessed through nationwide health information exchange networks like TEFCA, C-CDA documents provide comprehensive clinical information that is not available in traditional claims data.
Always retrieve and store C-CDA documents. If you want maximal data extraction, you should always retrieve the original C-CDA DocumentReference regardless of what final analysis format you use. C-CDA documents contain rich clinical context that may not fully survive conversion to other formats, and you risk record loss if you don't preserve the source document.
C-CDA documents typically include structured sections for:
- Problems/Diagnoses - Active and historical conditions with onset dates and status
- Medications - Current and historical medications with dosing, frequency, and duration
- Allergies and Intolerances - Documented allergies with severity and reactions
- Procedures - Surgical and diagnostic procedures with dates and providers
- Vital Signs - Blood pressure, heart rate, temperature, weight, height
- Laboratory Results - Test results with reference ranges and interpretations
- Immunizations - Vaccination history with dates and vaccine information
- Social History - Smoking status, alcohol use, and other social determinants
- Clinical Notes - Unstructured provider documentation and assessments
#Document Types
TEFCA and other health information exchange networks permit exchange of multiple C-CDA document types. The most common is the Continuity of Care Document (CCD), but you may encounter others:
| Document Type | LOINC Code | Description |
|---|
| Continuity of Care Document (CCD) | 34133-9 | Snapshot of patient's current health status including problems, medications, allergies, and recent care |
| Discharge Summary | 18842-5 | Summary of a hospital stay including diagnoses, procedures, and discharge instructions |
| Progress Note | 11506-3 | Documentation of a clinical encounter or visit |
| Consultation Note | 11488-4 | Documentation from a specialist consultation |
| History and Physical | 34117-2 | Comprehensive patient history and physical examination |
| Referral Note | 57133-1 | Documentation supporting a referral to another provider |
| Care Plan | 18776-5 | Planned care activities and goals |
The Continuity of Care Document (CCD) is the most common document type and represents a core data set of the most relevant clinical information about a patient. It provides a historical tally of care over a range of time and is designed to support continuity of care when patients move between providers or care settings.
#C-CDA Versions
C-CDA documents may be produced in different versions depending on the source system:
- C-CDA R2.1 (2015) - Most widely deployed version, aligned with Meaningful Use Stage 2
- C-CDA R3.0 (2022) - Updated version with improved templates and US Core alignment
- C-CDA R4.0/R5.0 (2024-2025) - Latest versions with USCDI alignment
The version can typically be identified by the templateId elements in the document header. Different facilities and EHR systems may produce documents in different versions, so your processing logic should handle version variations gracefully.
#Reading Content
The actual document content is provided in the content[].attachment element. Documents can be delivered in two ways:
- Inline Data - Base64-encoded content in the
data element
- URL Reference - A URL in the
url element where the document can be fetched
For C-CDA documents, the contentType is typically text/xml or application/xml, and the format element indicates the C-CDA version and profile.
When both data and url are provided, the reference should point to the same content as found in the data. Servers are required to support at least one of these elements, and client applications should support both.
#Decoding and Parsing
When document data is base64-encoded:
// Decode base64 document data
const documentData = atob(resource.content[0].attachment.data);
// For C-CDA XML documents, parse with XML parser
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(documentData, "text/xml");
// Extract structured data from C-CDA sections
const medications = xmlDoc.getElementsByTagName("medication");
const problems = xmlDoc.getElementsByTagName("problem");