C-CDA R2.1 Documents

Transform C-CDA clinical documents to FHIR R4 bundles with US Core 6.1.0 profiles.

Overview

InteropSuite transforms C-CDA R2.1 documents into validated FHIR R4 bundles. The transformation engine supports 33 section mappers covering all clinical sections defined in C-CDA including Problems, Medications, Allergies, Results, Procedures, and more.

Comprehensive Section Support

All C-CDA R2.1 clinical sections are mapped to appropriate FHIR resources with US Core profiles. Entry relationships and cross-references are preserved.

See It In Action

View a real CCD document transformation with Composition, Problems, Medications, Allergies, and more.

Supported Document Types

InteropSuite recognizes and processes these C-CDA document types:

Document TypeLOINC CodeDescription
CCD34133-9Continuity of Care Document
Discharge Summary18842-5Hospital Discharge Summary
Progress Note11506-3Progress Note
Consultation Note11488-4Consultation Note
History & Physical34117-2History and Physical Note
Operative Note11504-8Operative Note
Procedure Note28570-0Procedure Note
Referral Note57133-1Referral Note
Transfer Summary18761-7Transfer Summary Note
Care Plan52521-2Overall Plan of Care
Unstructured55107-7Unstructured Document

Supported Sections (33 Mappers)

Core Clinical Sections

SectionLOINCFHIR Resources
Problems11450-4Condition (us-core-condition)
Allergies48765-2AllergyIntolerance (us-core-allergyintolerance)
Medications10160-0MedicationStatement, MedicationRequest
Results30954-2Observation (us-core-observation-lab), DiagnosticReport
Vital Signs8716-3Observation (us-core-vital-signs)
Procedures47519-4Procedure (us-core-procedure)
Immunizations11369-6Immunization (us-core-immunization)
Encounters46240-8Encounter (us-core-encounter)

Social & Family History

SectionLOINCFHIR Resources
Social History29762-2Observation (smokingstatus, alcohol, etc.)
Family History10157-6FamilyMemberHistory

Assessment & Plan

SectionLOINCFHIR Resources
Assessment51848-0ClinicalImpression
Plan of Treatment18776-5CarePlan, Goal
Goals61146-7Goal
Health Concerns75310-3Condition (health-concern)
Instructions69730-0Communication

Administrative Sections

SectionLOINCFHIR Resources
Payers48768-6Coverage (us-core-coverage)
Advance Directives42348-3Consent
Functional Status47420-5Observation (functional-status)
Mental Status10190-7Observation (cognitive-status)
Medical Equipment46264-8DeviceUseStatement, Device
Care Team85847-2CareTeam (us-core-careteam)

Additional Sections

SectionLOINCFHIR Resources
Reason for Visit29299-5Encounter.reasonCode
Chief Complaint10154-3Condition (chief-complaint)
History of Present Illness10164-2DocumentReference (narrative)
Review of Systems10187-3DocumentReference (narrative)
Physical Exam29545-1Observation, DocumentReference
Hospital Course8648-8DocumentReference (narrative)
Discharge Diagnosis11535-2Condition (discharge-diagnosis)
Discharge Medications10183-2MedicationRequest

Usage

Basic Transformation

// Activate license (once at startup)
Interop.ActivateLicense(licenseKey);

// Read C-CDA document
string cdaXml = File.ReadAllText("ccd.xml");

// Transform to FHIR
var result = await Interop.CDAToFhirAsync(cdaXml);

if (result.Success)
{
    string fhirJson = result.FhirBundle;
    string docType = result.DetectedFormat; // e.g., "CDA^34133-9"
}

Large File Processing with Progress

For large C-CDA documents (10MB+), use the optional progress reporter to monitor chunked processing:

// Create progress reporter
var progress = new Progress<TransformProgress>(p =>
{
    if (p.Phase == TransformPhase.ProcessingChunk)
    {
        Console.WriteLine($"Chunk {p.CurrentChunk}/{p.TotalChunks} - {p.PercentComplete:F1}%");
    }
});

// Transform with progress reporting
var result = await Interop.CDAToFhirAsync(largeCdaXml, progress);

Large CDA files are automatically processed in chunks to prevent memory exhaustion. Each chunk contains up to 3,000 clinical entries.

