Skip to main content

DoseDisplay

ComplexClinical values<co-dose-display>

DoseDisplay writes a medication dose the ISMP way: tall-man drug names, leading zero, no trailing zero, and units, mcg and mL spelled safely.

import { DoseDisplay } from 'health-components';

Examples​

Doses​

Storybook

Inline​

Storybook

Usage​

<DoseDisplay drug="hydroxyzine" strength={25} unit="mg" form="tablet" amount={25} route="PO" frequency="every 6 hours" prn prnReason="itching" lookAlike="hydralazine" />

When to use​

  • Medication lists, MAR rows, order review, prescription preview, discharge instructions.

When not to use​

  • Lab or vital values: ClinicalValue.
  • Free-text sigs from outside sources: show verbatim and label as external.

Variants and states​

VariantWhat it is
stackedDrug and strength above, dose and sig below (default).
inlineOne line for tables.
highAlertRed High-alert badge (insulin, heparin, opioids).
lookAlikeAmber badge naming the look-alike drug.
weight-basedperKg and weightKg show the calculation.

Accessibility​

  • Tall-man capitals are read normally by screen readers; the visual cue is for sighted readers.
  • Badges carry text, not colour alone.

Do and don't​

  • Do: Pass numbers; let fmt drop the trailing zero.
  • Don't: Write "U", "IU", "cc", "µg" or ".5" anywhere on screen.

Props​

PropTypeDefaultDescription
drug *string—Drug name; tall-man lettering is applied automatically; required
amount *number | string—Dose amount (a number, or a string such as '.5' that is parsed); required
unit *string—Dose unit: mg, mcg, g, units, mL, mEq... ('U', 'IU', 'ug', 'cc' are rewritten safely); required
strengthnumbernoneProduct strength
strengthUnitstring`unit`Strength unit
formstringnoneDose form ('tablet', 'per 5 mL suspension')
routestringnoneRoute ('PO', 'IV', 'subcut')
frequencystringnoneFrequency ('every 6 hours')
prnbooleanfalseAs needed
prnReasonstringnonePRN reason ('itching')
perKgnumbernoneDose per kg, shown with `weightKg` as the calculation
weightKgnumbernoneWeight used for the calculation, kg
highAlertbooleanfalseISMP high-alert medication: red High-alert badge
lookAlikestringnoneLook-alike drug name: amber badge
layoutDoseDisplayLayout'stacked''stacked' (drug above, dose and sig below) | 'inline' (one line for tables)

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-dose-display>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-dose-display drug="…" unit="…" [amount]="amount"></co-dose-display>
KindNameDescription
attributedrugDrug name; tall-man lettering is applied automatically; required
property / JSON attributeamountDose amount (a number, or a string such as '.5' that is parsed); required
attributeunitDose unit: mg, mcg, g, units, mL, mEq... ('U', 'IU', 'ug', 'cc' are rewritten safely); required
attributestrengthProduct strength; default none
attributestrength-unit / strengthUnitStrength unit; default `unit`
attributeformDose form ('tablet', 'per 5 mL suspension'); default none
attributerouteRoute ('PO', 'IV', 'subcut'); default none
attributefrequencyFrequency ('every 6 hours'); default none
attributeprnAs needed; default false
attributeprn-reason / prnReasonPRN reason ('itching'); default none
attributeper-kg / perKgDose per kg, shown with `weightKg` as the calculation; default none
attributeweight-kg / weightKgWeight used for the calculation, kg; default none
attributehigh-alert / highAlertISMP high-alert medication: red High-alert badge; default false
attributelook-alike / lookAlikeLook-alike drug name: amber badge; default none
attributelayout'stacked' (drug above, dose and sig below) | 'inline' (one line for tables); default 'stacked'
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus