DischargeChecklist
ComplexInpatient flow
<co-discharge-checklist>DischargeChecklist tracks the tasks that must be done before a patient leaves, who owns each one, and turns on Ready for Discharge only when the required ones are done.
import { DischargeChecklist } from 'health-components';
Examples
Showcase
Ready
Read Only
Usage
<DischargeChecklist patient="Okafor, Grace" edd="Today 14:00" items={tasks} onReady={sendToADT} />
When to use
- Discharge huddles, case management, nursing discharge.
When not to use
- The patient's own instructions: AfterVisitSummary.
Variants and states
| Variant | What it is |
|---|---|
| in progress | Progress bar in warning, button shows how many required items remain. |
| ready | All required done, success bar, button on. |
| auto items | Ticked from the chart and locked (signed med rec, for example). |
| readOnly | Locked. |
Accessibility
- Each task is a real checkbox with its detail as description.
- Progress bar has a text value.
Do and don't
- Do: Name an owner for every open item.
- Don't: Let staff untick an item that came from a signed chart record.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items * | DischargeItem[] | — | Array of { label, detail, required, done, auto, owner, by }: the starting list (uncontrolled); required |
itemsValue | DischargeItem[] | uncontrolled | The list (controlled); pair with onItemsChange |
onItemsChange | (items: DischargeItem[]) => void | none | Called with the new list when a task is ticked or unticked |
patient | string | none | Patient name |
edd | string | 'not set' | Expected discharge |
user | string | 'You' | Name stamped on ticks |
readOnly | boolean | false | View only |
onReady | () => void | none | Called by Ready for Discharge (enabled once every required task is done) |
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-discharge-checklist>. 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-discharge-checklist patient="…" edd="…" [items]="items" (co-items-change)="onItemsChange($event.detail)"></co-discharge-checklist>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | items | Array of { label, detail, required, done, auto, owner, by }: the starting list (uncontrolled); required |
| property / JSON attribute | items-value / itemsValue | The list (controlled); pair with onItemsChange; default uncontrolled |
| attribute | patient | Patient name; default none |
| attribute | edd | Expected discharge; default 'not set' |
| attribute | user | Name stamped on ticks; default 'You' |
| attribute | read-only / readOnly | View only; default false |
| 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-items-change | Called with the new list when a task is ticked or unticked; default none (React: onItemsChange) |
| event | co-ready | Called by Ready for Discharge (enabled once every required task is done); default none (React: onReady) |