BedBoard
ComplexInpatient flow
<co-bed-board>BedBoard shows every bed on one or more units by room, with its status, the patient in it and their precautions, and lets bed management drag a waiting patient onto a clean bed.
import { BedBoard } from 'health-components';
Examples
Showcase
Patient Selected
Read Only
Usage
<BedBoard units={units} queue={waiting} onAssign={(pt, bed, room) => api.assignBed(pt.id, room.id + bed.id)} />
When to use
- House supervisor, bed management and charge nurse views.
- Any time a person picks a bed for an admission or transfer.
When not to use
- A list of patients without beds: CensusList.
- Outpatient rooms: the scheduling components.
Variants and states
| Variant | What it is |
|---|---|
| clean | Green edge. Ready for a patient. |
| dirty | Amber fill. Waiting for environmental services. |
| occupied | Blue edge with patient, day of stay and badges. |
| blocked | Hatched. With the reason. |
| pending | Purple dashed. Assigned, patient on the way. |
| drag target | While a patient is selected, beds that pass the placement check get an outline and an Assign button; others fade and say why. |
| rejected drop | Error alert with the rule that failed. |
| readOnly | Lock alert, no dragging. |
Accessibility
- Drag is never the only way: select a waiting patient, then press Assign on a bed.
- Each bed has an aria-label with room, status, patient and, while a patient is selected, why it cannot take them.
- Bed status is in words as well as colour.
Do and don't
- Do: Run the placement check before the drop so airborne patients only land in negative-pressure rooms.
- Do: Treat the check as a guard. The charge nurse still confirms the bed.
- Don't: Show a patient's full diagnosis list on a public hallway display.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
units * | BedUnit[] | — | Array of { id, name, level, ratio, rooms: [{ id, negativePressure, beds: [{ id, status, note, patient }] }] }: the initial board (uncontrolled); required |
unitsValue | BedUnit[] | uncontrolled from `units` | The board (controlled); pair with onUnitsChange |
onUnitsChange | (units: BedUnit[]) => void | none | Called with the new board after an assignment |
queue | BedQueuePatient[] | [] | Array of patients waiting for a bed { id, name, age, sex, reason, level, isolation, waiting }: the initial queue |
queueValue | BedQueuePatient[] | uncontrolled from `queue` | The queue (controlled); pair with onQueueChange |
onQueueChange | (queue: BedQueuePatient[]) => void | none | Called with the new queue after an assignment |
defaultSelected | string | none | Queue id selected at start (uncontrolled) |
selected | string | null | uncontrolled | Selected queue id (controlled; null for none) |
onSelectedChange | (id: string | null) => void | none | Called with the newly selected queue id (null when cleared) |
onAssign | (patient: BedQueuePatient, bed: Bed, room: BedRoom) => void | none | function(patient, bed, room) after a patient is assigned |
readOnly | boolean | false | View only: no drag, no assign |
title | string | 'Bed Board' | Card title |
subtitle | string | none | Line under the title |
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, plus className and event handlers on the root element.
Angular, Vue and HTML
Register the elements once (Angular guide), then use <co-bed-board>. 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-bed-board default-selected="…" selected="…" [units]="units" (co-units-change)="onUnitsChange($event.detail)"></co-bed-board>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | units | Array of { id, name, level, ratio, rooms: [{ id, negativePressure, beds: [{ id, status, note, patient }] }] }: the initial board (uncontrolled); required |
| property / JSON attribute | units-value / unitsValue | The board (controlled); pair with onUnitsChange; default uncontrolled from `units` |
| property / JSON attribute | queue | Array of patients waiting for a bed { id, name, age, sex, reason, level, isolation, waiting }: the initial queue; default [] |
| property / JSON attribute | queue-value / queueValue | The queue (controlled); pair with onQueueChange; default uncontrolled from `queue` |
| attribute | default-selected / defaultSelected | Queue id selected at start (uncontrolled); default none |
| attribute | selected | Selected queue id (controlled; null for none); default uncontrolled |
| attribute | read-only / readOnly | View only: no drag, no assign; default false |
| attribute | title | Card title; default 'Bed Board' |
| attribute | subtitle | Line under the title; 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-units-change | Called with the new board after an assignment; default none (React: onUnitsChange) |
| event | co-queue-change | Called with the new queue after an assignment; default none (React: onQueueChange) |
| event | co-selected-change | Called with the newly selected queue id (null when cleared); default none (React: onSelectedChange) |
| event | co-assign | function(patient, bed, room) after a patient is assigned; default none (React: onAssign) |