Helpers Module
Splits prescription rules by the Divisible of their products, makes and calculates the orders of the rules and turns the calculated orders into scenarios.
Functions and values
| Function or value |
Description
|
Full Usage:
changeRuleProductsDivisible pr
Parameters:
PrescriptionRule
Returns: PrescriptionRule
|
|
Full Usage:
evaluateOrder logger pr order
Parameters:
Logger
-
The logger.
pr : PrescriptionRule
-
The prescription rule of the order.
order : Order
-
The order to calculate.
Returns: Result<(Order * PrescriptionRule), (Order * PrescriptionRule * Message list)>
The order with the rule, or the order, the rule and the error.
|
Calculates the min and max values of an order and sets the dose units from the substance limits of the rule.
|
Full Usage:
evaluateRules start logger prs
Parameters:
DateTime
-
The start of the orders in UTC.
logger : Logger
-
The logger.
prs : PrescriptionRule array
-
The prescription rules.
Returns: Result<(Order * PrescriptionRule * AccessDevice), (Order * PrescriptionRule * Message list)>[]
Only the Ok results: each order with its rule and access device.
|
Makes the orders of the prescription rules and calculates them in parallel. A medication that cannot become an order is logged and left out.
|
|
Splits a component limit into one limit per Divisible, solvent and predilution of its products, sorted so the scenarios come in a fixed order; the products without a Divisible come first, and within one Divisible and solvent the undiluted product comes first. A limit whose products all agree on these is not split.
|
Full Usage:
pickedGroups products groups
Parameters:
string array
groups : PrescriptionRule array
Returns: PrescriptionRule array
|
Returns the split rules in which every component limit with products holds a picked product. Returns all split rules when none does, so a pick of another medication hides nothing.
|
|
|
Full Usage:
processEvaluationResults isAdditive fitsOnlyWithoutDivisible prs
Parameters:
GPK -> bool
fitsOnlyWithoutDivisible : bool
prs : Result<(Order * PrescriptionRule * AccessDevice), ('a * 'b * 'c)> array
Returns: OrderScenario array
Type parameters: 'a, 'b, 'c |
|
Full Usage:
splitByDivisible addFormLimits pr
Parameters:
DoseRule -> DoseRule
pr : PrescriptionRule
Returns: PrescriptionRule[]
|
Splits a prescription rule into one rule per combination of the Divisible groups of its component limits, so a product does not take the increment of another product. Each split rule gets its own form limits, such as the drop size, from addFormLimits. A rule whose component limits are not split stays as it is.
|
GenPRES