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
Duplicate
Reason Chosen
Not Overridable
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
| Variant | What it is |
|---|---|
| interaction / duplicate / allergy | Title prefix. |
| severity | severe and contraindicated are red, others amber. |
| overridable false | No 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
| Prop | Type | Default | Description |
|---|---|---|---|
kind | DrugAlertKind | 'interaction' | 'interaction' | 'duplicate' | 'allergy': sets the title prefix |
title * | string | — | The drugs involved ("Sertraline + Tramadol"); required |
body * | string | — | What the risk is; required |
severity | DrugAlertSeverity | 'moderate' | 'contraindicated' | 'severe' | 'moderate'; contraindicated and severe are red, moderate amber |
source | string | none | Knowledge base ("First Databank") |
overridable | boolean | true | false: no override, the prescriber must choose another drug |
reasons | string[] | drugAlertOverrideReasons | Override reasons |
reason | string | undefined (uncontrolled) | Chosen override reason (controlled) |
defaultReason | string | "" | Initial override reason (uncontrolled) |
onReasonChange | (reason: string) => void | none | Called when the override reason changes |
onOverride | (reason: string) => void | none | Override and Continue clicked, with the reason |
onChangeOrder | () => void | none | Change 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>
| Kind | Name | Description |
|---|---|---|
| attribute | kind | 'interaction' | 'duplicate' | 'allergy': sets the title prefix; default 'interaction' |
| attribute | title | The drugs involved ("Sertraline + Tramadol"); required |
| attribute | body | What the risk is; required |
| attribute | severity | 'contraindicated' | 'severe' | 'moderate'; contraindicated and severe are red, moderate amber; default 'moderate' |
| attribute | source | Knowledge base ("First Databank"); default none |
| attribute | overridable | false: no override, the prescriber must choose another drug; default true |
| property / JSON attribute | reasons | Override reasons; default drugAlertOverrideReasons |
| attribute | reason | Chosen override reason (controlled); default undefined (uncontrolled) |
| attribute | default-reason / defaultReason | Initial override reason (uncontrolled); default "" |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-reason-change | Called when the override reason changes; default none (React: onReasonChange) |
| event | co-override | Override and Continue clicked, with the reason; default none (React: onOverride) |
| event | co-change-order | Change Order clicked; default none (React: onChangeOrder) |