OrderAction Module
Returns the effects of an action on an order and runs the action, once per combination of concentrations when a component has several concentrations.
Functions and values
| Function or value |
Description
|
Full Usage:
effects action ord
Parameters:
OrderAction
ord : Order
Returns: Result<OrderEffect list, ActionFailure>
|
Returns the effects of an action on the order. Returns NoSuchVariable for a reference the order does not have, and NoRecipe for an action without a recipe.
|
|
Whether an order gets the median preset: a timed or once timed order with at least minPresetComponents components, each with one concentration. An order with a component that has more than one concentration does not, because the prescriber chooses the concentration first.
|
|
Whether an order got the median preset when it was made: the check of getsPreset on the order with every variable set back to its defined constraints. The calculation of the min and max can leave a single concentration of a component, and the order then still gets no preset after a reset or a recalculation.
|
Full Usage:
maxConcentrations
Returns: int
|
The maximum number of concentration combinations for which an order is solved one by one. Above it the order is solved once, with every concentration.
|
Full Usage:
maxUnionValues
Returns: int
|
The maximum number of values that the union of the orders per concentration lists. Above it the union is a range.
|
|
The effect that sets the dose rate to its median and solves the order for min and max, unless the dose quantity is not a single value. When the median cannot be set, the order stays as it was.
|
Full Usage:
minPresetComponents
Returns: int
|
The smallest number of components a timed or once timed order has to get the median preset.
|
|
Returns the effects that preset an order that gets the median preset, so that the order is solved when it is shown. The orderable quantity of each component is set to its median, in the order of the components, and the order is solved for min and max after each one. When a component quantity cannot be set to a median, the order stays as it was. The dose rate is then set to its median, unless the dose quantity is not a single value at that time. Returns no effects for any other order.
|
Full Usage:
run caps logger action ord
Parameters:
ValueCaps
logger : Logger
action : OrderAction
ord : Order
Returns: Result<Order, (Order * ActionFailure)>
|
Runs an action. A failure returns the order as it was before the action. When a component has more than one concentration, the action runs once per combination of concentrations, in parallel, with the effects decided on the original order. The result is the union of the runs that succeed, so no value of one concentration is combined with a value of another. When every run fails, the first failure is returned. When the union cannot be listed, the action runs on the whole order.
|
GenPRES