Logo GenPRES

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

changeRuleProductsDivisible pr

Full Usage: changeRuleProductsDivisible pr

Parameters:
Returns: PrescriptionRule

evaluateOrder logger pr order

Full Usage: evaluateOrder logger pr order

Parameters:
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.

logger : 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.

evaluateRules start logger prs

Full Usage: evaluateRules start logger prs

Parameters:
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.

start : 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.

limitsByDivisible cl

Full Usage: limitsByDivisible cl

Parameters:
Returns: ComponentLimit[]

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.

cl : ComponentLimit
Returns: ComponentLimit[]

pickedGroups products groups

Full Usage: pickedGroups products groups

Parameters:
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.

products : string array
groups : PrescriptionRule array
Returns: PrescriptionRule array

printOrder ord

Full Usage: printOrder ord

Parameters:
Returns: Order
ord : Order
Returns: Order

processEvaluationResults isAdditive fitsOnlyWithoutDivisible prs

Full Usage: processEvaluationResults isAdditive fitsOnlyWithoutDivisible prs

Parameters:
Returns: OrderScenario array
Type parameters: 'a, 'b, 'c
isAdditive : GPK -> bool
fitsOnlyWithoutDivisible : bool
prs : Result<(Order * PrescriptionRule * AccessDevice), ('a * 'b * 'c)> array
Returns: OrderScenario array

splitByDivisible addFormLimits pr

Full Usage: splitByDivisible addFormLimits pr

Parameters:
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.

addFormLimits : DoseRule -> DoseRule
pr : PrescriptionRule
Returns: PrescriptionRule[]

Type something to start searching.