Dosage Presets
Use Cases
- Global Clinomic-wide presets (potentially common combinations)
- Hospital-specific presets
- Settings for values to be inserted into the dosage form when applying the preset
- Settings for a "simpleMode" that presents a custom form layout
- Settings for the basic form, providing an additional layer to simplify the form layout
- Option for required user confirmation upon preset selection (this can request necessary fields in addition to the preset values)
- Possible frontend filtering based on the selected application mode (e.g., running rate presets only in certain modes)
- Grouping of presets
Structure
| Key | Requirement | Description |
|---|---|---|
| name | required | Display Name of the Preset. |
| dosagePresetValues | required | Defined Values to be patched on Preset apply. Structure is TBD, but best case it should match the prevented Form Structure for easy patching. |
| simpleFormConfig | optional | Defined Form Fields which should be visible in first view |
| formConfig | optional | Defined Form Fields which should be visible on normal form view |
| confirmOpen | optional | If the preset should open the dosage form before adding a new dosage |
| groupName | optional | Presets with the same groupName can be grouped |
| applicationMode | optional | A definition of specific Application Modes to allow filtering |
Form Configurations
Since the foundation is always a complete Dosage Form, all fields are displayed in the standard view. The concept behind Form Configs of presets is to provide a solution that allows any representation and simplification without requiring hardcoded rules.
A Form Config consists of defined keys that control the visibility of respective front-end parts of the form.
type FormConfig = {
showAsNeededInput: boolean,
showDurationGroup: boolean,
showDurationMaxInput: boolean,
showFrequencyGroup: boolean,
showFrequencyMaxInput: boolean,
showPeriodGroup: boolean,
showPeriodMaxInput: boolean,
showDayOfWeekInput: boolean,
showSpecifTimeOfDayGroup: boolean,
showMaxDosageGroup: boolean
}
showAsNeededInput controls, for example, the input option for the isNeededBooleanfhirThis variable is defined by the FHIR standard. checkbox.
It is important to note that it doesn't make sense to allow individual control of every field, since some inputs like durationfhirThis variable is defined by the FHIR standard. also require durationUnitfhirThis variable is defined by the FHIR standard. to be valid in FHIR.
Additionally, it wouldn't make sense to display only durationMaxfhirThis variable is defined by the FHIR standard., as it is an optional value that complements the other two.
For this reason, the form config consists of blocks that can be toggled.
The following example would show the input fields for both durationfhirThis variable is defined by the FHIR standard. and durationUnitfhirThis variable is defined by the FHIR standard., but not durationMaxfhirThis variable is defined by the FHIR standard.:
{
"showDurationGroup": true
}
To also show `durationMax, the form config would need to look like this:
{
"showDurationGroup": true,
"showDurationMaxInput": true
}
Note that if the Duration Group is not displayed, "showDurationMaxInput": true has no effect since it is part of that group.
Options for Form Display
We have three different form views, where two of them are customizable with the preset. We are using different views because it must always be possible to display all fields of the form to allow manual control, overrides, or simply to reveal unexpected data combinations.
The default form view shows all fields. To simplify it for a specific use case, simpleFormConfig can be used to create a view which only shows a subset of the fields.
formConfig works the same way, but is mainly for removing only some fields from the default form like durationfhirThis variable is defined by the FHIR standard. for medications where no running rate is needed.
nevertheless it should always be possible to switch back to the default view and check all fields.
The formflow could be described as followed:
We offer three distinct form views, two of which can be customized using presets. These different views are essential because it's crucial to always have the option to display all form fields. This ensures manual control, allows for overrides, and helps uncover unexpected data combinations.
The default form view displays all fields. For specific use cases, you can use simpleFormConfig to create a view that only shows a subset of these fields.
Similarly, formConfig allows you to remove certain fields from the default view, such as the durationfhirThis variable is defined by the FHIR standard. field for medications where a running rate isn't necessary.
However, it's important to always have the ability to switch back to the default view to review all fields.
The form view flow can be described as follows:
Simple Form (simpleFormConfig) → Preset Form (formConfig) → All Fields (default)
Example
With the configurations mentioned above, the following example could be created:
{
"name": "3 Times a day",
"dosagePresetValues": {
"period": 1,
"periodUnit": "d",
"frequency": 3
},
"formConfig": {
"showFrequencyGroup": true,
"showPeriodGroup": true,
"showDayOfWeekInput": true
},
"simpleFormConfig": {
"showDayOfWeekInput": true
},
"confirmOpen": true
}
This example would be named 3 Times a day. When the user selects the preset, a new dosage is not added immediately due to confirmOpen.
Instead, the form will open and pre-fill the values defined in dosagePresetValues.
This means period: 1fhirThis variable is defined by the FHIR standard., periodUnit: "d"fhirThis variable is defined by the FHIR standard., and frequency: 3fhirThis variable is defined by the FHIR standard. would be pre-populated.
However, the user will not see all of these fields in the form — only those specified in simpleFormConfig.
In this case, only showDayOfWeekInput is shown, as it's the only value the user still needs to enter manually.
They should select the days of the week on which the medication should be taken.
Still, the user has the option to view a form that shows all relevant fields defined in formConfig.
And one step further, they could access the default form to display all fields — for example, if they are a superuser or consider additional fields necessary.