基準値判定ReferenceValueExperimental

A measured value judged against a reference range: classifies it as normal / high (H) / low (L) / critical (HH/LL) and renders the value with a flag code, tone and screen-reader text — the value-vs-range judgement that vitals, lab results, dose safety, SLA/quota and tolerance bands all need. Exports a pure `flagValue()` helper for tables and charts.

プレビュー

項目結果
体温38.9H高値基準 3637.5
SpO₂88%LL異常低値基準 96%
脈拍72回/分基準値内基準 60100回/分
K (カリウム)6.8mEq/LHH異常高値基準 3.55mEq/L
Hb9.2g/dLL低値基準 1317g/dL

Props

表は横にスクロールできます
プロパティ初期値説明
valuenumber-The measured value.
range{ low?, high?, criticalLow?, criticalHigh? }-Reference range. Below low → L, above high → H, at/beyond criticalLow/criticalHigh → LL/HH. Critical bounds win.
format(value: number) => ReactNode-Format the value and the range bounds. Default String(value).
unitstring-Unit suffix (e.g. "℃", "mg", "mEq/L").
labelsPartial<Record<RangeFlag, string>>-Localized flag labels (announced + shown when showLabel). Defaults to JA (高値/低値/異常…).
showLabel / showRangeboolean-Show the flag label visibly / show the normal-range text (基準 36.0–37.5).
hideFlagboolean-Hide the flag chip (value stays toned + sr-only flag text kept). Default false.
size"default" | "inline""default"inline is compact for table cells.
flagValue(value, range)() => RangeFlag-Exported pure classifier → "normal" | "high" | "low" | "critical-high" | "critical-low". Use to colour table cells / chart points.

Usage

import { ReferenceValue, flagValue } from "@gunjo/ui"

// value judged against a reference range → flag + tone + sr text
<ReferenceValue value={38.9} unit="℃" range={{ low: 36.0, high: 37.5, criticalHigh: 40.0 }} showRange />
<ReferenceValue value={88}  unit="%"  range={{ low: 96, criticalLow: 90 }} />   // → 88% LL (異常低値)

// the pure classifier, for colouring table cells / chart points without re-deriving
flagValue(6.8, { low: 3.5, high: 5.0, criticalHigh: 6.0 })   // → "critical-high"