Flowsheet
ComplexInpatient nursing
<co-flowsheet>Flowsheet is the nurse charting grid: measures down the side, times across the top, with add column, edit in place, abnormal shading, collapsible groups and a graph view.
import { Flowsheet } from 'health-components';
Examples
Sepsis Watch
Editing Collapsed
Graph View
Read Only
Usage
<Flowsheet title="Vitals and I&O" columns={cols} rows={rows} nowColumn="c6" nextTime={c => '16:00'} onChange={save} />
When to use
- Hourly or q4h vitals, neuro checks, drips and I&O on an inpatient or ICU unit.
- Any repeated measure where the nurse needs to compare across time.
When not to use
- One set of vitals at a clinic visit: VitalsPanel.
- Lab results with reference columns: LabResultTable.
Variants and states
| Variant | What it is |
|---|---|
| grid | Default. Rows grouped (Vitals, Neuro, Drips, I&O); select a cell to edit, Enter saves, Esc cancels. |
| graph | One small trend chart per numeric row, normal band shaded green, abnormal points coloured. |
| abnormal | Amber cell plus H or L flag; critical is red cell plus HH or LL. |
| collapsed group | Group header keeps a count of abnormal values inside. |
| new column | Add column appends the next charting time. |
| readOnly | View only badge; cells are not buttons. |
Accessibility
- Real table with caption, row headers and column headers; sticky first column.
- Each cell is a button named "Edit Heart rate at 12:00, now 118 bpm".
- Flags are letters plus words for screen readers; colour is never the only signal.
- Graph view has an aria-label listing every value.
Do and don't
- Do: Pass the patient's own range (for example a COPD SpO2 target) through
rangeon the row. - Don't: Hide abnormal rows inside a collapsed group without the count.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
rows * | FlowsheetRow[] | — | Measures down the side; required |
columns * | FlowsheetColumn[] | — | Charting times across the top; required |
nowColumn | string | none | Id of the current column (marked with a left rule) |
nextTime | (columns: FlowsheetColumn[]) => string | 'New' | Label for an added column, from the current columns |
view | FlowsheetView | — | Controlled view: 'grid' | 'graph' |
defaultView | FlowsheetView | 'grid' | Initial view (uncontrolled) |
onViewChange | (view: FlowsheetView) => void | — | Called when the view changes |
defaultCollapsed | string[] | [] | Initially collapsed group names |
defaultEditing | string | none | Cell open for editing at first, as 'rowId|colId' |
readOnly | boolean | false | View only: no editing, no Add column |
onChange | (rowId: string, colId: string, value: string) => void | — | Called when a cell is saved |
onAddColumn | (column: FlowsheetColumn) => void | — | Called when a column is added |
title | string | 'Flowsheet' | Card title |
subtitle | string | none | Patient and unit line |
maxHeight | number | none | Scroll height of the grid in px |
rangeContext | RangeContextId | 'inpatient' when no global context is set | Which shared reference range flags use; a row's own range still wins |
Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, onInput, plus className and event handlers on the root element.
Angular, Vue and HTML
Register the elements once (Angular guide), then use <co-flowsheet>. 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-flowsheet now-column="…" view="…" [rows]="rows" (co-view-change)="onViewChange($event.detail)"></co-flowsheet>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | rows | Measures down the side; required |
| property / JSON attribute | columns | Charting times across the top; required |
| attribute | now-column / nowColumn | Id of the current column (marked with a left rule); default none |
| attribute | view | Controlled view: 'grid' | 'graph' |
| attribute | default-view / defaultView | Initial view (uncontrolled); default 'grid' |
| property / JSON attribute | default-collapsed / defaultCollapsed | Initially collapsed group names; default [] |
| attribute | default-editing / defaultEditing | Cell open for editing at first, as 'rowId|colId'; default none |
| attribute | read-only / readOnly | View only: no editing, no Add column; default false |
| attribute | title | Card title; default 'Flowsheet' |
| attribute | subtitle | Patient and unit line; default none |
| attribute | max-height / maxHeight | Scroll height of the grid in px; default none |
| attribute | range-context / rangeContext | Which shared reference range flags use; a row's own range still wins; default 'inpatient' when no global context is set |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| property (function) | nextTime | Label for an added column, from the current columns; default 'New' |
| event | co-view-change | Called when the view changes (React: onViewChange) |
| event | co-change | Called when a cell is saved (React: onChange) |
| event | co-add-column | Called when a column is added (React: onAddColumn) |
| event | co-input | (React: onInput) |