Order Module
Creates, solves, checks and prints an order: an orderable given on a schedule by a route, with a start date and an optional stop date.
Types and nested modules
| Type/Module | Description |
|
Holds the serializable shape of an order, converts an order to and from the Dto and creates a new order Dto for each schedule kind. Reading a Dto returns OrderCouldNotBeCreated when it fails. |
|
|
Applies property changes to an order: a function on the frequency, the time, the adjust value, or a variable of the orderable, component or item. |
|
|
Lists the order types, returns the name of an order type and maps a Dutch dose type text to an order type, DiscontinuousOrder when unknown. |
|
|
Creates, changes, checks and prints an orderable, which holds the components, the quantities and the dose of what is ordered. |
|
|
Prints an order as prescription, preparation and administration, as rows of text blocks or as text, with the reconstitution and predilution of its product. |
|
|
Creates a once, once timed, continuous, discontinuous or timed schedule and reads, changes, checks and prints its frequency and time. |
|
|
Formats the start date, or the start and stop dates, of an order as text in the form dd-MM-yy. |
|
|
Holds the default maximum numbers of values a pruned variable keeps and returns the maximum for an order by its schedule and number of components. |
|
|
|
|
|
The maximum number of values a pruned variable keeps, per schedule. The Max caps apply with useMaxNumberOfValues. |
Functions and values
| Function or value |
Description
|
||
|
|||
|
|||
|
|||
|
|||
|
Check whether every OrderVariable in an Order is unrestricted or only restricted to values above zero
|
||
|
Whether the norm dose can be set: the dose quantity, or the dose rate of a continuous order, has a value set.
|
||
Full Usage:
checkConstraints useCalc
Parameters:
bool
Returns: Order -> OrderVariable list
|
Check whether there are OrderVariables in an Order that are not within their constraints and return those OrderVariables
|
||
Full Usage:
checkOrderDose pred op ord
Parameters:
OrderVariable -> bool
op : bool -> bool -> bool
ord : Order
Returns: bool
|
|
||
|
|||
Full Usage:
create id adj_qty orb sch rte tme sts
Parameters:
Id
-
The id of the Order
adj_qty : Quantity
-
The quantity the doses are adjusted with, such as the weight
orb : Orderable
-
The Orderable of the Order
sch : Schedule
-
The Schedule of the Order
rte : string
-
The Route of the Order
tme : Time
-
The duration of the Order
sts : StartStop
-
The StartStop of the Order
Returns: Order
|
Creates an order from its parts.
|
||
Full Usage:
createNew start id orbN nmeToSch route
Parameters:
DateTime
-
The moment the Order starts, decided by the caller, in UTC
id : string
-
The id of the Order
orbN : string
-
The name of the Orderable
nmeToSch : Name -> Schedule
-
A function to create a Schedule with a Name
route : string
-
The Route of the Order
Returns: Order
|
|||
|
|||
|
|
||
|
|
||
|
The equation mapping for the schedule of an order.
|
||
|
An order variable that only the equations use, with the maximum max and the values vs as its constraints. The order does not hold it.
|
||
|
The equations of an order, from the equation mapping of its schedule.
|
||
Full Usage:
fromOrdVars ovars ord
Parameters:
OrderVariable list
-
The list of OrderVariables
ord : Order
-
The old Order
Returns: Order
|
Create a new Order from a list of OrderVariables using an old Order.
|
||
|
|||
|
|||
|
Whether the order has at most two components; only these orders get value lists.
|
||
|
Check whether at least one OrderVariable in an Order has constraints
|
||
|
|
||
|
|
||
|
Raises the increment of the orderable dose quantity to a step in incrs that is a multiple of the increment of the orderable quantity. This applies only when the dose count has no value set. With a value set, the dose quantity is the orderable quantity divided by the dose count and follows the increment of the components. A dose quantity that already has at most maxCount values keeps its increment.
|
||
|
Raises the increment of the orderable quantity and the component quantities, then the increment of the dose quantity, and solves for the minimum and maximum after each step. Fewer possible values make the calculation faster. A continuous order, and an order with an orderable quantity in a unit that is not a volume, are returned unchanged. When a step cannot be solved, the order before that step is returned. |
||
|
Sets the orderable quantity and the component orderable quantities of an order to one increment from incrs, so that each component quantity has at most maxCount values when possible.
|
||
|
Check whether every component orderable quantity is solved, so the composition of the preparation is set.
|
||
|
Whether the orders per concentration can be joined without a range on an increment that holds values none of the orders allows. That holds when each variable has the same range in every order, or when each of its ranges with a minimum, an increment and a maximum can be turned into a list of at most maxCount values. A value list and a range without an increment need no check.
|
||
|
Whether the order holds a dose count of 1, so that the whole preparation is one dose.
|
||
|
Check whether the orderable quantity and every component orderable quantity are within their constraints.
|
||
|
Whether the order is solved and every variable lies within its calculated constraints. A step or a percentile can leave a variable outside them; a recalculation then sets that variable back, and the values of this order are not added to the value lists of the recalculated order.
|
||
|
Whether every variable of an order that has constraints is solved. A variable without constraints is not checked. The order count is not checked either: dosing never sets how many times an order is dispensed, so the order count stays a range.
|
||
|
Check whether all OrderVariables in an Order are within their constraints
|
||
|
|||
|
The orderable quantity of the main component, the first component of the order.
|
||
Full Usage:
mapFromOrderEquations ord eqs
Parameters:
Order
-
The Order
eqs : OrderEquation list
-
The list of OrderEquations
Returns: Order
|
Map a list of OrderEquations to an Order
|
||
Full Usage:
mapOrdVars f ord
Parameters:
OrderVariable -> OrderVariable
ord : Order
Returns: Order
|
The order with every order variable mapped by f.
|
||
Full Usage:
mapToOrderEquations (arg1, arg1) ord
Parameters:
EquationMapping
arg1 : EquationMapping
ord : Order
-
The Order
Returns: OrderEquation list
A list of OrderEquations
|
Maps an order to order equations with a sum mapping and a product mapping.
|
||
Full Usage:
minIncrMaxToValues caps useMaxNumberOfValues skipRate logger original ord
Parameters:
ValueCaps
-
The maximum number of values a pruned variable keeps, per schedule
useMaxNumberOfValues : bool
-
Whether to use the larger Max caps
skipRate : bool
-
Whether to skip the orderable dose rate, to expand a timed order in stages
logger : Logger
-
The logger
original : Order option
-
An earlier order whose values are added to the value lists when it is reachable
ord : Order
-
The Order
Returns: Result<Order, (Order * Message list)>
The order with values, or the last order that solved, with the messages
|
Turns the min, incr and max ranges of the component orderable quantities, the orderable dose quantity and the orderable dose rate into value lists, one variable at a time, and solves the order after each. The component quantities, the dose quantity and the rate are pruned to rounded steps. The time of a timed order is left free, so the rate determines how long the dose quantity runs.
|
||
The value 1 times.
|
|||
|
The share of the orderable in itself: the constant value 1 times, which the shares of the components add up to.
|
||
Full Usage:
pickId id reconstitution predilution
Parameters:
string
reconstitution : ComponentReconstitution option
predilution : ComponentPredilution option
Returns: string
|
The id of a product in a product pick: the product id, followed by the solvent of its reconstitution and then by its predilution, such as "185663 water 3 mL + 7 mL gluc 5%", so that two reconstitutions or two predilutions of one product have different ids. The id uses the display text of the volumes, so a change of that text changes the stored pick ids.
|
||
|
The predilution of the first component of an order as text, such as "3 mL verdund met 7 mL gluc 5%". Returns None when not exactly one product of that component applies or that product is not pre-diluted.
|
||
Full Usage:
predilutionToString word pd
Parameters:
string
pd : ComponentPredilution
Returns: string
|
The product volume, the word, the diluent volume and the diluent of a predilution, such as "3 mL verdund met 7 mL gluc 5%".
|
||
|
|||
|
|||
|
|||
|
|||
|
The pick ids of the products that apply to the values of the components of an order.
|
||
|
The rounded steps a pruned quantity or rate keeps the multiples of, in mL and in mL/uur.
|
||
|
The increments a quantity in mL is raised along.
|
||
|
The rounded steps of a quantity in mL, up to 50 mL.
|
||
The rounded steps of a rate in mL/uur, up to 10 mL/uur.
|
|||
|
Whether the rate of the order waits for its dose quantity: the rate of a timed or once timed order gets its values only once the dose quantity has one value.
|
||
|
The reconstitution of the first component of an order as text, such as "10 mL NaCl 0,9%". Returns None when not exactly one product of that component applies or that product is not reconstituted.
|
||
|
|||
|
The schedule count: the administration time times the frequency, at most 1 times, so that one administration ends before the next starts. Only the equations of a timed order use it.
|
||
|
|||
|
|||
|
|||
Full Usage:
solve msg minMax printErr logger ord
Parameters:
string
-
A message for logging
minMax : bool
-
Whether to solve only for the minimum and maximum
printErr : bool
-
Whether to print the error
logger : Logger
-
The logger
ord : Order
-
The Order
Returns: Result<Order, (Order * Message list)>
The solved Order, or the Order with the error messages. An exception of the solver is returned as
an UnexpectedException message.
|
Solves an order. After each solve the item concentrations are narrowed to the products that apply, and the order is solved again when that removed a value. |
||
Full Usage:
splitPerConcentration maxCount setsBack ord
Parameters:
int
setsBack : OrderVariable -> bool
ord : Order
Returns: Order list
|
Returns the order once per combination of the item concentrations of its components. Returns the order alone when there is at most one combination or more than maxCount.
|
||
|
|||
|
|
||
|
|
||
|
|||
|
Return an Order as a list of strings where each string is a variable name with the value range and the Unit
|
||
|
Return an Order as a list of strings where each string is a variable name with the value range, the Unit and the constraints
|
||
|
|||
|
|||
|
|||
|
Copies the defined constraints from built, an order built from the same rule with the same id, to the variables of ord with the same name. A variable that built does not have keeps its constraints. The adjust quantity always keeps its own constraints, and so do the preparation variables when the dose count is not 1.
|
||
Full Usage:
withVariablesOf take from ord
Parameters:
OrderVariable -> OrderVariable -> OrderVariable
from : Order
ord : Order
Returns: Order
|
The order with each variable taken over by take from the variable with the same name in from. A variable that from does not have stays as it is.
|
||
|
GenPRES