MAR
ComplexInpatient nursing
<co-m-a-r>MAR is the medication administration record: scheduled, PRN and continuous orders by time, with Given, Held, Refused, Late and Due states, a two-scan five rights check, a witness for high-alert drugs and co-sign.
import { MAR } from 'health-components';
Examples
All Statuses
High Alert Witness
Scan Mismatch
Prn Waiting
Continuous Read Only
Usage
<MAR times={["08:00","12:00","16:00","20:00"]} nowTime="12:00" patientName="Marcus Hill" patientBarcode="MRN0048213" rows={rows} onRecord={post} />
When to use
- Inpatient medication pass on any unit.
- Reviewing what was given, held or refused this shift.
When not to use
- Ordering or reconciling medications: MedicationList and MedReconciliation.
- Outpatient prescriptions: PrescriptionForm.
Variants and states
| Variant | What it is |
|---|---|
| Scheduled | Given (green), Due (amber), Late (red), Held and Refused (grey, with reason), Scheduled (future, outline). |
| PRN | PRN available cell; indication and reassessment window shown in the panel. |
| Continuous | Running state with the current rate in mL/h. |
| High-alert | Red High-alert badge; Given stays disabled until a witness is entered. |
| Co-sign | Records co-sign Pending against the dose. |
| Administer panel | Opens from a Due or Late cell: scan wristband, scan drug, five rights list, reason, Given / Held / Refused. |
| Scan mismatch | Red scan step and red rights; Given stays disabled. |
| readOnly | View only; cells are not buttons. |
Accessibility
- Table with caption; each actionable cell is a button named with drug, time and status.
- Scan results are announced through a live region.
- Disabled Given says why next to it in text.
- Status is a word in a pill, never colour alone.
Do and don't
- Do: Record the reason with every Held or Refused dose.
- Do: Show the drip rate on continuous rows.
- Don't: Allow Given before both scans match.
- Don't: Let one nurse witness their own high-alert dose.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
rows * | MarRow[] | — | Orders; required |
times * | string[] | — | Column times; required |
nowTime | string | none | Current column |
patientName | string | none | Patient name for the wristband step |
patientBarcode | string | none | Expected wristband code |
nurse | string | 'You' | Who records |
now | string | the scheduled time | Time recorded |
defaultActive | { row: string; time: string } | none | Administer panel open at first |
defaultScans | MarScans | {} | Initial scan results |
defaultWitness | string | '' | Initial witness |
filter | MarFilter | — | Controlled filter |
defaultFilter | MarFilter | 'all' | Initial filter (uncontrolled) |
onFilterChange | (filter: MarFilter) => void | — | Called when the filter changes |
readOnly | boolean | false | View only: cells are not buttons |
onRecord | (e: MarRecordEvent) => void | — | Called when a dose is recorded Given, Held or Refused |
title | string | 'Medication Administration Record' | Card title |
subtitle | string | none | Patient line |
rangeContext | RangeContextId | 'inpatient' when no global context is set | Which shared reference range flags use; the lab range on a result still wins |
Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, onChange, onInput, plus className and event handlers on the root element.
Angular, Vue and HTML
Register the elements once (Angular guide), then use <co-m-a-r>. 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-m-a-r now-time="…" patient-name="…" [rows]="rows" (co-filter-change)="onFilterChange($event.detail)"></co-m-a-r>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | rows | Orders; required |
| property / JSON attribute | times | Column times; required |
| attribute | now-time / nowTime | Current column; default none |
| attribute | patient-name / patientName | Patient name for the wristband step; default none |
| attribute | patient-barcode / patientBarcode | Expected wristband code; default none |
| attribute | nurse | Who records; default 'You' |
| attribute | now | Time recorded; default the scheduled time |
| property / JSON attribute | default-active / defaultActive | Administer panel open at first; default none |
| property / JSON attribute | default-scans / defaultScans | Initial scan results; default {} |
| attribute | default-witness / defaultWitness | Initial witness; default '' |
| attribute | filter | Controlled filter |
| attribute | default-filter / defaultFilter | Initial filter (uncontrolled); default 'all' |
| attribute | read-only / readOnly | View only: cells are not buttons; default false |
| attribute | title | Card title; default 'Medication Administration Record' |
| attribute | subtitle | Patient line; default none |
| attribute | range-context / rangeContext | Which shared reference range flags use; the lab range on a result still wins; default 'inpatient' when no global context is set |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-filter-change | Called when the filter changes (React: onFilterChange) |
| event | co-record | Called when a dose is recorded Given, Held or Refused (React: onRecord) |
| event | co-change | (React: onChange) |
| event | co-input | (React: onInput) |