Skip to main content

EPCSApproval

ComplexMedications<co-epcs-approval>

EPCSApproval is the two-factor signing step for controlled-substance e-prescriptions: summary, PDMP check, PIN and token code.

import { EPCSApproval } from 'health-components';

Examples​

Pin And Done​

Storybook

Wrong Pin​

Storybook

Locked​

Storybook

Done​

Storybook

Usage​

<EPCSApproval drug="Oxycodone 5 mg" schedule="C-II" sig="..." qty={20} prescriber="Tom Reyes" dea="BR1234563" />

When to use​

  • Signing any C-II to C-V prescription.

When not to use​

  • Non-controlled prescriptions.

Variants and states​

VariantWhat it is
pinWaiting for factors.
doneSigned and sent.
lockedToo many failures.

Accessibility​

  • PIN dots announce progress.

Do and don't​

  • Do: Show the PDMP check time.
  • Don't: Store or prefill factors.

Props​

PropTypeDefaultDescription
drug *string—Drug, strength and form; required
schedule *string—DEA schedule ("C-II"); required
sig *string—Directions; required
qty *string | number—Quantity; required
prescriber *string—Prescriber name; required
dea *string—Prescriber DEA number; required
pdmpstring"Checked today 10:02 AM, no concerns"PDMP check result
pharmacystring"the pharmacy"Pharmacy, in the done message
auditstring"000123"Audit record number, in the done message
stateEPCSState'pin''pin' (waiting for factors) | 'done' (signed and sent) | 'locked' (too many failures)
pinstringundefined (uncontrolled, starts empty: never prefill factors)Signing PIN (controlled)
onPinChange(pin: string) => voidnoneCalled as PIN digits are entered or deleted
codestringundefined (uncontrolled, starts empty)One-time token code (controlled)
onCodeChange(code: string) => voidnoneCalled as the token code changes
errorstringnoneError under the PIN dots ("Wrong PIN. 2 tries left.")
onSign(factors: EPCSFactors) => voidnoneSign and Send clicked with both factors complete

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-epcs-approval>. 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-epcs-approval drug="…" schedule="…" [qty]="qty" (co-pin-change)="onPinChange($event.detail)"></co-epcs-approval>
KindNameDescription
attributedrugDrug, strength and form; required
attributescheduleDEA schedule ("C-II"); required
attributesigDirections; required
property / JSON attributeqtyQuantity; required
attributeprescriberPrescriber name; required
attributedeaPrescriber DEA number; required
attributepdmpPDMP check result; default "Checked today 10:02 AM, no concerns"
attributepharmacyPharmacy, in the done message; default "the pharmacy"
attributeauditAudit record number, in the done message; default "000123"
attributestate'pin' (waiting for factors) | 'done' (signed and sent) | 'locked' (too many failures); default 'pin'
attributepinSigning PIN (controlled); default undefined (uncontrolled, starts empty: never prefill factors)
attributecodeOne-time token code (controlled); default undefined (uncontrolled, starts empty)
attributeerrorError under the PIN dots ("Wrong PIN. 2 tries left."); default none
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-pin-changeCalled as PIN digits are entered or deleted; default none (React: onPinChange)
eventco-code-changeCalled as the token code changes; default none (React: onCodeChange)
eventco-signSign and Send clicked with both factors complete; default none (React: onSign)