Skip to main content

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​

Storybook

Patient Selected​

Storybook

Read Only​

Storybook

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​

VariantWhat it is
cleanGreen edge. Ready for a patient.
dirtyAmber fill. Waiting for environmental services.
occupiedBlue edge with patient, day of stay and badges.
blockedHatched. With the reason.
pendingPurple dashed. Assigned, patient on the way.
drag targetWhile a patient is selected, beds that pass the placement check get an outline and an Assign button; others fade and say why.
rejected dropError alert with the rule that failed.
readOnlyLock 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​

PropTypeDefaultDescription
units *BedUnit[]—Array of { id, name, level, ratio, rooms: [{ id, negativePressure, beds: [{ id, status, note, patient }] }] }: the initial board (uncontrolled); required
unitsValueBedUnit[]uncontrolled from `units`The board (controlled); pair with onUnitsChange
onUnitsChange(units: BedUnit[]) => voidnoneCalled with the new board after an assignment
queueBedQueuePatient[][]Array of patients waiting for a bed { id, name, age, sex, reason, level, isolation, waiting }: the initial queue
queueValueBedQueuePatient[]uncontrolled from `queue`The queue (controlled); pair with onQueueChange
onQueueChange(queue: BedQueuePatient[]) => voidnoneCalled with the new queue after an assignment
defaultSelectedstringnoneQueue id selected at start (uncontrolled)
selectedstring | nulluncontrolledSelected queue id (controlled; null for none)
onSelectedChange(id: string | null) => voidnoneCalled with the newly selected queue id (null when cleared)
onAssign(patient: BedQueuePatient, bed: Bed, room: BedRoom) => voidnonefunction(patient, bed, room) after a patient is assigned
readOnlybooleanfalseView only: no drag, no assign
titlestring'Bed Board'Card title
subtitlestringnoneLine under the title
rangeContextRangeContextId'inpatient' when no global context is setWhich 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>
KindNameDescription
property / JSON attributeunitsArray of { id, name, level, ratio, rooms: [{ id, negativePressure, beds: [{ id, status, note, patient }] }] }: the initial board (uncontrolled); required
property / JSON attributeunits-value / unitsValueThe board (controlled); pair with onUnitsChange; default uncontrolled from `units`
property / JSON attributequeueArray of patients waiting for a bed { id, name, age, sex, reason, level, isolation, waiting }: the initial queue; default []
property / JSON attributequeue-value / queueValueThe queue (controlled); pair with onQueueChange; default uncontrolled from `queue`
attributedefault-selected / defaultSelectedQueue id selected at start (uncontrolled); default none
attributeselectedSelected queue id (controlled; null for none); default uncontrolled
attributeread-only / readOnlyView only: no drag, no assign; default false
attributetitleCard title; default 'Bed Board'
attributesubtitleLine under the title; default none
attributerange-context / rangeContextWhich shared reference range flags use; the lab range on a result still wins; default 'inpatient' when no global context is set
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-units-changeCalled with the new board after an assignment; default none (React: onUnitsChange)
eventco-queue-changeCalled with the new queue after an assignment; default none (React: onQueueChange)
eventco-selected-changeCalled with the newly selected queue id (null when cleared); default none (React: onSelectedChange)
eventco-assignfunction(patient, bed, room) after a patient is assigned; default none (React: onAssign)