Skip to main content
Version: v0.0.3

Interface: ParseCcdaOptions

Options accepted by parseCcda to tune lenient/strict behaviour and the security limits. Every field is optional; parseCcda(raw, {}) is valid and produces the library defaults (lenient parse, default safety caps).

Remarks

With exactOptionalPropertyTypes: true, callers cannot pass { strict: undefined }, either omit the key or pass a boolean.

Example

import { parseCcda, type ParseCcdaOptions } from "@cosyte/ccda";
const opts: ParseCcdaOptions = {
strict: false,
onWarning: (w) => console.warn(w.code),
};
parseCcda(raw, opts);

Properties

limits?

readonly optional limits?: CcdaParseLimits

Override one or more of the default safety caps applied before DOM construction.


onWarning?

readonly optional onWarning?: OnWarningCallback

Inline callback fired for each Tier-2 warning, in discovery order.


profile?

readonly optional profile?: CcdaProfile | null

The vendor/conformance CcdaProfile to apply. A profile downgrades the non-safety-critical deviations it expects to PROFILE_QUIRK_APPLIED (flagged expected), it never changes an extracted value and can never tolerate a safety-critical warning. Omit to consult the process-scoped default (setDefaultCcdaProfile); pass null to opt out of that default for this call.


strict?

readonly optional strict?: boolean

When true, escalate every Tier-2 deviation to a thrown error instead of a warning.


terminology?

readonly optional terminology?: TerminologyAdapter

An optional consumer-supplied bring-your-own TerminologyAdapter. When present, the parser semantically validates each recognized coded value (a problem, medication, allergen, route, or vaccine code) against it and emits SEMANTIC_CODE_INVALID on a negative verdict, the code preserved verbatim, never coerced. Omit it for the default recognize-only behavior. @cosyte/ccda never imports a terminology library; you supply the adapter.