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
Staff Chart
Open From Button
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
| Variant | What it is |
|---|---|
| reasons | Emergency, covering, patient asked, other with text. |
| confirm disabled | Until a reason is given. |
Accessibility
- alertdialog.
Do and don't
- Do: Say who reviews the log.
- Don't: Pre-select a reason.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
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 |
reason | string | "This chart contains behavioral health records. Only the care team can open it without a reason." | Why the chart is restricted (Alert body) |
note | string | none | Initial explanation in the "Other" box |
onConfirm | (access: BreakTheGlassAccess) => void | none | Called by "Open Chart and Log Access" with the reason and explanation |
onClose | () => void | none | Called by Cancel, the x button and Escape |
open | boolean | true | Whether the dialog is shown |
accessReason | string | undefined (uncontrolled, nothing pre-selected) | Chosen access reason (controlled) |
onAccessReasonChange | (reason: string) => void | none | Called with the chosen access reason |
loading | boolean | false | Shows a spinner on the confirm button while access is logged |
inline | boolean | false | Render 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>
| Kind | Name | Description |
|---|---|---|
| attribute | patient | Patient name. Required |
| attribute | dob | Date of birth. Required |
| attribute | care-team / careTeam | Care team members who can open the chart without a reason. Required |
| attribute | reason | Why the chart is restricted (Alert body); default "This chart contains behavioral health records. Only the care team can open it without a reason." |
| attribute | note | Initial explanation in the "Other" box; default none |
| attribute | open | Whether the dialog is shown; default true |
| attribute | access-reason / accessReason | Chosen access reason (controlled); default undefined (uncontrolled, nothing pre-selected) |
| attribute | loading | Shows a spinner on the confirm button while access is logged; default false |
| attribute | inline | Render in place for docs: no portal, focus trap, scroll lock or Escape; default false |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-confirm | Called by "Open Chart and Log Access" with the reason and explanation; default none (React: onConfirm) |
| event | co-close | Called by Cancel, the x button and Escape; default none (React: onClose) |
| event | co-access-reason-change | Called with the chosen access reason; default none (React: onAccessReasonChange) |