Skip to main content
Version: v0.1.13

Known limitations

This page is the deliberate "do not over-trust" list: each boundary of the parser, the builder and the editor, in brief and in tables. Where a boundary applies, the raw value is kept, usually with a warning, and is not decoded further. The boundaries of reading, building and editing explains each one, and the cases where a value still leaves the model with no warning.

In brief​

  • parseCcda recognizes all twelve document types and decodes fourteen entry families; other sections keep their narrative only.
  • An entry another <subject> governs is withheld from the patient's read paths and reached only through toString().
  • A document that restates the patient as an entry subject loses those entries from the patient's read paths too.
  • Code checks test a code's system at five coded slots; membership needs your terminology adapter or value-set source.
  • A code in a <translation> is kept and re-serialized but never slot-checked.
  • UCUM validation is grammatical, over a curated subset of atoms, and converts no unit.
  • LOINC deprecation is checked against a curated list, not the whole LOINC release.
  • Required-section checks under-warn; requiredSectionStatus says how far each document type was traced.
  • buildCcda writes six of the twelve document types and refuses the other six.
  • buildCcda refuses a coded value with no displayName rather than write a default label.
  • buildCcda never invents a clinical time, an identifier or an assessment; it writes nullFlavor="UNK" or reports a code.
  • editCcda adds or replaces whole sections of twelve kinds, removes none, and stamps RPLC revisions only.
  • A vendor profile quiets only codes outside SAFETY_CRITICAL_CODES and never changes an extracted value.
  • An Unstructured Document's nonXMLBody payload is exposed but never decoded.
  • An element holding one attribute name twice under two prefixes of one namespace is refused with NOT_WELL_FORMED_XML, never read with one of the two.
  • Line endings follow XML 1.0: only CR LF and a lone CR become a line feed. NEL, U+2028 and U+2029 are kept in text and attribute values, and refused with NOT_WELL_FORMED_XML inside a tag or outside the root.
  • Every other character outside ASCII that XML 1.0 allows neither as white space nor in a name (a no-break space, U+0080, the Unicode spaces, the private use characters) is refused the same way inside a tag or outside the root, and kept in text and attribute values.
  • An ASCII character that is neither white space nor a name character inside a tag (<a b="1";c="2"/>) is still read as the DOM library under the parser reads it: the tag becomes plain text, with no warning.
  • The scope is C-CDA R2.1, US Realm: no transport and no validator suite.

Document types​

Document typedocumentTypeReadBuilt by buildCcdaRequired sections verified
Continuity of Care DocumentccdYesYestraced-complete
Discharge SummarydischargeSummaryYesYestraced-partial
Referral NotereferralNoteYesYestraced-partial
Consultation NoteconsultationNoteYesYestraced-partial
History and PhysicalhistoryAndPhysicalYesYestraced-partial
Progress NoteprogressNoteYesYestraced-partial
Procedure NoteprocedureNoteYesNotraced-partial
Operative NoteoperativeNoteYesNotraced-partial
Care PlancarePlanYesNotraced-complete
Diagnostic Imaging ReportdiagnosticImagingReportYesNotraced-partial
Unstructured DocumentunstructuredDocumentYesNonot-applicable
Transfer SummarytransferSummaryYesNotraced-partial
Patient Generated DocumentpatientGeneratedDocumentYesNotraced-complete

The last row is the Patient Generated Document header, which parseCcda reads when a document carries it alone. The last column is requiredSectionStatus(documentType).verification:

import { DOCUMENT_TYPES, requiredSectionStatus } from "@cosyte/ccda";

const verified = DOCUMENT_TYPES.map(
(type) => `${type}:${requiredSectionStatus(type).verification}`,
).join(" ");

verified; // => "ccd:traced-complete dischargeSummary:traced-partial referralNote:traced-partial consultationNote:traced-partial historyAndPhysical:traced-partial progressNote:traced-partial procedureNote:traced-partial operativeNote:traced-partial carePlan:traced-complete diagnosticImagingReport:traced-partial unstructuredDocument:not-applicable transferSummary:traced-partial patientGeneratedDocument:traced-complete"

What each part covers​

