Skip to main content
Version: v0.0.3

Interface: BuildQuantity

A dimensioned quantity for the builder, a numeric value and a UCUM unit (the parser round-trips it as a PQ). The unit is emitted verbatim: it is the caller's responsibility that it be valid, case-correct UCUM ("mg/dL", "mm[Hg]", "10*3/uL"), because a non-UCUM or case-slipped unit is a real defect the parser is designed to flag (NON_UCUM_UNIT / UCUM_CASE_SUSPECT), the builder never silently "corrects" a unit to a confident-wrong value.

Example

import type { BuildQuantity } from "@cosyte/ccda";
const glucose: BuildQuantity = { value: 95, unit: "mg/dL" };

Properties

unit

readonly unit: string

The UCUM unit (emitted verbatim, must be valid, case-correct UCUM).


value

readonly value: number

The numeric magnitude.