
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@icure/cardinal-prescription-be-react
Advanced tools
This is a Belgian-specific React application for healthcare professionals to manage electronic prescriptions with SAM. Created by iCure.
This is a Belgian-specific React library for healthcare professionals to manage electronic prescriptions.
It integrates iCure's APIs — @icure/be-fhc-lite-api
, @icure/api
, and @icure/medication-sdk
— to
streamline:
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.
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 to access its SAM and Free Health Connector (FHC) features.
Free Health Connector (FHC) The Cardinal Free Health Connector (FHC) is iCure’s open-source implementation of Belgium’s eHealth infrastructure. It enables secure, standards-based connections to government and regional healthcare systems
@icure/be-fhc-lite-api
, @icure/api
, @icure/medication-sdk
)Before starting, make sure you have:
@icure/cardinal-sdk
or via iCure
Cockpit for test purposes):
https://fhcacc.icure.cloud
, and for the production certificate, use https://fhcprd.icure.cloud
.https://api.icure.cloud
.const practitionerCredentials = {
username: 'xxx@xxx.com',
password: 'xxxxxxxxxxx',
}
const ICURE_URL = 'https://api.icure.cloud'
const FHC_URL = 'https://fhcacc.icure.cloud'
const CARDINAL_PRESCRIPTION_LANGUAGE = 'fr'
const vendor = {
vendorName: 'vendorName',
vendorEmail: 'support@test.be',
vendorPhone: '+3200000000',
}
const samPackage = {
packageName: 'test[test/1.0]-freehealth-connector',
packageVersion: '1.0]-freehealth-connector',
}
yarn add @icure/cardinal-prescription-be-react
or
npm install @icure/cardinal-prescription-be-react
Your project should use React 18+ and styled-components 6+.
Below are usage examples as seen in the latest demo app:
<PractitionerCertificate />
Handles practitioner certificate upload, decryption, and validation.
import { PractitionerCertificate } from '@icure/cardinal-prescription-be-react'
<PractitionerCertificate
certificateValid={ isCertificateValid }
certificateUploaded={ isCertificateUploaded }
errorWhileVerifyingCertificate={ errorWhileVerifyingCertificate }
onResetCertificate={ onResetCertificate }
onUploadCertificate={ onUploadCertificate }
onDecryptCertificate={ onDecryptCertificate }
/>
<MedicationSearch />
Medication search interface using SAM. Triggers an event when a medication is selected for prescription.
import { MedicationSearch } from '@icure/cardinal-prescription-be-react'
<MedicationSearch
sdk={cardinalBeSamAInstance}
deliveryEnvironment="P"
onAddPrescription={onCreatePrescription}
disableInputEventsTracking={isPrescriptionModalOpen}
/>
<PrescriptionList />
Lists created prescriptions and exposes actions to send, modify, print, or delete them.
import { PrescriptionList } from '@icure/cardinal-prescription-be-react'
<PrescriptionList
prescribedMedications={ prescriptions }
handleDeletePrescription={ onDeletePrescription }
handleModifyPrescription={ onModifyPrescription }
handleSendPrescriptions={ handleSendPrescriptions }
handlePrintPrescriptions={ handlePrintPrescriptions }
/>
<PrescriptionModal />
Modal for creating or modifying prescriptions.
<PrescriptionModal
onClose={onClosePrescriptionModal}
onSubmit={onSubmitCreatePrescription}
modalMood="create"
medicationToPrescribe={medicationToPrescribe}
/>
<PrescriptionModal
onClose={onClosePrescriptionModal}
onSubmit={onSubmitModifyPrescription}
modalMood="modify"
prescriptionToModify={prescriptionToModify}
/>
<PrescriptionPrintModal />
Printable PDF view of prescriptions.
import { PrescriptionPrintModal } from '@icure/cardinal-prescription-be-react'
import { HealthcareParty, Patient } from '@icure/be-fhc-lite-api' // types for prescriber and patient
<PrescriptionPrintModal
prescribedMedications={prescriptions}
prescriber={hcp}
patient={patient}
closeModal={onClosePrescriptionPrintModal}
/>
Alongside React components, the library exports key APIs for working directly with CardinalSDK and Free Health Connector (FHC) for authentication, and utility logic.
import { IccBesamv2Api, SamVersion, EnsembleAuthenticationProvider, NoAuthenticationProvider, IccAuthApi } from '@icure/api'
const cardinalBeSamInstance: IccBesamv2Api = new IccBesamv2Api(
ICURE_URL,
{},
new EnsembleAuthenticationProvider(
new IccAuthApi(
ICURE_URL,
{},
new NoAuthenticationProvider()
),
practitionerCredentials.username,
practitionerCredentials.password
),
)
setCardinalBeSamInstance(cardinalBeSamInstance)
import { fetchSamVersion } from '@icure/cardinal-prescription-be-react'
const samVersion = await fetchSamVersion(cardinalBeSamAInstance)
// cardinalBeSamAInstance is an instance of CardinalBeSamApi.sam (see demo)
Set the library’s language (for UI and errors):
import { cardinalLanguage } from '@icure/cardinal-prescription-be-react'
// Available: 'en', 'fr', 'nl', 'de'
cardinalLanguage.setLanguage('fr')
const currentLang = cardinalLanguage.getCurrentLanguage()
import { loadCertificateInformation } from '@icure/cardinal-prescription-be-react'
const result = await loadCertificateInformation(hcpSsin)
if (result) {
setCertificateUploaded(!!res)
}
import { uploadAndEncryptCertificate } from '@icure/cardinal-prescription-be-react'
await uploadAndEncryptCertificate(hcpSsin, passphrase, certificateArrayBuffer)
import { deleteCertificate } from '@icure/cardinal-prescription-be-react'
await deleteCertificate(hcpSsin)
import { validateDecryptedCertificate } from '@icure/cardinal-prescription-be-react'
const validation = await validateDecryptedCertificate(hcp, passphrase, FHC_URL)
if (validation.status) {
// Certificate is valid
} else {
// validation.error contains error details (per language)
}
import { sendRecipe } from '@icure/cardinal-prescription-be-react'
const result = await sendRecipe(
{
vendor, // { vendorName, vendorEmail, vendorPhone }
samPackage, // { packageName, packageVersion }
},
samVersion, // Fetched from SAM SDK
hcp, // Healthcare professional object
patient, // Patient object
prescribedMedication, // Medication details
passphrase // Certificate passphrase
FHC_URL // Free health connector url
)
// result[0]?.rid contains the prescription RID if successful
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:
More information is available on the SAM portal.
Polydexa 10 mg/ml
Crestor
Cisplatine Teva 1 mg/ml inf. sol. (conc.) i.v. vial 50 ml
Kaftrio
(black triangle)Increlex
(black/orange triangle)Ultiva
Rapifen
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.
To see the full working version, you can clone the GitHub repository and run the included demo app.
https://github.com/icure/cardinal-prescription-react/tree/main/packages/demo-app
Make sure to set up your .env variables or hardcode your credentials and HCP/Patient data for testing.
FAQs
This is a Belgian-specific React application for healthcare professionals to manage electronic prescriptions with SAM. Created by iCure.
The npm package @icure/cardinal-prescription-be-react receives a total of 1 weekly downloads. As such, @icure/cardinal-prescription-be-react popularity was classified as not popular.
We found that @icure/cardinal-prescription-be-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.