OrderBuilder Module
Builds an order from a medication: first the structure, then one pass for each kind of constraint, each pass changing only its own part.
Functions and values
| Function or value |
Description
|
|
Builds an Order from a Medication: the shape, and then every constraint. The caller gives the start in UTC.
|
Full Usage:
componentDivisibility pc med
Parameters:
ProductComponent
med : Medication
Returns: ValueUnit option
|
The step for a component. A component in another unit group than the step gets no step. An order of such a medication is refused before it is built, because the components add up to the orderable.
|
|
The smallest step a product can be divided into. With a Div on the medication the step is 1 divided by the Div, in the unit of the orderable. Without a Div the step is the coarsest of 1 divided by the Divisible of each component in the unit group of the orderable, compared in base units. A Div or Divisible of zero or less gives no step. Without a step, the orderable dose quantity and the component orderable quantity take any value within their limits, and the order has no preparation and says so.
|
|
The time unit a frequency is counted over: the denominator of its unit.
|
Full Usage:
mapComponents f med ord
Parameters:
ProductComponent -> Component -> Component
med : Medication
ord : Order
Returns: Order
|
Applies f to every component of the medication and the order component at the same position.
|
Full Usage:
mapItems f med ord
Parameters:
ProductComponent -> SubstanceItem -> Item -> Item
med : Medication
ord : Order
Returns: Order
|
Applies f to every substance item of the medication and the order item at the same position. Both lists come from the same medication, so List.zip raises an exception on a length mismatch, which stops the build rather than constrain the wrong item.
|
|
Creates an empty order for the medication with its schedule, id, name and route, without components. The caller gives the start in UTC.
|
|
Returns the unit of the orderable, which is the unit of the quantities of the first component.
|
|
Creates the empty schedule for the order type of the medication. Raises a NotSupportedException for AnyOrder and ProcessOrder, which have no schedule.
|
|
|
|
|
|
Sets the adjust value of the medication, the weight or body surface area of the patient, on the order. A weight is bounded between 0.2 and 150 in its unit, so that a typing error cannot pass for a dose.
|
Full Usage:
withComponentConstraints med ord
Parameters:
Medication
ord : Order
Returns: Order
|
|
Full Usage:
withComponentDilutionLimit single dilutionLimit cmp
Parameters:
bool
dilutionLimit : DilutionLimit
cmp : Component
Returns: Component
|
Sets the dilution limit on a component: the values, minimum and maximum of the orderable quantity, the minimum and maximum of the orderable quantity per adjust unit, and the minimum and maximum of the orderable concentration. The only component of a medication gets no orderable concentration limit, because that component is the whole orderable.
|
Full Usage:
withComponentDose med pc cmp
Parameters:
Medication
pc : ProductComponent
cmp : Component
Returns: Component
|
Sets the dose limit of the component on its dose, by order type as withItemDose does. A dose quantity without a limit still gets a unit, so that it can be added up with the others.
|
Full Usage:
withComponentQtyConc med pc cmp
Parameters:
Medication
pc : ProductComponent
cmp : Component
Returns: Component
|
Sets the component quantities, the step of the orderable quantity and an orderable concentration of at most 1 on a component; the only component gets exactly 1 and the step on its dose quantity. Then sets the dilution limit of the component.
|
|
Adds the components of the medication and their items to the order, with empty order variables and no constraints.
|
|
|
|
|
Full Usage:
withItemDilution dilutionLimit itm
Parameters:
DilutionLimit
itm : Item
Returns: Item
|
Sets the dilution limit on an item: the minimum and maximum of the orderable quantity, of the orderable quantity per adjust unit and of the orderable concentration.
|
Full Usage:
withItemDose med si itm
Parameters:
Medication
si : SubstanceItem
itm : Item
Returns: Item
|
Sets the dose limit of the substance on the item dose: the rate for a continuous order, the quantity and the dose per time for a once or discontinuous order, and both for a once timed or timed order.
|
Full Usage:
withItemQtyConc med si itm
Parameters:
Medication
si : SubstanceItem
itm : Item
Returns: Item
|
Sets the component quantities and concentrations of the substance on an item, then its dilution limit. With one component the orderable is the component, so the orderable concentration gets only the concentrations that the dilution limit allows: nothing dilutes the product.
|
|
Sets the order count: exactly 1 for a once or once timed order, otherwise a whole number of at least 1. No rule sets the order count.
|
Full Usage:
withOrderableConstraints med ord
Parameters:
Medication
ord : Order
Returns: Order
|
|
|
Sets the dose limit of the medication on the orderable dose, by order type. A medication with one component and no dose limit of its own uses the dose limit of that component. A dose quantity and a dose per time without a limit still get a unit, so that they can take part in the sums.
|
|
Sets the dose count, the orderable quantity and the orderable quantity per adjust unit of the medication on the orderable. The orderable quantity gets the quantities of the medication when it has them, otherwise a minimum above zero, and then the quantity range of the medication. The orderable quantity per adjust unit gets the range per adjust unit of the medication.
|
|
Sets the frequencies and the administration time of the medication on the schedule. A once order has neither, and a continuous order has no frequency.
|
GenPRES