Skip to main content
Version: v0.0.2

Variable: FATAL_CODES

const FATAL_CODES: object

Stable fatal codes - thrown (as a TerminologyError) when input cannot be loaded into a usable model at all. Always thrown, never swallowed. key === value, part of the contract.

Type Declaration

TERM_CODESYSTEM_MALFORMED

readonly TERM_CODESYSTEM_MALFORMED: "TERM_CODESYSTEM_MALFORMED" = "TERM_CODESYSTEM_MALFORMED"

A CodeSystem source was structurally unusable - a FHIR resource with the wrong resourceType, or a delimited source whose configured code/display column is absent from the header. Thrown rather than silently loading an empty or mis-keyed release. (Malformed individual rows are skipped-and-surfaced load warnings, not fatals - only an unusable source is fatal.)

TERM_CONCEPTMAP_MALFORMED

readonly TERM_CONCEPTMAP_MALFORMED: "TERM_CONCEPTMAP_MALFORMED" = "TERM_CONCEPTMAP_MALFORMED"

A ConceptMap resource was structurally unusable - wrong resourceType, or a group/element missing a required field. Thrown rather than silently loading a partial, misleading map.

TERM_CROSSWALK_MALFORMED

readonly TERM_CROSSWALK_MALFORMED: "TERM_CROSSWALK_MALFORMED" = "TERM_CROSSWALK_MALFORMED"

A crosswalk map source was structurally unusable - e.g. a SNOMED complex-map RF2 refset with empty content or a header missing a required column. Thrown rather than silently loading an empty or mis-keyed map. (Malformed individual rows are skipped-and-surfaced warnings, not fatals.)

TERM_MAP_NOT_INVERTIBLE

readonly TERM_MAP_NOT_INVERTIBLE: "TERM_MAP_NOT_INVERTIBLE" = "TERM_MAP_NOT_INVERTIBLE"

An inversion of a directional crosswalk was requested - a forbidden operation. The GEMs and the SNOMED→ICD-10-CM map are authoritative in one direction only; a forward map is not the inverse of the backward map. Thrown by ../crosswalk/gems.invertGem so the never-invert refusal is a first-class, discoverable contract rather than a silent absence.

TERM_VALUESET_MALFORMED

readonly TERM_VALUESET_MALFORMED: "TERM_VALUESET_MALFORMED" = "TERM_VALUESET_MALFORMED"

A ValueSet resource was structurally unusable - wrong resourceType, or a compose/expansion whose required shape (an include that is not an object, a contains entry missing its code) is corrupt. Thrown rather than silently loading a partial value set that would bind some codes and quietly drop others. (A filter operator the engine does not implement is not fatal - it is the surfaced TERM_VALUESET_CANNOT_EXPAND diagnostic at expansion time.)

Example

import { FATAL_CODES } from "@cosyte/terminology";

FATAL_CODES.TERM_CONCEPTMAP_MALFORMED; // => "TERM_CONCEPTMAP_MALFORMED"