Skip to main content
Version: v0.0.3

Function: semanticCodeInvalid()

semanticCodeInvalid(position, slot, observedOid): CcdaWarning

Build a SEMANTIC_CODE_INVALID warning. Emitted only when a consumer-supplied bring-your-own TerminologyAdapter reports (via validateCode) that a coded value is not a valid, active member of its code system, the semantic validation tier structural recognition cannot reach without a licensed terminology. The code is preserved verbatim (never coerced to a "corrected" value); this surfaces the adapter's negative verdict so a structurally-valid but wrong code, the highest-severity real-world defect, is not silently trusted. The message carries only the slot and the code-system OID (both structural identifiers); the specific code and any adapter message are never interpolated, so the warning stays PHI-free.

Parameters

position

CcdaPosition

slot

string

observedOid

string

Returns

CcdaWarning

Example

import { semanticCodeInvalid } from "@cosyte/ccda";
const w = semanticCodeInvalid({ path: "value" }, "problem", "2.16.840.1.113883.6.96");