This repository holds the architecture and components to enable PharmaNet electronic prescribing in British Columbia.
This project has three primary objectives:
- Migrate away from the HN-Secure private network, removing the need for proprietary HN-Client software packages.
- Add Electronic Prescribing (eRx) capabilities using HTTPS transport and modern OAuth2 authentication and authorization standards.
- Add support for HL7 FHIR editions of the HL7-v2 PharmaNet Interactions.
Every prescription dispensed in community pharmacies in B.C. is entered into PharmaNet.
PharmaNet, administered by the BC Ministry of Health, was developed in consultation with health professionals and the public to improve prescription safety and support prescription claim processing.
PharmaNet users include community pharmacies, hospital pharmacies, emergency departments, hospitals, community health practices, the College of Pharmacists of British Columbia, and the College of Physicians & Surgeons of British Columbia.
For more information about PharmaNet, see https://www2.gov.bc.ca/gov/content/health/health-drug-coverage/pharmacare-for-bc-residents/pharmanet.
The PharmaNet API is a secure, modern and RESTful interface that allows authenticated and authorized access to all interactions available with PharmaNet. With the appropriate application profile configured by the Ministry, your application can interact with PharmaNet, allowing it to perform tasks such as submitting prescriptions and PharmaCare claims electronically. This new capability removes the need for paper-based prescriptions.
The PharmaNet API does not use the HNSecure private network and its required HNClient application. It uses modern OAuth2 standards for secure, stateless, and scalable authentication and authorization. Each transaction requires a valid OAuth2 JSON Web Token, or JWT.
Examples of applications that benefit from the use of this API include:
- Pharmacy Systems
- Clinical Pharmacy Systems
- Private and Community Practice EMR Systems
The PharmaNet APIs are organized by HL7 FHIR Resource Type. Each HL7 FHIR Resource type has its own PharmaNet URI, or endpoint. The Resources support one or more transactions related to the resource type and authorized access is managed by OAuth2 scopes.
- Medication is a Medication product.
- MedicationDispense is a medication dispense event record.
- MedicationRequest is a prescription for a patient.
- MedicationStatement is medication dispense history for a patient.
In addition to the core Medication Resources, PharmaNet supports additional resources and the corresponding HL7-v2 interactions.
- Consent is a consent directive for managing the protected word.
- Claim is claims related messaging about a prescription or dispense.
- Location is location of a healthcare facility.
- Patient is information about the patient, including patient identity and demographics.
- Practitioner is information about a healthcare practitioner (e.g. a pharmacist or doctor).
The PharmaNet system supports a large number of message-based services that are based on the HL7 2.x Standard and the Canadian Pharmacists Association's Pharmacy Claim Standard. The PharmaNet R70.5 Release of PharmaNet adds HL7-v2 Interactions for electronic prescribing.
To cross-reference these HL7 version 2 interactions to the HL7 FHIR Resource URI, see Pharmanet R70 Interactions.
Each resource endpoint examines the HL7-v2 transaction type submitted and then applies a permissions check, examining the access token provided to ensure that the calling client application has obtained the correct permissions to allow the request to be processed. If it hasn't, an HTTP 4xx Error Code will be returned, without any HL7-v2 response payload. The permission scopes are based on SMART FHIR specifications.
To use the PharmaNet API, you must comply with the PharmaNet API Agreement. In addition, in order to access Production-level PharmaNet APIs, your application must pass conformance.
Information about the transactions offered by each API service and the associated HL7v2 or FHIR resources is available in the wiki. The wiki also documents the GitHub Actions workflows and the sample client application contained in this project.
Information about using Helm, Kong, the API gateway, gwa, Kibana, Red Hat Advanced Cluster Security, Sysdig, and the management of the OpenShift deployments is available at the Confluence page.