Skip to main content
Version: v0.0.3

Type Alias: BuildCcdaPlannedItem

BuildCcdaPlannedItem = BuildCcdaPlannedAct | BuildCcdaPlannedOrder | BuildCcdaPlannedObservation | BuildCcdaPlannedImmunization

A planned item for the Plan of Treatment section (…22.2.10), a discriminated union over the seven planned-entry templates the parser returns, split by which @moodCode domain each element admits and by which SHALL elements each template carries: BuildCcdaPlannedAct (act/encounter/procedure, which accept the appointment moods APT/ARQ), BuildCcdaPlannedOrder (medication/supply), BuildCcdaPlannedObservation (observation, which also carries an expected value), and BuildCcdaPlannedImmunization (immunization, whose effectiveTime is required rather than optional). The mood split is correct by construction: the base CDA R2 mood domains for substanceAdministration, supply, and observation exclude APT/ARQ, so those appointment moods are simply not representable on those kinds, the type prevents emitting a schema-invalid @moodCode, not merely a discouraged one.

Everything here is future/ordered, never performed. No variant admits the performed EVN; each entry's statusCode is fixed to "active" (the SHALL the planned templates require), never a performed "completed", and the planned @moodCode reads back through the parser's disposition as "planned"; the two dispositions are never conflated.

Example

import type { BuildCcdaPlannedItem } from "@cosyte/ccda";
const plannedColonoscopy: BuildCcdaPlannedItem = {
kind: "procedure",
code: { code: "73761001", displayName: "Colonoscopy" }, // SNOMED CT
};