Package Exports
- @icure/cardinal-prescription-be-angular
- @icure/cardinal-prescription-be-angular/package.json
Readme
Cardinal Prescription Angular Component π§πͺ
This is a Belgian-specific Angular application for healthcare professionals to manage electronic prescriptions.
It integrates iCure's APIs β @icure/be-fhc-api, @icure/cardinal-be-sam-sdk, and @icure/medication-sdk β to streamline:
- π Practitioner certificate management
- π Medication search
- π Electronic prescription creation & editing
- π§Ύ Prescription overview & sending
- π¨ Printing of prescriptions
This component is designed for integration with Belgiumβs SAM platform and can easily be embedded into other medical software projects as a drop-in feature for prescription management.
π Table of Contents
- About iCure and Cardinal
- Features
- Technologies
- Prerequisites
- Getting Started
- Available Components and How to Use Them
- Available Services and How to Use Them
- SAM and Recip-e Requirements
- Medications of Interest for Tests
- Example: Full Demo Application
π’ About iCure and Cardinal
iCure is the company that provides a secure, end-to-end encrypted backend-as-a-service for Health-Tech, allowing companies to build fully compliant medical solutions faster.
Cardinal is iCureβs backend platform that provides data management, security, and interoperability features. In this project, we do not use the Cardinal backend directly β we integrate with iCure's public API packages to access its SAM and FHC features.
β¨ Features
- π§πͺ Designed specifically for Belgian healthcare professionals
- π Practitioner certificate upload & verification
- π Medication search powered by iCure's SAM SDK
- π Create, edit, list, send, and print prescriptions
- π§ Structured and unstructured posology support
- π Interacts with Recip-e to send prescriptions
- π§© Ready to integrate into medical apps
- πΎ Secure token and certificate storage in IndexedDB
- π Fully internationalized with on-demand translation (French, Dutch, German, English)
π§° Technologies
- Angular 19.x Standalone components
- iCure SDKs (
@icure/be-fhc-api,@icure/cardinal-be-sam-sdk,@icure/medication-sdk) - RxJS for reactive data handling
- IndexedDB for token & certificate persistence
- SCSS for component styles
- TypeScript for strict typing
- ESLint + Prettier for code style & linting
- UUID.js for unique identifiers
- jsBarcode for barcode generation in printed prescriptions
βοΈ Prerequisites
Before starting, make sure you have:
- Node.js v16+ and Yarn installed
- A valid Belgian practitioner certificate file that you can load into the app
- The practitioner credentials for iCure authentication β these must be generated on your side.
You can do this inside your application using the@icure/cardinal-sdkfor a more scalable approach (we will add How-To), or via the iCure Cockpit (we recommend this only for testing purposes or for very small projects):- Create a HCP in Cockpit
- Generate the authentication token for the HCP
Once generated, you will need the HCPβs email address and the authentication token.
- The patient and healthcare professional information to populate prescriptions
π Getting started
Install the library:
yarn add cardinal-prescription-be-angularπ§© Available Components and How to Use Them
This library provides modular, standalone Angular components to integrate Belgian prescription workflows into your app.
π§Ύ <cardinal-practitioner-certificate />
Handles practitioner certificate upload, decryption, and validation.
<cardinal-practitioner-certificate
[hcp]="hcp"
[certificateUploaded]="certificateUploaded"
[certificateValid]="certificateValid"
[errorWhileVerifyingCertificate]="errorMessage"
(onUploadCertificate)="handleCertificateUpload($event)"
></cardinal-practitioner-certificate>π <cardinal-medication-search />
Displays a medication search interface using SAM. Triggers an event when a medication is selected for prescription.
<cardinal-medication-search
[deliveryEnvironment]="'P'"
(addPrescription)="onCreatePrescription($event)"
></cardinal-medication-search>π <cardinal-prescription-list />
Lists created prescriptions and exposes actions to send, modify, print, or delete them.
<cardinal-prescription-list
[prescribedMedications]="prescriptions"
[sending]="sending"
[printing]="printing"
(handleModifyPrescription)="onModify($event)"
(handleDeletePrescription)="onDelete($event)"
(sendPrescriptions)="onSend()"
(printPrescriptions)="onPrint()"
(sendAndPrintPrescriptions)="onSendAndPrint()"
></cardinal-prescription-list>π <cardinal-prescription-modal />
Modal for creating or modifying prescriptions with structured/unstructured posology.
<cardinal-prescription-modal
[modalTitle]="'New prescription'"
[medicationToPrescribe]="medication"
(handleSubmit)="onSubmit($event)"
(handleCancel)="onClose()"
></cardinal-prescription-modal>π¨ <cardinal-print-prescription-modal />
Generates a printable PDF view of one or more prescriptions.
<cardinal-print-prescription-modal
[prescribedMedications]="prescriptions"
[prescriber]="hcp"
[patient]="patient"
(onCloseModal)="onClosePrintModal()"
></cardinal-print-prescription-modal>π§ Available Services and How to Use Them
These services can be injected in your Angular components or other services to handle backend logic, certificates, and translation.
π§Ύ SamSdkService
Wraps the iCure SAM SDK. Manages SDK instance and exposes SAM search/version APIs.
constructor(private samSdkService: SamSdkService) {}
await samSdkService.setSdk(samInstance);
const version = await samSdkService.getSamVersion();π FhcService
Handles interactions with the iCure Free Health Connector (FHC) API, including certificate verification and prescription sending.
constructor(private fhcService: FhcService) {}
await fhcService.sendRecipe(samVersion, hcp, patient, prescription, passphrase, tokenStore);π UploadPractitionerCertificateService
Provides helper methods for encrypting, decrypting, saving, and validating practitioner certificates using IndexedDB.
constructor(private certService: UploadPractitionerCertificateService) {}
const db = await certService.openCertificatesDatabase();
await certService.uploadAndEncrypt(db, hcpId, passphrase, certBuffer);π TranslationService
Handles translations based on a predefined dictionary and active language. Set and get the appβs language. Supports fr - French, en - English, nl - Dutch, and de - German.
constructor(private translationService: TranslationService) {}
ngOnInit() {
this.translationService.setLanguage('fr');
const lang = this.translationService.getCurrentLanguage();
}
const label = translationService.translate('prescription.createTitle');π SAM and Recip-e requirements
When the prescriber selects a medication, this application integrates with the SAMv2 database to provide all up-to-date metadata. This includes:
Links to the leaflet & SPC.
Special status indicators:
- Black triangle (additional monitoring).
- RMA material links.
- DHPC communications.
- Temporary supply problems.
- End of commercialization or future commercialization.
- VMP group information and switch statuses.
- Conditions of delivery/prescription and risk minimization messages.
- Reimbursement details (chapters, categories, extra reimbursement for youth contraception).
More information is available on the SAM portal.
π§ͺ Medications of interest for tests
π¨ Commercialization & supply problems
Polydexa 10 mg/mlCrestorCisplatine Teva 1 mg/ml inf. sol. (conc.) i.v. vial 50 ml
π Future commercialization
Kaftrio(black triangle)Increlex(black/orange triangle)
𧬠Doping status
UltivaRapifen
β οΈ Black triangle (additional monitoring), RMA
Increlex
π‘ Note: This module is built for integration with Belgiumβs SAM platform, is modular, and can be easily adapted for use in other medical solutions.
βοΈ Example: Full Demo Application
To see the full working version, you can clone the GitHub repository and run the included demo app.
git clone https://github.com/icure/cardinal-prescription-angular
cd cardinal-prescription-angular
yarn install
ng serveMake sure to set up your .env variables or hardcode your credentials and HCP/Patient data for testing.