HistoryPanels
<co-history-panels>HistoryPanels holds past medical, surgical, family and social history in tabs, with family history as a relative-by-relative pedigree list and social history including the social needs (SDOH) screening.
import { HistoryPanels } from 'health-components';
Examples
Showcase
Medical
Family Pedigree
Not Asked
Usage
<HistoryPanels pmh={pmh} psh={psh} family={family} social={social} defaultTab="soc" />
When to use
- Intake, annual wellness visit, new-patient history, pre-operative review.
When not to use
- Active problems: ProblemListEditor.
Variants and states
| Variant | What it is |
|---|---|
| Medical | Coded past conditions, resolved tag. |
| Surgical | Procedure, date, side, surgeon, complication. |
| Family | Relative, side, age or age at death, conditions with onset age; cause of death in red; unknown history. |
| Social and needs | Tobacco with pack-years, alcohol with AUDIT-C, then the screening table with need found, no need or declined. |
| not asked | undefined for any section: amber warning. |
| none | []: green "No ..." tag. |
Clinical values
Every number renders through CareOS.ClinicalValue and CareOS.fmt (the clinical-values builder), matched by LOINC; measures that table lacks (NT-proBNP, lactate, vancomycin trough, CrCl, PHQ-9, per-kg doses) use a local table with the same rules: tabular figures, the unit always shown, fixed decimals per measure (potassium 1, sodium 0, creatinine 2), the reference range in the title or beside it, and H, L, HH or LL flags in words for screen readers. The flag says where the number sits against the adult reference range in the rules table; it does not say the number was measured correctly.
Accessibility
- Tabs use arrow keys.
- Family history is a list, one relative per item.
- Need found is shown with icon and words.
Do and don't
- Do: Record "declined" as an answer.
- Don't: Treat a blank screening as no need.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
pmh | HistoryMedicalItem[] | undefined | Past medical history. undefined = not asked, [] = none |
psh | HistorySurgicalItem[] | undefined | Surgical history. undefined = not asked, [] = none |
family | HistoryFamilyMember[] | undefined | Family history by relative. undefined = not asked |
social | HistorySocial | undefined | Social history. undefined = not asked |
tab | HistoryTab | uncontrolled | Shown tab (controlled): 'pmh' | 'psh' | 'fam' | 'soc' |
defaultTab | HistoryTab | 'pmh' | Initial tab |
onTabChange | (tab: HistoryTab) => void | none | Called when the tab changes |
reviewed | string | none ('Not reviewed this visit') | When and by whom it was last reviewed |
readOnly | boolean | false | No Mark Reviewed and Add buttons |
onMarkReviewed | () => void | none | Called by Mark Reviewed |
onAdd | (tab: HistoryTab) => void | none | Called by Add with the shown tab |
onRefer | (item: HistorySdohItem) => void | none | Called by Refer with the SDOH domain |
title | string | 'History' | Card title |
rangeContext | RangeContextId | the global context, else 'outpatient' | 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-history-panels>. 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.
<co-history-panels tab="…" default-tab="…" [pmh]="pmh" (co-tab-change)="onTabChange($event.detail)"></co-history-panels>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | pmh | Past medical history. undefined = not asked, [] = none; default undefined |
| property / JSON attribute | psh | Surgical history. undefined = not asked, [] = none; default undefined |
| property / JSON attribute | family | Family history by relative. undefined = not asked; default undefined |
| property / JSON attribute | social | Social history. undefined = not asked; default undefined |
| attribute | tab | Shown tab (controlled): 'pmh' | 'psh' | 'fam' | 'soc'; default uncontrolled |
| attribute | default-tab / defaultTab | Initial tab; default 'pmh' |
| attribute | reviewed | When and by whom it was last reviewed; default none ('Not reviewed this visit') |
| attribute | read-only / readOnly | No Mark Reviewed and Add buttons; default false |
| attribute | title | Card title; default 'History' |
| attribute | range-context / rangeContext | Which shared reference range flags use; the lab range on a result still wins; default the global context, else 'outpatient' |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-tab-change | Called when the tab changes; default none (React: onTabChange) |
| event | co-mark-reviewed | Called by Mark Reviewed; default none (React: onMarkReviewed) |
| event | co-add | Called by Add with the shown tab; default none (React: onAdd) |
| event | co-refer | Called by Refer with the SDOH domain; default none (React: onRefer) |