Skip to main content
Version: v0.0.4

Variable: DIAGNOSTIC_CODES

const DIAGNOSTIC_CODES: object

Stable diagnostic codes - typed, surfaced, non-throwing outcomes.

These are not errors: they are first-class results a caller inspects (an unmapped translation, an unrecognized code system). key === value so Object.values(...) yields the snapshot set.

Type Declaration

TERM_CODE_UNKNOWN

readonly TERM_CODE_UNKNOWN: "TERM_CODE_UNKNOWN" = "TERM_CODE_UNKNOWN"

A $lookup/$validate-code found no concept for the code in the loaded release. A first-class typed outcome, never a guess - the engine returns unknown/valid: false, never a fabricated display or a coerced valid: true (the never-fabricate invariant, applied to code identity).

TERM_COMPLEX_MAP_MALFORMED_ROW

readonly TERM_COMPLEX_MAP_MALFORMED_ROW: "TERM_COMPLEX_MAP_MALFORMED_ROW" = "TERM_COMPLEX_MAP_MALFORMED_ROW"

A SNOMED complex-map RF2 refset row was structurally unusable - missing its referencedComponentId/mapGroup/mapPriority. Skipped and surfaced, never partial.

TERM_CONCEPT_DEPRECATED

readonly TERM_CONCEPT_DEPRECATED: "TERM_CONCEPT_DEPRECATED" = "TERM_CONCEPT_DEPRECATED"

A resolved concept is deprecated / no longer current (e.g. LOINC STATUS = DEPRECATED, or a FHIR concept flagged inactive). Surfaced on the concept's status so a caller never presents a non-current code as clean; the concept is still found (a lookup succeeds), it is just flagged.

TERM_CONCEPT_HEADER_NOT_BILLABLE

readonly TERM_CONCEPT_HEADER_NOT_BILLABLE: "TERM_CONCEPT_HEADER_NOT_BILLABLE" = "TERM_CONCEPT_HEADER_NOT_BILLABLE"

A resolved concept is a classification header, not a billable/valid leaf (e.g. an ICD-10-CM order-file row with the position-15 flag 0). Surfaced on the concept's status: a header code is found but is not valid for claim submission, and must never be presented as billable.

TERM_CROSSWALK_CONTEXT_REQUIRED

readonly TERM_CROSSWALK_CONTEXT_REQUIRED: "TERM_CROSSWALK_CONTEXT_REQUIRED" = "TERM_CROSSWALK_CONTEXT_REQUIRED"

A SNOMED→ICD-10-CM complex-map group's decision needs patient context (an IFA age band or gender) the caller did not supply. The engine surfaces the candidate rules + advice and refuses to pick a branch it lacks the data for - never a silently-chosen target.

TERM_CROSSWALK_NO_MAP

readonly TERM_CROSSWALK_NO_MAP: "TERM_CROSSWALK_NO_MAP" = "TERM_CROSSWALK_NO_MAP"

A crosswalk source code has an authored No-Map - the steward declares it has no valid target in the other classification (a GEM NoDx/NoPCS sentinel, or a SNOMED complex-map 447638001 "cannot be classified" category). A first-class typed outcome, never an error and never a guess (the never-fabricate invariant, applied to crosswalks). Distinct from TERM_CROSSWALK_UNMAPPED: the source is in the map, and the map says "no target".

TERM_CROSSWALK_UNMAPPED

readonly TERM_CROSSWALK_UNMAPPED: "TERM_CROSSWALK_UNMAPPED" = "TERM_CROSSWALK_UNMAPPED"

A crosswalk source code is absent from the map entirely - not an authored No-Map, simply not present. Surfaced as a typed outcome (never a fabricated target, never a silent success), and kept distinct from TERM_CROSSWALK_NO_MAP so a caller can tell "the steward said no target" from "this code was not in the file".

TERM_CSV_MALFORMED

readonly TERM_CSV_MALFORMED: "TERM_CSV_MALFORMED" = "TERM_CSV_MALFORMED"

A CSV (RFC-4180, e.g. LOINC Loinc.csv) row was structurally unusable - too few fields to reach a configured column. The row is skipped and surfaced as a load warning, never partial.

TERM_FHIR_CONCEPT_MALFORMED

readonly TERM_FHIR_CONCEPT_MALFORMED: "TERM_FHIR_CONCEPT_MALFORMED" = "TERM_FHIR_CONCEPT_MALFORMED"

A concept inside a FHIR CodeSystem resource was unusable - not an object, or missing its required code. Skipped and surfaced (the whole resource still loads); line is 0 since a JSON concept is not line-addressable.

TERM_FIXED_WIDTH_MALFORMED

readonly TERM_FIXED_WIDTH_MALFORMED: "TERM_FIXED_WIDTH_MALFORMED" = "TERM_FIXED_WIDTH_MALFORMED"

A fixed-width (e.g. ICD-10-CM order file) row was structurally unusable - too short to contain the configured code field, or a missing code. Skipped and surfaced, never partial.

TERM_GEM_MALFORMED_ROW

readonly TERM_GEM_MALFORMED_ROW: "TERM_GEM_MALFORMED_ROW" = "TERM_GEM_MALFORMED_ROW"

A GEM file line was structurally unusable - not three whitespace-delimited fields, or a flag field that is not a 5-digit code. The row is skipped and surfaced as a load warning (liberal on load), never kept as a partially-parsed entry.

TERM_RRF_MALFORMED_ROW

readonly TERM_RRF_MALFORMED_ROW: "TERM_RRF_MALFORMED_ROW" = "TERM_RRF_MALFORMED_ROW"

An RRF (pipe-delimited RxNorm/UMLS release) row was structurally unusable - too few columns to reach a configured field, or a missing code. The row is skipped and surfaced as a load warning (liberal on load), never kept as a partially-parsed concept.

TERM_RXNORM_MALFORMED_ROW

readonly TERM_RXNORM_MALFORMED_ROW: "TERM_RXNORM_MALFORMED_ROW" = "TERM_RXNORM_MALFORMED_ROW"

A RxNorm RRF row (RXNCONSO / RXNREL / RXNSAT) was structurally unusable - too few columns to reach a required field, or a missing RXCUI/NDC value. The row is skipped and surfaced as a load warning (liberal on load), never kept as a partial concept/edge. Rows that are simply not of interest (a non-RXNORM atom, an atom-level relationship, a non-NDC attribute) are skipped silently - they are expected, not faults.

TERM_RXNORM_NDC_UNMAPPED

readonly TERM_RXNORM_NDC_UNMAPPED: "TERM_RXNORM_NDC_UNMAPPED" = "TERM_RXNORM_NDC_UNMAPPED"

An NDC could not be resolved to any RXCUI in the loaded RxNorm release - a typed, surfaced absence, never a guessed RXCUI. NDC↔RXCUI is many:1 and temporal, so a resolution is always release-scoped; an NDC not present in the loaded release is this diagnostic.

TERM_RXNORM_UNKNOWN_RXCUI

readonly TERM_RXNORM_UNKNOWN_RXCUI: "TERM_RXNORM_UNKNOWN_RXCUI" = "TERM_RXNORM_UNKNOWN_RXCUI"

A RxNorm graph navigation was asked about an RXCUI absent from the loaded release - a first-class typed outcome, never a fabricated concept and never an empty "success" (the never-fabricate invariant, applied to the drug graph). Distinct from a present concept that simply has no edge of the requested relationship (that is a found result with empty targets).

TERM_RXNORM_UNTYPED_CONCEPT

readonly TERM_RXNORM_UNTYPED_CONCEPT: "TERM_RXNORM_UNTYPED_CONCEPT" = "TERM_RXNORM_UNTYPED_CONCEPT"

An RXCUI appeared in the release's SAB=RXNORM atoms but none of them could establish its term type, so it is not in the graph. Either every atom carried a synonym-class TTY (PSN/SY/TMSY, which Appendix 5 defines as a "synonym of another TTY" and which therefore types a name rather than a concept) or every atom carried a TTY this engine does not model. The concept is skipped rather than typed from a synonym atom: an absent concept is already a first-class typed answer (TERM_RXNORM_UNKNOWN_RXCUI), while a concept whose term type reads TMSY is a fabricated claim about what a drug is that a caller cannot detect.

TERM_SYSTEM_UNRECOGNIZED

readonly TERM_SYSTEM_UNRECOGNIZED: "TERM_SYSTEM_UNRECOGNIZED" = "TERM_SYSTEM_UNRECOGNIZED"

A code-system identifier (URI, OID, or mnemonic) was not recognized by the identity resolver. Surfaced as a typed unknown, never coerced to a guessed canonical URI.

TERM_TRANSLATE_UNMAPPED

readonly TERM_TRANSLATE_UNMAPPED: "TERM_TRANSLATE_UNMAPPED" = "TERM_TRANSLATE_UNMAPPED"

A $translate found no target for the source code. A first-class outcome, never an error - the source is surfaced as unmapped, never replaced with a guessed target (the never-fabricate invariant).

TERM_UCUM_INVALID

readonly TERM_UCUM_INVALID: "TERM_UCUM_INVALID" = "TERM_UCUM_INVALID"

A UCUM unit expression is not valid - it does not parse against the UCUM grammar, or it names an atom absent from the vendored UCUM table. A first-class typed outcome, never an error and never a guess: validateUcum returns { valid: false, reason }, never a coerced or "nearest" unit (the never-fabricate invariant, applied to units). The reason is value-free (a grammar fault or an unknown-atom shape), never PHI.

TERM_VALUESET_CANNOT_EXPAND

readonly TERM_VALUESET_CANNOT_EXPAND: "TERM_VALUESET_CANNOT_EXPAND" = "TERM_VALUESET_CANNOT_EXPAND"

A ValueSet compose part could not be expanded - an intensional include/exclude whose code system was not supplied, an unresolvable referenced value set, or a filter operator the engine does not implement. Surfaced as a typed outcome that marks the expansion incomplete; the engine never fabricates a member and never returns a silently-empty "no members" answer for a part it could not compute (a false "not a member" is a clinical error).

TERM_VALUESET_EXPANSION_TRUNCATED

readonly TERM_VALUESET_EXPANSION_TRUNCATED: "TERM_VALUESET_EXPANSION_TRUNCATED" = "TERM_VALUESET_EXPANSION_TRUNCATED"

A pre-computed ValueSet.expansion is incomplete - its total exceeds the number of contains entries, or it is flagged too-costly (the VSAC $expand >1200-code truncation hazard). The engine never treats a truncated expansion as complete membership: a code absent from a truncated expansion is undetermined, never a confident "not a member".

Example

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

DIAGNOSTIC_CODES.TERM_TRANSLATE_UNMAPPED; // => "TERM_TRANSLATE_UNMAPPED"