Skip to main content

ClinicalDecisionSupportCard

ComplexChart panels<co-clinical-decision-support-card>

ClinicalDecisionSupportCard renders one CDS Hooks card: info, warning or critical indicator, summary, detail, the values behind it, suggestions to apply, links, and an override that needs a reason.

import { ClinicalDecisionSupportCard } from 'health-components';

Examples​

Showcase​

Storybook

Warning​

Storybook

Info​

Storybook

Overridden​

Storybook

Usage​

<ClinicalDecisionSupportCard card={hooksCard} onOverride={log} />

When to use​

  • Showing a CDS Hooks service response at order-select, order-sign or patient-view.

When not to use​

  • Drug-drug or allergy checks inside e-prescribing: DrugInteractionAlert.

Variants and states​

VariantWhat it is
infoBlue edge.
warningAmber edge and wash.
criticalRed edge, role alert; the override button says Override.
suggestionsRecommended suggestion is the primary button.
overridingReason select (plus free text for Other); Continue disabled until a reason is given.
accepted / overriddenCollapsed result line with the reason.

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​

  • Critical cards use role alert; others are labelled regions.
  • Values carry their flag in words and show the reference range.

Do and don't​

  • Do: Name the source of the rule.
  • Don't: Let a critical card be dismissed with no reason.

Props​

PropTypeDefaultDescription
card *CdsCard—The CDS Hooks card; required
stateCdsCardStateuncontrolledCard state (controlled): 'open' | 'accepted' | 'overridden'
defaultStateCdsCardState'open'Initial state
onStateChange(state: CdsCardState) => voidnoneCalled when the state changes
overrideReasonstring'recorded'Reason shown for an already overridden card
onOverride(reasonCode: string, text?: string) => voidnoneCalled with the reason code ('other' plus the typed text for Other) when the user overrides
onAccept(suggestion: CdsSuggestion) => voidnoneCalled with the suggestion the user applies
onLink(link: CdsLink) => voidnoneCalled when a link without `url` is clicked
feedbackbooleantrueShows 'Overrides are logged with the reason.'
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-clinical-decision-support-card>. 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-clinical-decision-support-card state="…" default-state="…" [card]="card" (co-state-change)="onStateChange($event.detail)"></co-clinical-decision-support-card>
KindNameDescription
property / JSON attributecardThe CDS Hooks card; required
attributestateCard state (controlled): 'open' | 'accepted' | 'overridden'; default uncontrolled
attributedefault-state / defaultStateInitial state; default 'open'
attributeoverride-reason / overrideReasonReason shown for an already overridden card; default 'recorded'
attributefeedbackShows 'Overrides are logged with the reason.'; default true
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-state-changeCalled when the state changes; default none (React: onStateChange)
eventco-overrideCalled with the reason code ('other' plus the typed text for Other) when the user overrides; default none (React: onOverride)
eventco-acceptCalled with the suggestion the user applies; default none (React: onAccept)
eventco-linkCalled when a link without `url` is clicked; default none (React: onLink)