Skip to main content
Version: v0.0.3

Function: missingRequiredSections()

missingRequiredSections(documentType, presentKeys): readonly string[]

The SHALL section keys a DocumentType requires that are absent from presentKeys, preserving the type's declared order. The parser passes the set of recognized section keys it framed; each returned key becomes one REQUIRED_SECTION_MISSING warning. Returns an empty array when every required section is present (or the type asserts none).

Parameters

documentType

DocumentType

presentKeys

ReadonlySet<string>

Returns

readonly string[]

Example

import { missingRequiredSections } from "@cosyte/ccda";
missingRequiredSections("ccd", new Set(["allergies", "problems"]));
// ["medications", "results"]