Skip to main content

BreakTheGlassDialog

ComplexAccess<co-break-the-glass-dialog>

BreakTheGlassDialog asks for a reason before opening a restricted chart and says the access is logged.

import { BreakTheGlassDialog } from 'health-components';

Examples​

Other Reason​

Storybook

Staff Chart​

Storybook

Open From Button​

Storybook

Usage​

<BreakTheGlassDialog patient="Nora Scott" dob="06/11/1999" careTeam="Mandy Harley LCSW" onConfirm={openChart} />

When to use​

  • Opening restricted charts (staff patients, behavioral health, VIP).

When not to use​

  • Normal charts.

Variants and states​

VariantWhat it is
reasonsEmergency, covering, patient asked, other with text.
confirm disabledUntil a reason is given.

Accessibility​

  • alertdialog.

Do and don't​

  • Do: Say who reviews the log.
  • Don't: Pre-select a reason.

Props​

PropTypeDefaultDescription
patient *string—Patient name. Required
dob *string—Date of birth. Required
careTeam *string—Care team members who can open the chart without a reason. Required
reasonstring"This chart contains behavioral health records. Only the care team can open it without a reason."Why the chart is restricted (Alert body)
notestringnoneInitial explanation in the "Other" box
onConfirm(access: BreakTheGlassAccess) => voidnoneCalled by "Open Chart and Log Access" with the reason and explanation
onClose() => voidnoneCalled by Cancel, the x button and Escape
openbooleantrueWhether the dialog is shown
accessReasonstringundefined (uncontrolled, nothing pre-selected)Chosen access reason (controlled)
onAccessReasonChange(reason: string) => voidnoneCalled with the chosen access reason
loadingbooleanfalseShows a spinner on the confirm button while access is logged
inlinebooleanfalseRender in place for docs: no portal, focus trap, scroll lock or Escape

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-break-the-glass-dialog>. 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-break-the-glass-dialog patient="…" dob="…" [defaultValue]="defaultValue" (co-confirm)="onConfirm($event.detail)"></co-break-the-glass-dialog>
KindNameDescription
attributepatientPatient name. Required
attributedobDate of birth. Required
attributecare-team / careTeamCare team members who can open the chart without a reason. Required
attributereasonWhy the chart is restricted (Alert body); default "This chart contains behavioral health records. Only the care team can open it without a reason."
attributenoteInitial explanation in the "Other" box; default none
attributeopenWhether the dialog is shown; default true
attributeaccess-reason / accessReasonChosen access reason (controlled); default undefined (uncontrolled, nothing pre-selected)
attributeloadingShows a spinner on the confirm button while access is logged; default false
attributeinlineRender in place for docs: no portal, focus trap, scroll lock or Escape; default false
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-confirmCalled by "Open Chart and Log Access" with the reason and explanation; default none (React: onConfirm)
eventco-closeCalled by Cancel, the x button and Escape; default none (React: onClose)
eventco-access-reason-changeCalled with the chosen access reason; default none (React: onAccessReasonChange)