@claudebernard/prescription-scanner-element v0.6.1
\ element
An element providing a medical prescription scanner and analyzer.
Installation
npm install --save @claudebernard/prescription-scanner-element
Usage
Script
Import as ES modules:
import '@claudebernard/prescription-scanner-element';
With a script tag:
<script type="module"
src="node_modules/@claudebernard/prescription-scanner-element/dist/prescription-scanner.js"></script>
HTML
<bcb-prescription-scanner apiurl="https://api.claudebernard.fr"></bcb-prescription-scanner>
Attributes
Name | Type | Default | Description | |
---|---|---|---|---|
apiurl | URL | https://pim.cegedim-sante.com | API base URL to call to scan prescriptions | |
apikey | UUID | none | API key authentication. Preferred method is to set up a proxy on your side that will add this API key header : in this case, don't provide any value here. | |
lang | String | fr-FR | UI display locale. Available: - French (France): fr-FR - English: en | |
model | String | PROTOTYPE | AI model to use. Available: -Prototype for experimentation: PROTOTYPE -Phealing model: PHEALING | |
fileUploadId | String | none | Id of a pre uploaded file through the Upload API. e.g: 'f7cece89-da44-4cd5-8eb7-48be56dd0c8a' | |
selection-disabled | Boolean | false | Disable selection of prescription items. Also hides checkboxes | |
analysis-fixing-disabled | Boolean | false | Disable the prescription item menu action of fixing the analysis of medication | |
dosage-edition-disabled | Boolean | false | Disable the prescription item menu action of editing the detected dosages | |
prescription-item-deletion-disabled | Boolean | false | Disable the prescription item menu action of deleting a prescription item | |
findMedication | FindMedicationFunction | BCB search medication function | Function to call to find a medication. See FindMedicationFunction | |
formatMedicationLabel | FormatMedicationLabelFunction | Formatting medication label function | Function to format the medication label. See FormatMedicationLabelFunction |
FindMedicationFunction
Example of a findMedication
function to call to find a medication:
async function findMedication(term) {
const response = await fetch("https://my-medication-api.com/search?term=" + term);
const fhirMedications = response.json();
return fhirMedications;
}
FormatMedicationLabelFunction
Example of a formatMedicationLabel
function to format the medication label:
function formatMedicationLabel(medication: Medication): string | undefined {
const cip13Label = medication.code?.coding?.find(coding => coding.system === SystemURL.CIP13_CODE.toString());
let someOtherLabel;
let someUnit;
// some actions ...
const medicationLabel = `${cip13Label} (${someOtherLabel}) : ${someUnit}`;
return medicationLabel ?? "";
}
enum SystemURL {
CIP13_CODE = "http://terminology.hl7.org/CodeSystem/cip13-code",
// ...some other coding systems...
}
Events
Name | Type | Format | Description |
---|---|---|---|
new-bundle | BundleEvent | { bundle: Bundle } | A new bundle has been collected. See 'Bundle' FHIR resource |
bundles-filtered | BundlesEvent | { bundles: Bundle[] } | A bundle has been filtered (check or uncheck prescription items). See 'Bundle' FHIR resource |
bundles-updated | BundlesEvent | { bundles: Bundle[] } | A bundle has been updated by a user action. See 'Bundle' FHIR resource |
Browser support
Browsers without native custom element support require a polyfill.
- Chrome
- Firefox
- Safari
- Microsoft Edge
Custom element checklist
- Public documentation (docs portal)
- Functional on Angular, React, Vue
- Unit tested
- Code quality
- Changelog with semantic release
- Available in offline mode
- Best practices compliant
- Validated by QA
- Publicly available
- Based on FHIR
- Example on storybook
- Available demo
- i18n
- Browser support section
- EOL section
License
Copyright of Cegedim. See LICENSE for details.
4 days ago
8 days ago
24 days ago
1 month ago
2 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago