Enable EPCS
After this setup, a prescriber can mark a controlled prescription ready to sign and sign it only while they hold the EPCS prescribing permission at the prescription's location. Prescribing Controlled Substances lists every check the module runs for these two steps.
Configure the Module
- Set
EPCS_MODEtofull. With the defaultdisabled, the module refuses controlled prescriptions. - Set
EPCS_PROOF_SECRETto a random 64-character string (for example, the output ofopenssl rand -hex 32). The module uses it to detect a change to a controlled prescription between marking it ready to sign and signing it. Changing the secret invalidates existing ready-to-sign proofs. - Open
App/ePrescription-appin the Aidbox console (/ui/console#/entities/App) and checkendpoint.secret. If it is empty or stillPUT_ENDPOINT_SECRET_HERE, set it to a separate random 64-character string (for example, the output ofopenssl rand -hex 32) and save the App. - Copy the current value of
endpoint.secretand setAIDBOX_RPC_CREDENTIALSto the Base64 encoding ofePrescription-app:<endpoint.secret>, substituting the copied value for<endpoint.secret>. The module uses this credential to authenticate every call from Aidbox. - Restart the module.
Configure User Authentication and Access Policies
- Configure your EHR to use the signed-in user's Aidbox credentials for the operations listed below.
The module requires an acting user for these operations. A
Clientcredential alone does not identify one. - Write AccessPolicies that let your users call these operations:
POST /e-prescription/rx/ready-to-sign, which marks a prescription ready to signPOST /e-prescription/rx/new,POST /e-prescription/rx/respond-to-renewal, andPOST /e-prescription/rx/respond-to-change, which sign prescriptions- the EPCS access operations that Configure Access Policies lists
Appoint the Access Managers
Each location where practitioners prescribe controlled substances needs an administrator and an approver who are different users:
- Appoint the administrator with Bootstrap the First Administrator.
- Ask the administrator to nominate the approver with an access-change request.
- Ask the nominee to accept the request as the first approver.
- Check that Location Compliance Status returns
compliant: truefor the location.
Grant the Prescribing Permission
For each practitioner who prescribes controlled substances, at each location where they do:
- Prepare their
User,Practitioner,PractitionerRole, andLocationas Prescribing Controlled Substances describes. - Add a DEA number to the
PractitionerRole, as DEA Qualification describes. - Ask the administrator to create a prescribing nomination for the practitioner.
- Ask an approver other than the nominating administrator to give second-person approval before it expires.
- Signed in as the practitioner, check that
GET /e-prescription/access/epcs/permissions/minereturnsepcs-prescribingat the location.
Verify the Setup
Sign in as a practitioner who holds the permission, mark one of their controlled prescriptions ready to sign, and sign it. If the module rejects a step:
401: check that the EHR uses the signed-in user's credentials. If every call from Aidbox returns401, checkAIDBOX_RPC_CREDENTIALSin Configure the Module.403: the call failed another check in Prescribing Controlled Substances.