Skip to main content

DrugInteractionAlert

ComplexMedications<co-drug-interaction-alert>

DrugInteractionAlert (and AllergyAlert) stops an order for an interaction, duplicate or allergy and asks for an override reason or a change.

import { DrugInteractionAlert } from 'health-components';

Examples​

Interaction And Allergy​

Storybook

Duplicate​

Storybook

Reason Chosen​

Storybook

Not Overridable​

Storybook

Usage​

<DrugInteractionAlert title="Sertraline + Tramadol" body="Serotonin syndrome risk." severity="severe" />
<AllergyAlert title="Amoxicillin" body="Patient allergic to penicillin (anaphylaxis)." severity="contraindicated" />

When to use​

  • At order signing when a check fires.

When not to use​

  • General warnings: Alert.

Variants and states​

VariantWhat it is
interaction / duplicate / allergyTitle prefix.
severitysevere and contraindicated are red, others amber.
overridable falseNo override possible.

Accessibility​

  • Override needs a reason; button stays disabled until chosen.

Do and don't​

  • Do: Name the source (First Databank).
  • Don't: Allow silent overrides.

Props​

PropTypeDefaultDescription
kindDrugAlertKind'interaction''interaction' | 'duplicate' | 'allergy': sets the title prefix
title *string—The drugs involved ("Sertraline + Tramadol"); required
body *string—What the risk is; required
severityDrugAlertSeverity'moderate''contraindicated' | 'severe' | 'moderate'; contraindicated and severe are red, moderate amber
sourcestringnoneKnowledge base ("First Databank")
overridablebooleantruefalse: no override, the prescriber must choose another drug
reasonsstring[]drugAlertOverrideReasonsOverride reasons
reasonstringundefined (uncontrolled)Chosen override reason (controlled)
defaultReasonstring""Initial override reason (uncontrolled)
onReasonChange(reason: string) => voidnoneCalled when the override reason changes
onOverride(reason: string) => voidnoneOverride and Continue clicked, with the reason
onChangeOrder() => voidnoneChange Order clicked

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-drug-interaction-alert>. 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-drug-interaction-alert kind="…" title="…" [reasons]="reasons" (co-reason-change)="onReasonChange($event.detail)"></co-drug-interaction-alert>
KindNameDescription
attributekind'interaction' | 'duplicate' | 'allergy': sets the title prefix; default 'interaction'
attributetitleThe drugs involved ("Sertraline + Tramadol"); required
attributebodyWhat the risk is; required
attributeseverity'contraindicated' | 'severe' | 'moderate'; contraindicated and severe are red, moderate amber; default 'moderate'
attributesourceKnowledge base ("First Databank"); default none
attributeoverridablefalse: no override, the prescriber must choose another drug; default true
property / JSON attributereasonsOverride reasons; default drugAlertOverrideReasons
attributereasonChosen override reason (controlled); default undefined (uncontrolled)
attributedefault-reason / defaultReasonInitial override reason (uncontrolled); default ""
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-reason-changeCalled when the override reason changes; default none (React: onReasonChange)
eventco-overrideOverride and Continue clicked, with the reason; default none (React: onOverride)
eventco-change-orderChange Order clicked; default none (React: onChangeOrder)