Skip to main content

MedicationRow

ComplexMedications<co-medication-row>

MedicationRow is one medication: name and strength, sig, quantity, refills, prescriber, pharmacy, last fill, and the DEA schedule tag for controlled drugs (C-II to C-V).

import { MedicationRow } from 'health-components';

Examples​

Variants​

Storybook

Discontinued​

Storybook

Without Actions​

Storybook

Usage​

<ul className="co-list"><MedicationRow med={{ name: "Oxycodone 5 mg tablet", sig: "1 tablet by mouth every 6 hours as needed for pain", qty: 20, refills: 0, schedule: "C-II" }} /></ul>

When to use​

  • Inside MedicationList, refill queues, eRx review.

When not to use​

  • Order entry: DrugSearch and SigBuilder.

Variants and states​

VariantWhat it is
controlledRed shield tag C-II, C-III, C-IV or C-V.
PRNTag.
discontinuedDimmed with tag.
sourceOutside source tag, such as Surescripts history.

Accessibility​

  • Schedule tag has a title with the full meaning.

Do and don't​

  • Do: Show the sig in plain words.
  • Don't: Abbreviations like "qd" or "u".

Props​

PropTypeDefaultDescription
med *Medication—{name, sig, qty, refills?, prescriber?, pharmacy?, last?, schedule?, prn?, status?, source?}; required
actionsbooleantrueShows the Renew / Change Dose / Mark Not Taking / Discontinue menu
onAction(action: MedicationAction, med: Medication) => voidnoneA menu action was chosen

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

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-medication-row>. 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-medication-row actions default-checked [med]="med" (co-action)="onAction($event.detail)"></co-medication-row>
KindNameDescription
property / JSON attributemed{name, sig, qty, refills?, prescriber?, pharmacy?, last?, schedule?, prn?, status?, source?}; required
attributeactionsShows the Renew / Change Dose / Mark Not Taking / Discontinue menu; default true
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
property / JSON attributevalue
eventco-actionA menu action was chosen; default none (React: onAction)