Skip to main content
Version: v0.0.3

Function: codingSystem()

codingSystem(id): CodingSystemInfo | undefined

Resolve a raw coding-system id (a CWE.3 / CE.3 "Name of Coding System" value) to its provenance. Returns undefined when there is no claim to resolve: id is undefined, empty, or whitespace-only.

Matching is case-insensitive and tolerant of surrounding whitespace, and normalizes the well-known aliases in KNOWN_CODING_SYSTEMS (e.g. "LOINC"LN, "SNOMED"SCT, "RxNorm"RXN). An unrecognized id is returned verbatim with known: false: never guessed.

Parameters

id

string | undefined

Returns

CodingSystemInfo | undefined

Example

import { codingSystem } from "@cosyte/hl7";
codingSystem("LN"); // { claimed: "LN", known: true, id: "LN", name: "LOINC" }
codingSystem("loinc"); // { claimed: "loinc", known: true, id: "LN", name: "LOINC" }
codingSystem("99zL"); // { claimed: "99zL", known: false }
codingSystem(undefined); // undefined