Logo GenPRES

OrderProcessor Module

Processes an order by a command, as an action of the order program or through a pipeline of solve steps. A failure returns the order with the solver messages; a refusal by the order program that is not a failed solve returns the order with no messages.

Types and nested modules

Type/Module Description

ActionFailure

Returns the solver messages of a failed solve, and an empty list for any other action failure.

Choice

Returns the value a choice selects from the current range of an order variable. Returns a failure when the choice is not allowed or finds no value.

CommandBridge

Maps an order command or a property command to the action of the order program. Returns None for a command that the pipeline processes.

CompleteOrder

Searches for complete orders, in which every variable has one value and every equation holds, and drops the values that a search proves no complete order reaches. The search fixes the free variables one at a time and solves the order for the minimum and the maximum after each value, so values that the equations then rule out are removed before the search tries them.

OrderAction

Returns the effects of an action on an order and runs the action, once per combination of concentrations when a component has several concentrations.

OrderCondition

Tells whether a condition, such as a dose with a single value for every variable, holds on an order.

OrderEffect

Runs the effects of an action on an order, such as setting a variable back, selecting a value or solving the order. A failed effect returns the order as it was before the effect.

OrderVariableReference

Finds the order variable that a reference names, tells whether the variable is basic for a schedule and lists the adjusted and the invariant variables.

Recipe

Returns the effects of each recipe, a step or percentile on a variable or a recalculation, and returns the recalculation recipe for a variable on the schedule of an order.

SetBackTo

Sets an order variable back to a target range, such as its calculated constraints, its defined constraints or any positive value.

SetCommand

Decides what a choice on an order variable runs: no command, a command that sets only the value, or a recipe before the value.

GenSolverExceptionMsg

OrderState

The state of an order that the guards of the pipeline steps read to decide whether a step runs.

PrescriptionKind

The schedule kind of an order, used to classify the order for the pipeline steps.

Step

A pipeline step with a name, a guard that decides from the order state whether the step runs, and a run function that returns the processed order, or the order and the solver messages.

Functions and values

Function or value Description

classify ord

Full Usage: classify ord

Parameters:
Returns: OrderState

Classify an order into an OrderState

ord : Order
Returns: OrderState

printState _arg1

Full Usage: printState _arg1

Parameters:
Returns: string
_arg1 : Order
Returns: string

processChangeProperty logger cmd ord

Full Usage: processChangeProperty logger cmd ord

Parameters:
Returns: 'a
Type parameters: 'a

Returns the order unchanged. Logs a warning for ComponentInStock, which is not implemented; the order program runs the other property commands.

logger : Logger
cmd : ChangePropertyCommand
ord : 'a
Returns: 'a

processCommandWith caps logger cmd

Full Usage: processCommandWith caps logger cmd

Parameters:
Returns: Result<Order, (Order * GenSolverExceptionMsg list)>

Runs the pipeline steps of the command, without the order program. The caps give the maximum number of values a pruned variable keeps, per schedule. Returns the processed order, or the order and the solver messages of the failed step. Throws an ArgumentException for a command that the order program runs.

caps : ValueCaps
logger : Logger
cmd : OrderCommand
Returns: Result<Order, (Order * GenSolverExceptionMsg list)>

processPipeline logger cmd

Full Usage: processPipeline logger cmd

Parameters:
Returns: Result<Order, (Order * Message list)>

Processes an order by the command, with the default caps for pruned variables.

logger : Logger
cmd : OrderCommand
Returns: Result<Order, (Order * Message list)>

processPipelineWith caps logger cmd

Full Usage: processPipelineWith caps logger cmd

Parameters:
Returns: Result<Order, (Order * Message list)>

Processes an order by the command. A command with an order program action runs as that action, any other command through its pipeline. A refusal by the order program returns no solver messages.

caps : ValueCaps
logger : Logger
cmd : OrderCommand
Returns: Result<Order, (Order * Message list)>

Active patterns

Active pattern Description

(|NoConstraintsApplied|NoValues|HasValues|DoseSolved|) ord

Full Usage: (|NoConstraintsApplied|NoValues|HasValues|DoseSolved|) ord

Parameters:
Returns: Choice<unit, unit, unit, unit>
ord : Order
Returns: Choice<unit, unit, unit, unit>

Type something to start searching.