PartCoversDoes not cover
Entry families decoded by parseCcdaProblems, Medications, Allergies, Results, Vital Signs, Immunizations, Procedures, Encounters, Social History smoking status, Plan of Treatment, Functional Status, Mental Status, Family History, Past Medical HistoryThe entries of every other section, which keep their narrative and raw structure
Coded slots checked for their code systemproblem, medication, allergen, route, vaccineResults and Vital Signs LOINC codes, procedure, encounter and family-history codes, most planned-item codes, status values, the allergy type, reaction, severity and criticality
Slots buildCcda writes <translation> atThe problem value, the allergen, the medication drug and route, the vaccine and routeEvery other coded slot
Section kinds editCcda editsproblems, allergies, medications, results, vitalSigns, immunizations, procedures, encounters, socialHistory, pastMedicalHistory, planOfTreatment, familyHistoryFunctional Status, Mental Status, Assessment, Reason for Referral and the five office-visit narratives; entry-level append; section removal; APND and XFRM revisions
Built-in vendor profilesccdaProfiles.default, ccdaProfiles.smartScorecard, ccdaProfiles.legacyR11Named per-vendor profiles

Cases reported against other parsers​

The open issues on other C-CDA parsers are mostly one complaint: a value the document carried came back as nothing, with nothing said. We took each class of that complaint, wrote a synthetic document for it, and hold every class to one rule: the value is in the typed model, or a warning with a named code is raised on the element that holds it. test/silent-loss.test.ts runs them. Every class meets the rule. Three of them used to drop the value with no warning (an entry with no templateId, a Goal Observation, an implant's device) and a REAL value was reported but its number was not in the model; all four were fixed in the same release.

ClassWhat we do todayResult
Allergy whose category is not foodtype keeps the propensity code and allergen the substance, whatever the categoryKept
Interval effectiveTime on a medicationduration.low and duration.highKept
Interval effectiveTime on a resulteffectiveTime.low and effectiveTime.highKept
REAL observation value{ kind: "real", value, raw }: the number and the verbatim @value, no warningKept
ED observation value{ kind: "unsupported", xsiType: "ED", raw } with the text, and RESULT_VALUE_TYPE_UNHANDLEDKept and reported
Family History sectiongetFamilyHistory(): the relative and each conditionKept
negationInd on a problemnegated: true beside the coded valueKept
negationInd on a medicationnegated: true beside the drugKept
Medication whose first templateId is not the Medication Activity rootRead: every templateId is checked, not only the firstKept
Timestamp with no zone offsetraw keeps every digit; toObject gives no offsetMinutes and toDate gives undefined unless you pass assumeOffsetMinutesKept
A single participantThe allergen is read from it like any otherKept
Medication entry with no templateIdNot read, since every entry family is recognized by templateId; MISSING_TEMPLATE_ID is raised on the entry's statement. The same holds for an entry with no templateId in any sectionReported
Goals section with a Goal ObservationThe section is recognized and keeps its narrative; the Goal Observation is not modeled, and PLAN_ENTRY_NOT_MODELED is raised on itReported
Implant: a procedure in Medical Equipment with a Product Instance deviceThe procedure is read, and devices on it keeps the device code and its ids (the UDI). The guide names this entry in this section, so it draws no SECTION_PLACEMENT_SUSPECTKept

A reported value is still in the document: doc.toString() re-serializes it faithfully, so a caller who needs it can read it from there. Two boundaries remain beside these classes. An entry whose statement carries a templateId this library does not read (a Health Concern Act, a Non-Medicinal Supply Activity, an Advance Directive Observation) is not in the model and draws no warning. A Product Instance's scopingEntity, the organization that issued the device id, is not read.

Scope (non-goals)​

  • C-CDA R2.1, US Realm. Other CDA templates and realms are out of the current scope.
  • A parser + serializer, not a transport or a validator suite. No MLLP/XDS delivery, no Schematron conformance report: this reads and re-emits documents.
  • Below 1.0. @cosyte/ccda is at 0.1, published on npm, and public. Its exported names, options, return shapes, and warning codes are the surface we keep stable. Every release is a patch, so a breaking change can ship in a patch: pin an exact version, and read the changelog, where a break says what a caller must change, before you move it. Run npm view @cosyte/ccda version for the published version.