Batch Processing

Process multiple C-CDA files at once. For mixed workloads, use unified batch processing (recommended).

Unified Processing Recommended

using InteropSuite.Fhir.Engine.Batch;

// Process all formats with RoundRobin interleaving
var options = new BatchOptions
{
    Sources = new[]
    {
        new BatchSource("./input/hl7", "HL7", OutputFormat.UsCore),
        new BatchSource("./input/x12", "X12", OutputFormat.UsCore),
        new BatchSource("./input/cda", "CDA", OutputFormat.UsCore),
        new BatchSource("./input/cms", "CMS-0057-F", OutputFormat.Cms0057F),
    }
};

var result = await Interop.ProcessBatchAsync(options);

Sequential Processing

// Process C-CDA files only
var options = new BatchOptions
{
    Domain = "CDA",
    OutputFormat = OutputFormat.UsCore
};

var result = await Interop.ProcessBatchAsync("./input/cda", options);

Console.WriteLine($"Processed: {result.TotalFiles} files");
Console.WriteLine($"Succeeded: {result.Succeeded}");

See User Guide: Batch Processing for complete documentation.

FHIR Mapping

C-CDA elements map to FHIR resources with US Core profiles:

Header Mapping

C-CDA ElementFHIR Resource
recordTarget/patientRolePatient (us-core-patient)
authorPractitioner, PractitionerRole
custodianOrganization (us-core-organization)
documentationOf/serviceEventEncounter
componentOf/encompassingEncounterEncounter (us-core-encounter)
informationRecipientPractitioner
authenticator/legalAuthenticatorProvenance

Entry Mapping

C-CDA TemplateFHIR ResourceProfile
Problem ObservationConditionus-core-condition
Allergy Intolerance ObservationAllergyIntoleranceus-core-allergyintolerance
Medication ActivityMedicationStatement-
Result ObservationObservationus-core-observation-lab
Vital Sign ObservationObservationus-core-vital-signs
Procedure ActivityProcedureus-core-procedure
Immunization ActivityImmunizationus-core-immunization
Encounter ActivityEncounterus-core-encounter
Coverage ActivityCoverageus-core-coverage

Examples

C-CDA Header Structure

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns="urn:hl7-org:v3">
  <realmCode code="US"/>
  <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
  <templateId root="2.16.840.1.113883.10.20.22.1.1" extension="2015-08-01"/>
  <templateId root="2.16.840.1.113883.10.20.22.1.2" extension="2015-08-01"/>
  <id root="2.16.840.1.113883.19.5.99999.1" extension="TT988"/>
  <code code="34133-9" codeSystem="2.16.840.1.113883.6.1"
        displayName="Summarization of Episode Note"/>
  <title>Community Health Continuity of Care Document</title>
  <effectiveTime value="20240115120000-0500"/>
  <confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
  <languageCode code="en-US"/>

  <recordTarget>
    <patientRole>
      <id root="2.16.840.1.113883.19.5.99999.2" extension="MRN12345"/>
      <patient>
        <name><given>John</given><family>Smith</family></name>
        <administrativeGenderCode code="M" codeSystem="2.16.840.1.113883.5.1"/>
        <birthTime value="19800515"/>
      </patient>
    </patientRole>
  </recordTarget>
  ...
</ClinicalDocument>

Problems Section Example

<component>
  <section>
    <templateId root="2.16.840.1.113883.10.20.22.2.5.1" extension="2015-08-01"/>
    <code code="11450-4" codeSystem="2.16.840.1.113883.6.1"
          displayName="Problem List"/>
    <title>Problems</title>
    <entry typeCode="DRIV">
      <act classCode="ACT" moodCode="EVN">
        <entryRelationship typeCode="SUBJ">
          <observation classCode="OBS" moodCode="EVN">
            <code code="55607006" displayName="Problem"
                  codeSystem="2.16.840.1.113883.6.96"/>
            <statusCode code="completed"/>
            <effectiveTime>
              <low value="20200315"/>
            </effectiveTime>
            <value xsi:type="CD" code="I10" displayName="Essential Hypertension"
                   codeSystem="2.16.840.1.113883.6.90"/>
          </observation>
        </entryRelationship>
      </act>
    </entry>
  </section>
</component>