@smals-belgium-shared/vidis-medication-scheme v1.1.0
Vidis medication scheme list web component
Context
VIDIS (Virtual Integrated Drug Information System) integrates several sources and systems:
- Recip-e prescriptions
- Vitalink / RSW / RSB medication scheme
- Vitalink / RSW / RSB diary notes
- Farmaflux delivered medications
In order to be reused by other software vendors, the VIDIS front-end is now split into web components. The container application will have to provide the input parameters to provision the web component with a working context.
Prerequisites
- A supported browser by our Web Components AND by eHealth
- A valid VIDIS token. It could be obtained from eHealth Token eXchange service. This token must be refreshed periodically in order to be used by VIDIS
⚠️ IE (internet explorer) is not supported. You can include polyfill scripts ("polyfills") for the browsers that you must support.
Features
This web component offers a versatile and user-friendly way for patients to manage their medication schedule through three distinct views: list view, weekly view, and daily view. Each view provides a different perspective on the medication regimen, offering flexibility to help users track their medications according to their preferences and needs. The component also includes key information that is consistent across all views to ensure transparency and accuracy.
List view
The list view offers a comprehensive overview of all medications that the user is currently taking, as well as those that are planned for future use. This format is ideal for a broad view of the entire medication schedule, with the flexibility to filter and focus on either current or future medications. Each medication entry includes important information such as the medication name, dosage, and a leaflet with additional details. Users can select any medication in the list to view more detailed information, such as the start date, frequency, duration, and special instructions or warnings related to the medication. This view is particularly helpful for users who want to see all medications in one place or need to track multiple prescriptions. This view is often requested by caregivers.
Weekly view
The weekly view is particularly useful for users who want to organize and manage their medications over the course of a week. This view displays the medications the user needs to take during the selected week, with the current week being the default setting. However, users can select a different week using a calendar feature, allowing them to see upcoming medication schedules and plan ahead. Each medication is shown with clear indications of which days of the week the medication needs to be taken. In addition to medication name, dosage, and leaflet, this view gives users a clear layout of the week, helping them visualize when to take each medication. This feature is especially helpful for those who need to plan ahead, manage multiple medications, or fill a pillbox. Users can also access more detailed information, such as the start date, frequency, and any special notes, ensuring that users are fully informed.
Daily view
The daily view is tailored for those who need a more specific, day-to-day breakdown of their medication schedule. This view shows the exact time of day when each medication should be taken, helping users stay on track and avoid missing doses. The medication name, dosage, and leaflet are prominently displayed, along with a clear specification of which moment of the day the medication should be taken. This view is especially helpful for patients who need a precise schedule to manage their medications throughout the day. Whether it’s for morning, afternoon, or evening doses, the daily view ensures users know exactly when to take each medication. Users can also access more detailed information about the medication, such as its start date, frequency, and any specific instructions that may apply. This feature is ideal for individuals who need a more detailed, step-by-step guide for their daily medication regimen.
Inputs
Name | Mandatory | Possible values | Description |
---|---|---|---|
language | true | en , de , fr , nl | The language holds the current language as a value, which means it can change over time if the user changes his/her preferred language. The web component adapts the translations based on the value set. The values of the language property are defined in the Language enum. |
configName | true | acc , prod | Name of the configuration the application and the components are being deployed to. |
services | true | N/A | Set of services to be consumed by the component. see USAGE. |
Outputs
Name | Type | Description |
---|---|---|
onSelectMedication | string | Notified with the selected ID code as string |
Usage
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vidis medication scheme list web component</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="vidis-medication-scheme-list/medication-scheme-list.js"></script>
<link rel="stylesheet" href="vidis-medication-scheme-list/medication-scheme-list.css">
</head>
<body>
<script>
const wc = document.createElement("vidis-medication-scheme-list");
// Common inputs for all VIDIS web components
// Refer to https://www.npmjs.com/package/@smals-belgium/myhealth-wc-integration for more details
wc.language = 'en'
wc.configName = 'acc';
wc.services = {
cache: {
get: (key) => (undefined),
set: (key, value) => {},
remove: (key) => {}
} ,
getAccessToken: async (audience) => "TODO : the eHealth OAuth2 JWT token.",
registerRefreshCallback: () => { }
}
// Example on how to provide extra input parameter(s), if needed / requested by the component
// wc["attributeName"] = "myValue"
// Example on how to listen to output parameter(s)
wc.addEventListener("eventName", (event) => {
console.log(`event:`, event)
const params = event.detail;
console.log('param:', params);
})
// Example on how to listen to output parameter(s), for printing
wc.addEventListener("eventPrintName", (event) => {
console.log(`event:`, event)
const params = event.detail;
console.log('param:', params);
const byteArray = new Uint8Array(atob(params.base64Pdf).split('').map(char => char.charCodeAt(0)))
const blob = new Blob([byteArray], { type: 'application/pdf' })
const url = window.URL.createObjectURL(blob)
window.open(url, '_blank').print()
})
document.body.append(wc);
</script>
</body>
</html>