UNPKG

@icure/cardinal-prescription-be-react

Version:

This is a Belgian-specific React application for healthcare professionals to manage electronic prescriptions with SAM. Created by iCure.

1,291 lines (1,274 loc) 256 kB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts var index_exports = {}; __export(index_exports, { IndexedDbServiceStore: () => IndexedDbServiceStore, MedicationSearch: () => MedicationSearch, PaginatedListIterator: () => PaginatedListIterator, PractitionerCertificate: () => PractitionerCertificate, PrescriptionList: () => PrescriptionList, PrescriptionModal: () => PrescriptionModal, PrescriptionPrintModal: () => PrescriptionPrintModal, cardinalLanguage: () => cardinalLanguage, createFhcCode: () => createFhcCode, deleteCertificate: () => deleteCertificate, fetchSamVersion: () => fetchSamVersion, findMedicationsByLabel: () => findMedicationsByLabel, getSamTextTranslation: () => getSamTextTranslation, loadAndDecryptCertificate: () => loadAndDecryptCertificate, loadCertificateInformation: () => loadCertificateInformation, sendRecipe: () => sendRecipe, t: () => t, uploadAndEncryptCertificate: () => uploadAndEncryptCertificate, validateDecryptedCertificate: () => validateDecryptedCertificate, verifyCertificateWithSts: () => verifyCertificateWithSts }); module.exports = __toCommonJS(index_exports); // src/services/i18n/translations/components/home.translations.ts var homeTranslations = { fr: { samVersionLabel: "Version Sam :" }, en: { samVersionLabel: "Sam version:" }, nl: { samVersionLabel: "Sam-versie:" }, de: { samVersionLabel: "Sam-version:" } }; // src/services/i18n/translations/components/prescription.translations.ts var prescriptionTranslations = { fr: { createTitle: "Cr\xE9er la prescription", modifyTitle: "Modifier la prescription", pdf: { title: "PREUVE DE PRESCRIPTION ELECTRONIQUE", instructions: "Veuillez pr\xE9senter ce document \xE0 votre pharmacien pour scanner le code-barres et vous d\xE9livrer les m\xE9dicaments prescrits.", options: { title: "De quelles options disposez-vous pour vous rendre \xE0 la pharmacie si vous avez perdu ce document ?", option1: "Via Masant\xE9.be - MyHealthViewer - App MesM\xE9dicaments ou toute autre App, vous pouvez montrer votre prescription au pharmacien, qui lira le code-barres.", option2: "Vous pouvez \xE9galement aller chercher les produits prescrits avec votre eID (ou votre num\xE9ro de registre national si votre eID a \xE9t\xE9 lue par le pharmacien qui vous d\xE9livre les produits dans les 15 mois pr\xE9c\xE9dents)." }, prescriber: "Prescripteur", patient: "B\xE9n\xE9ficiaire", electronicContent: "Contenu de la prescription \xE9lectronique:", product: "Produit:", dosage: "Posologie:", date: "Date:", validUntil: "Date de fin pour l'ex\xE9cution:" }, list: { sentTitle: "Ordonnances envoy\xE9es:", pendingTitle: "Ordonnances en attente:", print: "Imprimer", send: "Envoyer", sendAndPrint: "Envoyer et imprimer" }, form: { medicationTitle: "Nom du groupe DCI", dosage: "Posologie", duration: "Dur\xE9e (nombre d\u2019unit\xE9s)", durationTimeUnit: "Unit\xE9 de temps", treatmentStartDate: "Date d\xE9but du traitement", executableUntil: "Ex\xE9cutable jusqu`au", prescriptionsNumber: "Nombre de prescriptions", periodicityTimeUnit: "P\xE9riodicit\xE9", periodicityDaysNumber: "Nombre de jours", substitutionAllowed: "Substitution autoris\xE9e", substitutionYes: "Oui", substitutionNo: "Non", toggleExtraFields: "Afficher plus", patientInstructions: "Instructions pour le patient", reimbursementInstructions: "Instructions remboursement", prescriberVisibility: "Visibilit\xE9 prescripteur", pharmacistVisibility: "Visibilit\xE9 officine", cancel: "Annuler", submit: "Soumettre", fieldRequired: "Ce champ est requis", fieldInvalid: "Champ invalide", instructionLabelNone: "Aucun" } }, en: { createTitle: "Create prescription", modifyTitle: "Modify prescription", pdf: { title: "PROOF OF ELECTRONIC PRESCRIPTION", instructions: "Please present this document to your pharmacist to scan the barcode and dispense the prescribed medication.", options: { title: "What are your options if you lost this document?", option1: "Via Masant\xE9.be - MyHealthViewer - MyMeds App or any other app, you can show your prescription to the pharmacist who will scan the barcode.", option2: "You can also collect the prescribed products with your eID (or your national register number if your eID was read by the pharmacist who dispenses the products within the last 15 months)." }, prescriber: "Prescriber", patient: "Beneficiary", electronicContent: "Electronic prescription content:", product: "Product:", dosage: "Dosage:", date: "Date:", validUntil: "Valid until:" }, list: { sentTitle: "Sent prescriptions:", pendingTitle: "Pending prescriptions:", print: "Print", send: "Send", sendAndPrint: "Send and print" }, form: { medicationTitle: "DCI group name", dosage: "Dosage", duration: "Duration (number of units)", durationTimeUnit: "Time unit", treatmentStartDate: "Start date of treatment", executableUntil: "Executable until", prescriptionsNumber: "Number of prescriptions", periodicityTimeUnit: "Periodicity", periodicityDaysNumber: "Number of days", substitutionAllowed: "Substitution allowed", substitutionYes: "Yes", substitutionNo: "No", toggleExtraFields: "Show more", patientInstructions: "Instructions for the patient", reimbursementInstructions: "Reimbursement instructions", prescriberVisibility: "Prescriber visibility", pharmacistVisibility: "Pharmacist visibility", cancel: "Cancel", submit: "Submit", fieldRequired: "This field is required", fieldInvalid: "Invalid field", instructionLabelNone: "None" } }, nl: { createTitle: "Voorschrift aanmaken", modifyTitle: "Voorschrift bewerken", pdf: { title: "BEWIJS VAN ELEKTRONISCH VOORSCHRIFT", instructions: "Gelieve dit document aan uw apotheker te tonen zodat hij/zij de barcode kan scannen en de voorgeschreven geneesmiddelen kan afleveren.", options: { title: "Welke opties hebt u om naar de apotheek te gaan als u dit document bent verloren?", option1: "Via Masant\xE9.be - MyHealthViewer - MijnGeneesmiddelen-app of een andere app, kunt u uw voorschrift tonen aan de apotheker, die de barcode zal scannen.", option2: "U kunt de voorgeschreven producten ook afhalen met uw eID (of uw rijksregisternummer als uw eID werd uitgelezen door de apotheker die de producten aflevert binnen de laatste 15 maanden)." }, prescriber: "Voorschrijver", patient: "Begunstigde", electronicContent: "Inhoud van het elektronisch voorschrift:", product: "Product:", dosage: "Dosering:", date: "Datum:", validUntil: "Uitvoerbaar tot:" }, list: { sentTitle: "Verzonden voorschriften:", pendingTitle: "Voorschriften in afwachting:", print: "Afdrukken", send: "Verzenden", sendAndPrint: "Verzenden en afdrukken" }, form: { medicationTitle: "Naam van DCI-groep", dosage: "Dosering", duration: "Duur (aantal eenheden)", durationTimeUnit: "Tijdseenheid", treatmentStartDate: "Startdatum van behandeling", executableUntil: "Uitvoerbaar tot", prescriptionsNumber: "Aantal voorschriften", periodicityTimeUnit: "Periodiciteit", periodicityDaysNumber: "Aantal dagen", substitutionAllowed: "Vervanging toegestaan", substitutionYes: "Ja", substitutionNo: "Nee", toggleExtraFields: "Meer weergeven", patientInstructions: "Instructies voor de pati\xEBnt", reimbursementInstructions: "Instructies voor terugbetaling", prescriberVisibility: "Zichtbaarheid voor de voorschrijver", pharmacistVisibility: "Zichtbaarheid voor de apotheker", cancel: "Annuleren", submit: "Indienen", fieldRequired: "Dit veld is verplicht", fieldInvalid: "Ongeldig veld", instructionLabelNone: "Geen" } }, de: { createTitle: "Rezept erstellen", modifyTitle: "Rezept bearbeiten", pdf: { title: "NACHWEIS DES ELEKTRONISCHEN REZEPTS", instructions: "Bitte legen Sie dieses Dokument Ihrem Apotheker vor, damit er den Barcode scannen und die verschriebenen Medikamente abgeben kann.", options: { title: "Welche M\xF6glichkeiten haben Sie, wenn Sie dieses Dokument verloren haben?", option1: "\xDCber Masant\xE9.be \u2013 MyHealthViewer \u2013 MeineMedikamente-App oder eine andere App k\xF6nnen Sie Ihr Rezept dem Apotheker zeigen, der den Barcode scannt.", option2: "Sie k\xF6nnen die verschriebenen Produkte auch mit Ihrem eID (oder Ihrer nationalen Registernummer, falls Ihre eID vom Apotheker, der Ihnen in den letzten 15 Monaten Produkte ausgeh\xE4ndigt hat, gelesen wurde) abholen." }, prescriber: "Verschreiber", patient: "Empf\xE4nger", electronicContent: "Inhalt des elektronischen Rezepts:", product: "Produkt:", dosage: "Dosierung:", date: "Datum:", validUntil: "G\xFCltig bis:" }, list: { sentTitle: "Versendete Rezepte:", pendingTitle: "Ausstehende Rezepte:", print: "Drucken", send: "Senden", sendAndPrint: "Senden und drucken" }, form: { medicationTitle: "Name der DCI-Gruppe", dosage: "Dosierung", duration: "Dauer (Anzahl der Einheiten)", durationTimeUnit: "Zeiteinheit", treatmentStartDate: "Behandlungsbeginn", executableUntil: "Ausf\xFChrbar bis", prescriptionsNumber: "Anzahl der Rezepte", periodicityTimeUnit: "Periodizit\xE4t", periodicityDaysNumber: "Anzahl der Tage", substitutionAllowed: "Substitution erlaubt", substitutionYes: "Ja", substitutionNo: "Nein", toggleExtraFields: "Mehr anzeigen", patientInstructions: "Anweisungen f\xFCr den Patienten", reimbursementInstructions: "Anweisungen zur Erstattung", prescriberVisibility: "Sichtbarkeit f\xFCr den Verschreiber", pharmacistVisibility: "Sichtbarkeit f\xFCr den Apotheker", cancel: "Abbrechen", submit: "Absenden", fieldRequired: "Dieses Feld ist erforderlich", fieldInvalid: "Ung\xFCltiges Feld", instructionLabelNone: "Keine" } } }; // src/services/i18n/translations/components/medication.translations.ts var medicationTranslations = { fr: { drugType: { medication: "M\xE9dicament", molecule: "Mol\xE9cule", homologation: "Homologation" }, drugInfographic: { blackTriangle: "Pharmacovigilance renforc\xE9e (Triangle noir)", rma: "Activit\xE9s additionnelles de minimisation des risques ou additional RMA (Risk Minimisation Activities) (Source: AFMPS)", genericPrescriptionRequired: "Ordonnance g\xE9n\xE9rique requise" }, drugSpecialRegulation: { noNarcoticRegulation: "Aucun stup\xE9fiant, m\xE9dicament soumis \xE0 r\xE9glementation particuli\xE8re", narcoticRegulation: "Stup\xE9fiant, m\xE9dicament soumis \xE0 r\xE9glementation particuli\xE8re", noSpecialRegulation: "Aucune r\xE9glementation particuli\xE8re" }, supply: { issueTitle: "Probl\xE8me d'approvisionnement temporaire :", startDate: "Disponibilit\xE9 limit\xE9e depuis :", expectedEndDate: "Date de fin pr\xE9sum\xE9e :", reason: "Raison :", impact: "Impact :", prescriberNote: "D\xE9claration du prescripteur :", downloadPdf: "T\xE9l\xE9charger le document en .pdf", extraInfo: "Informations compl\xE9mentaires :" }, commercialization: { end: "Fin de commercialisation :", limitedAvailabilityFrom: "Disponibilit\xE9 limit\xE9e \xE0 partir de :", unavailableFrom: "Indisponible \xE0 partir de :", endReason: "Raison :", endImpact: "Impact :", endAdditionalInformation: "Informations compl\xE9mentaires :", start: "D\xE9but de commercialisation :", startAvailableFrom: "Disponible depuis :" }, reimbursement: { title: "Remboursement :", category: "Cat\xE9gorie de remboursement :", categoryLabel: "Sp\xE9cification de la cat\xE9gorie de remboursement :", copay: "Ticket mod\xE9rateur type", copayPreferential: " Pr\xE9f\xE9rentiel :", copayActive: " Actif :", temporary: "Remboursement temporaire (art. 111) :", chapter: "Chapitre :", noneTitle: "Conditions de prescription", notApplicable: "Non applicable", non: "Non" }, delivery: { title: "Conditions de livraison :", code: "Code de livraison :", modus: "Mode de livraison :", specification: "Sp\xE9cification de livraison :", notApplicable: "Non applicable" }, prescription: { title: "Conditions de prescription :", code: "Code de prescription :", specification: "Sp\xE9cification de prescription :", free: "Libre de prescription" }, vmp: { label: "VMP :", groupLabel: "Groupe VMP :" }, links: { cbip: "R\xE9pertoire comment\xE9 des m\xE9dicaments (CBIP)", leaflet: "Notice pour le patient", rma: "Activit\xE9s de r\xE9duction des risques (RMA)", spc: "R\xE9sum\xE9 des caract\xE9ristiques du produit (RCP)", dhpc: "Communication directe aux professionnels de sant\xE9 (DHPC)" }, ui: { price: "Prix :" }, search: { label: "Trouver un m\xE9dicament", errorMessage: " Entrez au moins 3 lettres du nom du m\xE9dicament" } }, en: { drugType: { medication: "Medication", molecule: "Molecule", homologation: "Homologation" }, drugInfographic: { blackTriangle: "Enhanced pharmacovigilance (Black triangle)", rma: "Additional risk minimisation activities or additional RMA (Risk Minimisation Activities) (Source: FAMHP)", genericPrescriptionRequired: "Generic prescription required" }, drugSpecialRegulation: { noNarcoticRegulation: "No narcotic, specially regulated drug", narcoticRegulation: "Narcotic, specially regulated drug", noSpecialRegulation: "No special regulation" }, supply: { issueTitle: "Temporary supply problem:", startDate: "Limited availability since:", expectedEndDate: "Presumed end date:", reason: "Reason:", impact: "Impact:", prescriberNote: "Prescriber declaration:", downloadPdf: "Download the document (.pdf)", extraInfo: "Additional information:" }, commercialization: { end: "End of commercialisation:", limitedAvailabilityFrom: "Limited availability from:", unavailableFrom: "Unavailable from:", endReason: "Reason:", endImpact: "Impact:", endAdditionalInformation: "Additional information:", start: "Start of commercialisation:", startAvailableFrom: "Available from:" }, reimbursement: { title: "Reimbursement:", category: "Reimbursement category:", categoryLabel: "Reimbursement category specification:", copay: "Co-payment type", copayPreferential: "Preferential:", copayActive: "Active:", temporary: "Temporary reimbursement (art. 111):", chapter: "Chapter:", noneTitle: "Prescription conditions", notApplicable: "Not applicable", non: "No" }, delivery: { title: "Delivery conditions:", code: "Delivery code:", modus: "Delivery method:", specification: "Delivery specification:", notApplicable: "Not applicable" }, prescription: { title: "Prescription conditions:", code: "Prescription code:", specification: "Prescription specification:", free: "Free of prescription" }, vmp: { label: "VMP:", groupLabel: "VMP-group:" }, links: { cbip: "Commented Medicines Directory (CBIP)", leaflet: "Patient information leaflet", rma: "Risk Minimisation Activities (RMA)", spc: "Summary of Product Characteristics (SPC)", dhpc: "Direct Healthcare Professional Communication (DHPC)" }, ui: { price: "Price:" }, search: { label: "Find a medication", errorMessage: "Enter at least 3 letters of the medication name" } }, nl: { drugType: { medication: "Geneesmiddel", molecule: "Molecule", homologation: "Homologatie" }, drugInfographic: { blackTriangle: "Verhoogde waakzaamheid (Zwarte driehoek)", rma: "Aanvullende risicobeperkende maatregelen (RMA) (Bron: FAGG)", genericPrescriptionRequired: "Generiek voorschrift vereist" }, drugSpecialRegulation: { noNarcoticRegulation: "Geen verdovend middel, geneesmiddel onderworpen aan specifieke regelgeving", narcoticRegulation: "Verdovend middel, geneesmiddel onderworpen aan specifieke regelgeving", noSpecialRegulation: "Geen specifieke regelgeving" }, supply: { issueTitle: "Tijdelijk bevoorradingsprobleem:", startDate: "Beperkte beschikbaarheid sinds:", expectedEndDate: "Verwachte einddatum:", reason: "Reden:", impact: "Impact:", prescriberNote: "Verklaring van de voorschrijver:", downloadPdf: "Download het document (.pdf)", extraInfo: "Aanvullende informatie:" }, commercialization: { end: "Einde van commercialisering:", limitedAvailabilityFrom: "Beperkte beschikbaarheid vanaf:", unavailableFrom: "Niet beschikbaar vanaf:", endReason: "Reden:", endImpact: "Impact:", endAdditionalInformation: "Aanvullende informatie:", start: "Start van commercialisering:", startAvailableFrom: "Beschikbaar sinds:" }, reimbursement: { title: "Terugbetaling:", category: "Terugbetalingscategorie:", categoryLabel: "Specificatie van de terugbetalingscategorie:", copay: "Soort remgeld", copayPreferential: "Voorkeurtarief:", copayActive: "Actief:", temporary: "Tijdelijke terugbetaling (art. 111):", chapter: "Hoofdstuk:", noneTitle: "Voorschrijfvoorwaarden", notApplicable: "Niet van toepassing", non: "Nee" }, delivery: { title: "Aflevervoorwaarden:", code: "Aflevercode:", modus: "Afleverwijze:", specification: "Specificatie van aflevering:", notApplicable: "Niet van toepassing" }, prescription: { title: "Voorschrijfvoorwaarden:", code: "Voorschrijfcode:", specification: "Specificatie van voorschrift:", free: "Vrij voorschrijfbaar" }, vmp: { label: "VMP:", groupLabel: "VMP-groep:" }, links: { cbip: "Gecommentarieerde geneesmiddelenrepertorium (CBIP)", leaflet: "Bijsluiter voor de pati\xEBnt", rma: "Maatregelen voor risicobeperking (RMA)", spc: "Samenvatting van de productkenmerken (SKP)", dhpc: "Rechtstreekse communicatie naar zorgverleners (DHPC)" }, ui: { price: "Prijs:" }, search: { label: "Zoek een geneesmiddel", errorMessage: "Voer minstens 3 letters van de naam in" } }, de: { drugType: { medication: "Arzneimittel", molecule: "Molek\xFCl", homologation: "Zulassung" }, drugInfographic: { blackTriangle: "Verst\xE4rkte Pharmakovigilanz (Schwarzes Dreieck)", rma: "Zus\xE4tzliche Ma\xDFnahmen zur Risikominimierung (RMA) (Quelle: BfArM)", genericPrescriptionRequired: "Generisches Rezept erforderlich" }, drugSpecialRegulation: { noNarcoticRegulation: "Kein Bet\xE4ubungsmittel, Arzneimittel mit besonderer Regelung", narcoticRegulation: "Bet\xE4ubungsmittel, Arzneimittel mit besonderer Regelung", noSpecialRegulation: "Keine besondere Regelung" }, supply: { issueTitle: "Vor\xFCbergehendes Lieferproblem :", startDate: "Eingeschr\xE4nkte Verf\xFCgbarkeit seit :", expectedEndDate: "Voraussichtliches Enddatum :", reason: "Grund :", impact: "Auswirkung :", prescriberNote: "Erkl\xE4rung des Verschreibers :", downloadPdf: "Dokument als .pdf herunterladen", extraInfo: "Zus\xE4tzliche Informationen :" }, commercialization: { end: "Ende der Vermarktung :", limitedAvailabilityFrom: "Eingeschr\xE4nkte Verf\xFCgbarkeit ab :", unavailableFrom: "Nicht verf\xFCgbar ab :", endReason: "Grund :", endImpact: "Auswirkung :", endAdditionalInformation: "Zus\xE4tzliche Informationen :", start: "Beginn der Vermarktung :", startAvailableFrom: "Verf\xFCgbar seit :" }, reimbursement: { title: "Erstattung :", category: "Erstattungskategorie :", categoryLabel: "Spezifikation der Erstattungskategorie :", copay: "Zuzahlungstyp", copayPreferential: " Bevorzugt :", copayActive: " Aktiv :", temporary: "Vor\xFCbergehende Erstattung (Art. 111) :", chapter: "Kapitel :", noneTitle: "Verordnungsbedingungen", notApplicable: "Nicht zutreffend", non: "Nein" }, delivery: { title: "Lieferbedingungen :", code: "Liefercode :", modus: "Liefermethode :", specification: "Lieferdetails :", notApplicable: "Nicht zutreffend" }, prescription: { title: "Verordnungsbedingungen :", code: "Verordnungscode :", specification: "Verordnungsdetails :", free: "Frei verschreibbar" }, vmp: { label: "VMP :", groupLabel: "VMP-Gruppe :" }, links: { cbip: "Kommentiertes Arzneimittelverzeichnis (CBIP)", leaflet: "Packungsbeilage f\xFCr Patienten", rma: "Ma\xDFnahmen zur Risikominimierung (RMA)", spc: "Fachinformation (SPC)", dhpc: "Direkte Kommunikation an medizinisches Fachpersonal (DHPC)" }, ui: { price: "Preis :" }, search: { label: "Arzneimittel suchen", errorMessage: "Geben Sie mindestens 3 Buchstaben des Arzneimittelnamens ein" } } }; // src/services/i18n/translations/components/practitioner.translations.ts var practitionerTranslations = { fr: { certificateUpload: { titleUpload: "T\xE9l\xE9charger le certificat", titlePassword: "Entrez le mot de passe du certificat", fileLabel: "Certificat du praticien", passwordLabel: "Mot de passe du certificat", submitButtonUpload: "Crypter et t\xE9l\xE9charger", submitButtonPassword: "Soumettre", resetButton: "T\xE9l\xE9charger un autre certificat", errorRequired: "Ce champ est requis", errorInvalid: "Champ invalide", passwordMissingTitle: "Mot de passe manquant", passwordMissingDescription: "Veuillez saisir le mot de passe associ\xE9 au certificat afin de pouvoir le d\xE9chiffrer. Ce mot de passe est requis pour poursuivre la v\xE9rification." }, certificateFeedback: { successTitle: "T\xE9l\xE9chargement du certificat r\xE9ussi", successDescription: "Le certificat du praticien a \xE9t\xE9 t\xE9l\xE9charg\xE9 avec succ\xE8s et le mot de passe a \xE9t\xE9 enregistr\xE9 en toute s\xE9curit\xE9. Vous pouvez maintenant poursuivre les prochaines \xE9tapes.", failureTitle: "\xC9chec du t\xE9l\xE9chargement du certificat", failureDescription: "Une erreur est survenue lors du t\xE9l\xE9chargement du certificat du praticien. Veuillez v\xE9rifier que votre certificat est valide et que vous avez saisi le bon mot de passe. R\xE9essayez, et si le probl\xE8me persiste, contactez le support.", verificationErrorTitle: "Erreur de v\xE9rification du certificat" }, printModal: { title: "Imprimer la prescription", close: "Fermer", print: "Imprimer" } }, en: { certificateUpload: { titleUpload: "Upload certificate", titlePassword: "Enter certificate password", fileLabel: "Practitioner certificate", passwordLabel: "Certificate password", submitButtonUpload: "Encrypt and upload", submitButtonPassword: "Submit", resetButton: "Upload another certificate", errorRequired: "This field is required", errorInvalid: "Invalid field", passwordMissingTitle: "Missing password", passwordMissingDescription: "Please enter the password associated with the certificate to decrypt it. This password is required to continue verification." }, certificateFeedback: { successTitle: "Certificate upload successful", successDescription: "The certificate\u2019s certificate was uploaded successfully. You may proceed with the next steps.", failureTitle: "Certificate upload failed", failureDescription: "An error occurred while uploading the certificate. Please check that your certificate is valid and that you\u2019ve entered the correct password. Try again, and if the issue continues, contact support.", verificationErrorTitle: "Certificate verification error" }, printModal: { title: "Print prescription", close: "Close", print: "Print" } }, nl: { certificateUpload: { titleUpload: "Certificaat uploaden", titlePassword: "Voer het certificaatwachtwoord in", fileLabel: "Certificaat van de zorgverlener", passwordLabel: "Wachtwoord van het certificaat", submitButtonUpload: "Versleutelen en uploaden", submitButtonPassword: "Verzenden", resetButton: "Ander certificaat uploaden", errorRequired: "Dit veld is verplicht", errorInvalid: "Ongeldig veld", passwordMissingTitle: "Wachtwoord ontbreekt", passwordMissingDescription: "Voer het wachtwoord in dat aan het certificaat is gekoppeld om het te ontsleutelen. Dit wachtwoord is vereist om de verificatie voort te zetten." }, certificateFeedback: { successTitle: "Certificaat succesvol ge\xFCpload", successDescription: "Het certificaat van de zorgverlener is succesvol ge\xFCpload en het wachtwoord is veilig opgeslagen. U kunt nu doorgaan met de volgende stappen.", failureTitle: "Uploaden van certificaat mislukt", failureDescription: "Er is een fout opgetreden bij het uploaden van het certificaat van het wachtwoord. Controleer of uw certificaat geldig is en of u het juiste wachtwoord hebt ingevoerd. Probeer het opnieuw. Neem contact op met de ondersteuning als het probleem aanhoudt.", verificationErrorTitle: "Fout bij verificatie van certificaat" }, printModal: { title: "Voorschrift afdrukken", close: "Sluiten", print: "Afdrukken" } }, de: { certificateUpload: { titleUpload: "Zertifikat hochladen", titlePassword: "Zertifikat-Passwort eingeben", fileLabel: "Zertifikat des Arztes", passwordLabel: "Passwort des Zertifikats", submitButtonUpload: "Verschl\xFCsseln und hochladen", submitButtonPassword: "Absenden", resetButton: "Anderes Zertifikat hochladen", errorRequired: "Dieses Feld ist erforderlich", errorInvalid: "Ung\xFCltiges Feld", passwordMissingTitle: "Passwort fehlt", passwordMissingDescription: "Bitte geben Sie das Passwort ein, das mit dem Zertifikat verkn\xFCpft ist, um es zu entschl\xFCsseln. Dieses Passwort ist f\xFCr die weitere \xDCberpr\xFCfung erforderlich." }, certificateFeedback: { successTitle: "Zertifikat erfolgreich hochgeladen", successDescription: "Das Zertifikat des Arztes wurde erfolgreich hochgeladen und das Passwort wurde sicher gespeichert. Sie k\xF6nnen nun mit den n\xE4chsten Schritten fortfahren.", failureTitle: "Zertifikat-Upload fehlgeschlagen", failureDescription: "Beim Hochladen des Zertifikats ist ein Fehler aufgetreten. Bitte \xFCberpr\xFCfen Sie, ob Ihr Zertifikat g\xFCltig ist und ob Sie das richtige Passwort eingegeben haben. Versuchen Sie es erneut. Wenn das Problem weiterhin besteht, wenden Sie sich an den Support.", verificationErrorTitle: "Fehler bei der Zertifikatspr\xFCfung" }, printModal: { title: "Rezept drucken", close: "Schlie\xDFen", print: "Drucken" } } }; // src/services/i18n/translations/utils/visibility-helpers.translations.ts var prescriptionVisibilityTranslations = { fr: { practitionerVisibility: { open: "Visible pour tous les prescripteurs", locked: "Visible uniquement pour moi-m\xEAme", gmd_prescriber: "Visible uniquement pour le titulaire du DMG" }, pharmacistVisibility: { null: "Le m\xE9dicament est visible par tous les pharmaciens", locked: "Le m\xE9dicament n`est pas visible par tous les pharmaciens" } }, en: { practitionerVisibility: { open: "Visible to all prescribers", locked: "Visible only to myself", gmd_prescriber: "Visible only to the GMD holder" }, pharmacistVisibility: { null: "The medication is visible to all pharmacists", locked: "The medication is not visible to all pharmacists" } }, nl: { practitionerVisibility: { open: "Zichtbaar voor alle voorschrijvers", locked: "Alleen zichtbaar voor mezelf", gmd_prescriber: "Alleen zichtbaar voor de GMD-houder" }, pharmacistVisibility: { null: "Het geneesmiddel is zichtbaar voor alle apothekers", locked: "Het geneesmiddel is niet zichtbaar voor alle apothekers" } }, de: { practitionerVisibility: { open: "Sichtbar f\xFCr alle verschreiber", locked: "Nur f\xFCr mich sichtbar", gmd_prescriber: "Nur f\xFCr den GMD-inhaber sichtbar" }, pharmacistVisibility: { null: "Das medikament ist f\xFCr alle apotheker sichtbar", locked: "Das medikament ist nicht f\xFCr alle apotheker sichtbar" } } }; // src/services/i18n/translations/utils/reimbursement-helpers.translations.ts var reimbursementTranslations = { fr: { practitionerSelectionOptions: { none: "Aucun", PAYINGTHIRDPARTY: "Tiers Payant", FIRSTDOSE: "Premi\xE8re Dose", SECONDDOSE: "Deuxi\xE8me Dose", THIRDDOSE: "Troisi\xE8me Dose", CHRONICKINDEYDISEASE: "Maladie R\xE9nale Chronique", DIABETESTREATMENT: "Traitement du Diab\xE8te", DIABETESCONVENTION: "Convention Diab\xE8te", NOTREIMBURSABLE: "Non Remboursable", EXPLAINMEDICATION: "Explication du M\xE9dicament", DIABETESSTARTPATH: "Parcours Initial Diab\xE8te" }, categoryOptions: { A: "M\xE9dicaments vitaux", B: "M\xE9dicaments th\xE9rapeutiquement importants", C: "M\xE9dicaments pour traitement symptomatique", Cs: "Ex. vaccins, m\xE9dicaments antiallergiques", Cx: "Ex. contraceptifs", Fa: "M\xE9dicaments vitaux rembours\xE9s sur une base fixe", Fb: "M\xE9dicaments th\xE9rapeutiquement importants rembours\xE9s sur une base fixe" } }, en: { practitionerSelectionOptions: { none: "None", PAYINGTHIRDPARTY: "Third-party payment", FIRSTDOSE: "First dose", SECONDDOSE: "Second dose", THIRDDOSE: "Third dose", CHRONICKINDEYDISEASE: "Chronic kidney disease", DIABETESTREATMENT: "Diabetes treatment", DIABETESCONVENTION: "Diabetes convention", NOTREIMBURSABLE: "Not reimbursable", EXPLAINMEDICATION: "Medication explanation", DIABETESSTARTPATH: "Diabetes initial care path" }, categoryOptions: { A: "Life-saving medicines", B: "Therapeutically important medicines", C: "Medicines for symptomatic treatment", Cs: "e.g. vaccines, allergy medicines", Cx: "e.g. contraceptives", Fa: "Life-saving medicines with reimbursement based on a fixed amount", Fb: "Therapeutically important medicines with reimbursement based on a fixed amount" } }, nl: { practitionerSelectionOptions: { none: "Geen", PAYINGTHIRDPARTY: "Derdebetaler", FIRSTDOSE: "Eerste Dosis", SECONDDOSE: "Tweede Dosis", THIRDDOSE: "Derde Dosis", CHRONICKINDEYDISEASE: "Chronische Nierziekte", DIABETESTREATMENT: "Diabetesbehandeling", DIABETESCONVENTION: "Diabetesconventie", NOTREIMBURSABLE: "Niet Terugbetaalbaar", EXPLAINMEDICATION: "Uitleg over het Geneesmiddel", DIABETESSTARTPATH: "Opstarttraject Diabetes" }, categoryOptions: { A: "Levensreddende geneesmiddelen", B: "Therapeutisch belangrijke geneesmiddelen", C: "Geneesmiddelen voor symptomatische behandeling", Cs: "bv. vaccins, allergiemedicatie", Cx: "bv. anticonceptiva", Fa: "Levensreddende geneesmiddelen met terugbetaling op basis van een vast bedrag", Fb: "Therapeutisch belangrijke geneesmiddelen met terugbetaling op basis van een vast bedrag" } }, de: { practitionerSelectionOptions: { none: "Keine", PAYINGTHIRDPARTY: "Drittzahlerregelung", FIRSTDOSE: "Erste Dosis", SECONDDOSE: "Zweite Dosis", THIRDDOSE: "Dritte Dosis", CHRONICKINDEYDISEASE: "Chronische Nierenerkrankung", DIABETESTREATMENT: "Diabetesbehandlung", DIABETESCONVENTION: "Diabetesvereinbarung", NOTREIMBURSABLE: "Nicht Erstattungsf\xE4hig", EXPLAINMEDICATION: "Erl\xE4uterung zum Medikament", DIABETESSTARTPATH: "Einstiegspfad Diabetes" }, categoryOptions: { A: "Lebensrettende Medikamente", B: "Therapeutisch wichtige Medikamente", C: "Medikamente zur symptomatischen Behandlung", Cs: "z. B. Impfstoffe, Allergiemedikamente", Cx: "z. B. Verh\xFCtungsmittel", Fa: "Lebensrettende Medikamente mit Erstattung auf Basis eines Festbetrags", Fb: "Therapeutisch wichtige Medikamente mit Erstattung auf Basis eines Festbetrags" } } }; // src/services/i18n/translations/utils/prescription-duration-helpers.translations.ts var prescriptionDurationTranslations = { fr: { durationUnits: { day: "jour", week: "semaine" }, periodicityUnits: { none: "aucune", week: "semaine", twoWeeks: "2 semaines", threeWeeks: "3 semaines", numberOfDays: "x nombre de jours" } }, en: { durationUnits: { day: "day", week: "week" }, periodicityUnits: { none: "none", week: "week", twoWeeks: "2 weeks", threeWeeks: "3 weeks", numberOfDays: "x number of days" } }, nl: { durationUnits: { day: "dag", week: "week" }, periodicityUnits: { none: "geen", week: "week", twoWeeks: "2 weken", threeWeeks: "3 weken", numberOfDays: "x aantal dagen" } }, de: { durationUnits: { day: "tag", week: "woche" }, periodicityUnits: { none: "keine", week: "woche", twoWeeks: "2 wochen", threeWeeks: "3 wochen", numberOfDays: "x anzahl der tage" } } }; // src/services/i18n/translations/utils/delivery-helpers.translations.ts var deliveryModusTranslations = { fr: { specifications: { Sp: "Prescription par un m\xE9decin-sp\xE9cialiste", Sp1: "Premi\xE8re prescription par un m\xE9decin-sp\xE9cialiste, prescription de suivi par un m\xE9decin g\xE9n\xE9raliste", "Sp/S": "Prescription par un m\xE9decin-sp\xE9cialiste", "Sp1/S": "Premi\xE8re prescription par un m\xE9decin-sp\xE9cialiste, prescription de suivi par un m\xE9decin g\xE9n\xE9raliste", "IMP/Sp": "Prescription par un m\xE9decin-sp\xE9cialiste", "IMP/Sp1": "Premi\xE8re prescription par un m\xE9decin-sp\xE9cialiste, prescription de suivi par un m\xE9decin g\xE9n\xE9raliste" } }, en: { specifications: { Sp: "Prescription by specialist", Sp1: "First prescription by specialist, follow-up prescription by general certificate", "Sp/S": "Prescription by specialist", "Sp1/S": "First prescription by specialist, follow-up prescription by general certificate", "IMP/Sp": "Prescription by specialist", "IMP/Sp1": "First prescription by specialist, follow-up prescription by general certificate" } }, nl: { specifications: { Sp: "Voorschrift door een geneesheer-specialist", Sp1: "Eerste voorschrift door een geneesheer-specialist, vervolgoorschrift door huisarts", "Sp/S": "Voorschrift door een geneesheer-specialist", "Sp1/S": "Eerste voorschrift door een geneesheer-specialist, vervolgoorschrift door huisarts", "IMP/Sp": "Voorschrift door een geneesheer-specialist", "IMP/Sp1": "Eerste voorschrift door een geneesheer-specialist, vervolgoorschrift door huisarts" } }, de: { specifications: { Sp: "Verschreibung von einem Facharzt", Sp1: "Erste Verschreibung von einem Facharzt, Folgeverordnung vom Hausarzt", "Sp/S": "Verschreibung von einem Facharzt", "Sp1/S": "Erste Verschreibung von einem Facharzt, Folgeverordnung vom Hausarzt", "IMP/Sp": "Verschreibung von einem Facharzt", "IMP/Sp1": "Erste Verschreibung von einem Facharzt, Folgeverordnung vom Hausarzt" } } }; // src/services/i18n/translations/index.ts var appTranslations = { fr: { home: homeTranslations.fr, prescription: prescriptionTranslations.fr, medication: medicationTranslations.fr, practitioner: practitionerTranslations.fr, prescriptionVisibilityHelper: prescriptionVisibilityTranslations.fr, reimbursementHelper: reimbursementTranslations.fr, prescriptionDurationHelper: prescriptionDurationTranslations.fr, deliveryModusHelper: deliveryModusTranslations.fr }, en: { home: homeTranslations.en, prescription: prescriptionTranslations.en, medication: medicationTranslations.en, practitioner: practitionerTranslations.en, prescriptionVisibilityHelper: prescriptionVisibilityTranslations.en, reimbursementHelper: reimbursementTranslations.en, prescriptionDurationHelper: prescriptionDurationTranslations.en, deliveryModusHelper: deliveryModusTranslations.en }, nl: { home: homeTranslations.nl, prescription: prescriptionTranslations.nl, medication: medicationTranslations.nl, practitioner: practitionerTranslations.nl, prescriptionVisibilityHelper: prescriptionVisibilityTranslations.nl, reimbursementHelper: reimbursementTranslations.nl, prescriptionDurationHelper: prescriptionDurationTranslations.nl, deliveryModusHelper: deliveryModusTranslations.nl }, de: { home: homeTranslations.de, prescription: prescriptionTranslations.de, medication: medicationTranslations.de, practitioner: practitionerTranslations.de, prescriptionVisibilityHelper: prescriptionVisibilityTranslations.de, reimbursementHelper: reimbursementTranslations.de, prescriptionDurationHelper: prescriptionDurationTranslations.de, deliveryModusHelper: deliveryModusTranslations.de } }; // src/services/constants.ts var DEFAULT_APP_LANGULAGE = "fr"; var CERTIFICATE_IDB_CONFIG = { DB_NAME: "certificate-store", STORE_NAME: "certificates", KEY_PATH: "id" }; var TOKEN_IDB_CONFIG = { DB_NAME: "token-store", STORE_NAME: "tokens", KEY_PATH: "id" }; // src/services/i18n/index.tsx var CardinalLanguage = class { language = DEFAULT_APP_LANGULAGE; setLanguage(language3) { this.language = language3; } getLanguage() { return this.language; } }; var cardinalLanguage = new CardinalLanguage(); var t = (key) => { const getKeyValue = (collection, complexKey) => { const keys = complexKey.split("."); let value = collection; for (const k of keys) { if (value && typeof value === "object" && k in value) { value = value[k]; } else { return void 0; } } return typeof value === "string" ? value : void 0; }; return getKeyValue(appTranslations[cardinalLanguage.getLanguage()], key) ?? key; }; var getSamTextTranslation = (samText) => { if (!samText) { return void 0; } const lang = cardinalLanguage.getLanguage(); const fallback = DEFAULT_APP_LANGULAGE; return samText[lang] ?? samText[fallback]; }; // src/services/cardinal-sam/index.ts var language = cardinalLanguage.getLanguage(); var PaginatedListIterator = class { loader; limit; hasNextPage; currentList; constructor(loader) { this.loader = loader; this.limit = 20; this.hasNextPage = true; this.currentList = null; } async hasNext() { if (this.hasNextPage === null) { this.currentList = await this.loader(this.limit); this.hasNextPage = this.currentList.rows && this.currentList.rows.length > 0; } return this.hasNextPage; } async next(limit) { if (this.hasNextPage === null || !this.hasNextPage) { throw new Error("No more pages available"); } if (!this.currentList) { this.currentList = await this.loader(limit); } const rows = this.currentList.rows || []; this.hasNextPage = !!this.currentList.nextKeyPair && rows.length === limit; if (this.hasNextPage) { const nextKey = this.currentList.nextKeyPair?.startKey; const nextDocumentId = this.currentList.nextKeyPair?.startKeyDocId; this.currentList = await this.loader(limit, nextKey, nextDocumentId); } else { this.currentList = null; } return rows; } }; var findMedicationsByLabel = async (sdk, query) => { try { return await Promise.all([ new PaginatedListIterator((limit, startKey, startDocumentId) => { return sdk.findPaginatedAmpsByLabel(language, query, startKey ? JSON.stringify(startKey) : void 0, startDocumentId, limit); }), new PaginatedListIterator((limit, startKey, startDocumentId) => { return sdk.findPaginatedVmpGroupsByLabel(language, query, startKey ? JSON.stringify(startKey) : void 0, startDocumentId, limit); }), new PaginatedListIterator((limit, startKey, startDocumentId) => { return sdk.findPaginatedNmpsByLabel(language, query, startKey ? JSON.stringify(startKey) : void 0, startDocumentId, limit); }) ]); } catch (error) { console.error("Error in findMedicationsByLabel:", error); throw error; } }; var fetchSamVersion = async (sdk) => { try { return await sdk.getSamVersion(); } catch (error) { console.error("Error in fetchSamVersion:", error); return void 0; } }; // src/services/indexed-db/index.ts var IndexedDbServiceStore = class { db; config; constructor(config) { this.config = config; this.db = new Promise((resolve, reject) => { const request = indexedDB.open(this.config.DB_NAME, 1); request.onupgradeneeded = (event) => { const db = event.target.result; if (!db.objectStoreNames.contains(this.config.STORE_NAME)) { db.createObjectStore(this.config.STORE_NAME, { keyPath: this.config.KEY_PATH }); } }; request.onsuccess = () => resolve(request.result); request.onerror = () => reject(request.error); }); } get(key) { return new Promise(async (resolve, reject) => { const tx = (await this.db).transaction(this.config.STORE_NAME, "readonly"); const store = tx.objectStore(this.config.STORE_NAME); const request = store.get(key); request.onsuccess = () => { request.result?.value != null ? resolve(request.result.value) : reject(new Error(`No value for key: ${key}`)); }; request.onerror = () => reject(request.error); }); } put(key, value) { return new Promise(async (resolve, reject) => { const tx = (await this.db).transaction(this.config.STORE_NAME, "readwrite"); const store = tx.objectStore(this.config.STORE_NAME); const getRequest = store.get(key); getRequest.onsuccess = () => { const exists = !!getRequest.result; const record = { id: key, value }; const request = exists ? store.put(record) : store.add(record); request.onsuccess = () => resolve(value); request.onerror = () => reject(request.error); }; getRequest.onerror = () => reject(getRequest.error); }); } delete(key) { return new Promise(async (resolve, reject) => { const tx = (await this.db).transaction(this.config.STORE_NAME, "readwrite"); const store = tx.objectStore(this.config.STORE_NAME); console.log("store"); console.log(store); const request = store.delete(key); console.log("request"); console.log(request); request.onsuccess = () => resolve(); request.onerror = () => reject(request.error); }); } }; // src/services/certificate/index.ts var certificateStore = new IndexedDbServiceStore(CERTIFICATE_IDB_CONFIG); var loadCertificateInformation = async (hcp_ssin) => { try { const record = await certificateStore.get(hcp_ssin); return { salt: new Uint8Array(record.salt).buffer, iv: new Uint8Array(record.iv).buffer, encryptedCertificate: new Uint8Array(record.encryptedCertificate).buffer }; } catch (error) { console.error(`No certificate record found for HCP SSIN ${hcp_ssin}:`, error); return void 0; } }; var loadAndDecryptCertificate = async (hcp_ssin, passphrase) => { try { const info = await loadCertificateInformation(hcp_ssin); if (!info) return void 0; const { salt, iv, encryptedCertificate } = info; const encoder = new TextEncoder(); const passwordKey = await crypto.subtle.importKey("raw", encoder.encode(passphrase), { name: "PBKDF2" }, false, ["deriveKey"]); const decryptionKey = await crypto.subtle.deriveKey( { name: "PBKDF2", salt: new Uint8Array(salt), iterations: 1e5, hash: "SHA-256" }, passwordKey, { name: "AES-GCM", length: 256 }, false, ["decrypt"] ); return await crypto.subtle.decrypt( { name: "AES-GCM", iv: new Uint8Array(iv) }, decryptionKey, new Uint8Array(encryptedCertificate) ); } catch (error) { console.error(`Decryption failed for HCP SSIN "${hcp_ssin}":`, error); return void 0; } }; var uploadAndEncryptCertificate = async (hcp_ssin, passphrase, certificate) => { try { const salt = crypto.getRandomValues(new Uint8Array(16)); const iv = crypto.getRandomValues(new Uint8Array(12)); const passwordKey = await crypto.subtle.importKey("raw", new TextEncoder().encode(passphrase), { name: "PBKDF2" }, false, ["deriveKey"]); const encryptionKey = await crypto.subtle.deriveKey( { name: "PBKDF2", salt, iterations: 1e5, hash: "SHA-256" }, passwordKey, { name: "AES-GCM", length: 256 }, false, ["encrypt"] ); const encryptedCertificate = await crypto.subtle.encrypt({ name: "AES-GCM", iv }, encryptionKey, certificate); const record = { id: hcp_ssin, salt: Array.from(salt), iv: Array.from(iv), encryptedCertificate: Array.from(new Uint8Array(encryptedCertificate)) }; return await certificateStore.put(hcp_ssin, record); } catch (error) { console.error(`Encryption failed for certificate of the HCP SSIN ${hcp_ssin}:`, error); return void 0; } }; var deleteCertificate = async (hcp_ssin) => { try { await certificateStore.delete(hcp_ssin); console.log(`Certificate with ID ${hcp_ssin} successfully deleted.`); return true; } catch (error) { console.error(`Failed to delete certificate with ID ${hcp_ssin}:`, error); return false; } }; // src/services/fhc/index.ts var import_be_fhc_lite_api = require("@icure/be-fhc-lite-api"); // src/utils/date-helpers.ts var convertYyyyMmDdNumberToIsoDate = (dateNumber) => { const year = Math.floor(dateNumber / 1e4); const month = Math.floor(dateNumber % 1e4 / 100).toString().padStart(2, "0"); const day = (dateNumber % 100).toString().padStart(2, "0"); return `${year}-${month}-${day}`; }; var getTreatmentStartDate = (prescribedMedication) => { if (prescribedMedication?.medication.beginMoment) { return convertYyyyMmDdNumberToIsoDate(prescribedMedication?.medication.beginMoment); } else { return (/* @__PURE__ */ new Date()).toISOString().split("T")[0]; } }; var getExecutableUntilDate = (prescribedMedication) => { if (prescribedMedication?.medication.endMoment) { return convertYyyyMmDdNumberToIsoDate(prescribedMedication.medication.endMoment); } else { const startDay = /* @__PURE__ */ new Date(); const nextYear = new Date(startDay); nextYear.setFullYear(startDay.getFullYear() + 1); return nextYear.t