Skip to main content

HistoryPanels

ComplexChart panels<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​

Storybook

Medical​

Storybook

Family Pedigree​

Storybook

Not Asked​

Storybook

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​

VariantWhat it is
MedicalCoded past conditions, resolved tag.
SurgicalProcedure, date, side, surgeon, complication.
FamilyRelative, side, age or age at death, conditions with onset age; cause of death in red; unknown history.
Social and needsTobacco with pack-years, alcohol with AUDIT-C, then the screening table with need found, no need or declined.
not askedundefined 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​

PropTypeDefaultDescription
pmhHistoryMedicalItem[]undefinedPast medical history. undefined = not asked, [] = none
pshHistorySurgicalItem[]undefinedSurgical history. undefined = not asked, [] = none
familyHistoryFamilyMember[]undefinedFamily history by relative. undefined = not asked
socialHistorySocialundefinedSocial history. undefined = not asked
tabHistoryTabuncontrolledShown tab (controlled): 'pmh' | 'psh' | 'fam' | 'soc'
defaultTabHistoryTab'pmh'Initial tab
onTabChange(tab: HistoryTab) => voidnoneCalled when the tab changes
reviewedstringnone ('Not reviewed this visit')When and by whom it was last reviewed
readOnlybooleanfalseNo Mark Reviewed and Add buttons
onMarkReviewed() => voidnoneCalled by Mark Reviewed
onAdd(tab: HistoryTab) => voidnoneCalled by Add with the shown tab
onRefer(item: HistorySdohItem) => voidnoneCalled by Refer with the SDOH domain
titlestring'History'Card title
rangeContextRangeContextIdthe 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.

Angular template
<co-history-panels tab="…" default-tab="…" [pmh]="pmh" (co-tab-change)="onTabChange($event.detail)"></co-history-panels>
KindNameDescription
property / JSON attributepmhPast medical history. undefined = not asked, [] = none; default undefined
property / JSON attributepshSurgical history. undefined = not asked, [] = none; default undefined
property / JSON attributefamilyFamily history by relative. undefined = not asked; default undefined
property / JSON attributesocialSocial history. undefined = not asked; default undefined
attributetabShown tab (controlled): 'pmh' | 'psh' | 'fam' | 'soc'; default uncontrolled
attributedefault-tab / defaultTabInitial tab; default 'pmh'
attributereviewedWhen and by whom it was last reviewed; default none ('Not reviewed this visit')
attributeread-only / readOnlyNo Mark Reviewed and Add buttons; default false
attributetitleCard title; default 'History'
attributerange-context / rangeContextWhich shared reference range flags use; the lab range on a result still wins; default the global context, else 'outpatient'
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-tab-changeCalled when the tab changes; default none (React: onTabChange)
eventco-mark-reviewedCalled by Mark Reviewed; default none (React: onMarkReviewed)
eventco-addCalled by Add with the shown tab; default none (React: onAdd)
eventco-referCalled by Refer with the SDOH domain; default none (React: onRefer)