Skip to main content
Version: v0.0.3

Function: isUcumCaseSuspect()

isUcumCaseSuspect(unit): boolean

Detect the case-confusion trap: a unit that is not a canonical clinical spelling but whose case-folded form is one, Mg/MG for mg, ML for mL, mEq for meq. These are reported as UCUM_CASE_SUSPECT (more actionable than NON_UCUM_UNIT) because the likely fix is a single letter-case change. A unit already spelled canonically returns false.

Parameters

unit

string

Returns

boolean

Example

import { isUcumCaseSuspect } from "@cosyte/ccda";
isUcumCaseSuspect("ML"); // true (meant mL; ML is megaliter)
isUcumCaseSuspect("mEq"); // true (meant meq)
isUcumCaseSuspect("mg"); // false (already canonical)