Skip to main content
Version: v0.0.4

Function: primaryCode()

primaryCode(u): string | undefined

The primary code to key a result on: the inline LOINC candidate when a vendor supplied one, otherwise the local (vendor) code. Returns undefined when the field carries no code at all (name-only or empty) - never a guess.

Parameters

u

UniversalTestId

A recognized Universal Test ID.

Returns

string | undefined

The primary code, or undefined.

Example

import { primaryCode, recognizeUniversalTestId } from "@cosyte/astm";
primaryCode(recognizeUniversalTestId(["2345-7", "Glucose", "LN", "687"])); // "2345-7"