Logo GenPRES

FilterHelpers Module

Looks up the prescription rules for a filter, keeps the rules that can be prescribed for the patient and returns the pick lists. The lookup of all prescription rules and the lookup of the pick lists log a failure and give an empty result; the lookup of the prescribable rules returns the error to the caller.

Functions and values

Function or value Description

getPrescribableRules logger provider filter

Full Usage: getPrescribableRules logger provider filter

Parameters:
Returns: Result<PrescriptionRule array, Message list>

Returns the prescription rules for the filter that can be prescribed for the patient data of the filter. Logs a warning when no rule is left.

logger : Logger
provider : IResourceProvider
filter : DoseFilter
Returns: Result<PrescriptionRule array, Message list>

getPrescriptionRules logger provider

Full Usage: getPrescriptionRules logger provider

Parameters:
Returns: PatientData -> PrescriptionRule[]
logger : Logger
provider : IResourceProvider
Returns: PatientData -> PrescriptionRule[]

optionsFor logger provider doseFilter

Full Usage: optionsFor logger provider doseFilter

Parameters:
Returns: FilterOptions

Returns the pick lists of the prescribable rules for the dose filter. Logs the error and returns empty pick lists when the rule lookup fails.

logger : Logger
provider : IResourceProvider
doseFilter : DoseFilter
Returns: FilterOptions

orLogErrors logger fallback _arg1

Full Usage: orLogErrors logger fallback _arg1

Parameters:
Returns: 'a
Type parameters: 'a

Returns the value of an Ok result. Logs the GenForm messages of an Error and returns the fallback.

logger : Logger
fallback : 'a
_arg1 : Result<'a, Message list>
Returns: 'a

Type something to start searching.