Logo GenPRES

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

build start med

Full Usage: build start med

Parameters:
Returns: Order

Builds an Order from a Medication: the shape, and then every constraint. The caller gives the start in UTC.

start : DateTime
med : Medication
Returns: Order

componentDivisibility pc med

Full Usage: componentDivisibility pc med

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

pc : ProductComponent
med : Medication
Returns: ValueUnit option

divisibility med

Full Usage: divisibility med

Parameters:
Returns: ValueUnit option

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.

med : Medication
Returns: ValueUnit option

frequencyTimeUnit med

Full Usage: frequencyTimeUnit med

Parameters:
Returns: Unit option

The time unit a frequency is counted over: the denominator of its unit.

med : Medication
Returns: Unit option

mapComponents f med ord

Full Usage: mapComponents f med ord

Parameters:
Returns: Order

Applies f to every component of the medication and the order component at the same position.

f : ProductComponent -> Component -> Component
med : Medication
ord : Order
Returns: Order

mapItems f med ord

Full Usage: mapItems f med ord

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

f : ProductComponent -> SubstanceItem -> Item -> Item
med : Medication
ord : Order
Returns: Order

newOrder start med

Full Usage: newOrder start med

Parameters:
Returns: Order

Creates an empty order for the medication with its schedule, id, name and route, without components. The caller gives the start in UTC.

start : DateTime
med : Medication
Returns: Order

orderableUnit med

Full Usage: orderableUnit med

Parameters:
Returns: Unit option

Returns the unit of the orderable, which is the unit of the quantities of the first component.

med : Medication
Returns: Unit option

scheduleOf med

Full Usage: scheduleOf med

Parameters:
Returns: Name -> Schedule

Creates the empty schedule for the order type of the medication. Raises a NotSupportedException for AnyOrder and ProcessOrder, which have no schedule.

med : Medication
Returns: Name -> Schedule

singleOrNone u br

Full Usage: singleOrNone u br

Parameters:
Returns: ValueUnit option

Returns a single value in a unit, or None when the unit is NoUnit.

u : Unit
br : RationalX
Returns: ValueUnit option

valuesOrNone u brs

Full Usage: valuesOrNone u brs

Parameters:
Returns: ValueUnit option

Returns the values in a unit, or None when the unit is NoUnit.

u : Unit
brs : RationalX[]
Returns: ValueUnit option

withAdjustment med ord

Full Usage: withAdjustment med ord

Parameters:
Returns: Order

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.

med : Medication
ord : Order
Returns: Order

withComponentConstraints med ord

Full Usage: withComponentConstraints med ord

Parameters:
Returns: Order

Every constraint a component carries.

med : Medication
ord : Order
Returns: Order

withComponentDilutionLimit single dilutionLimit cmp

Full Usage: withComponentDilutionLimit single dilutionLimit cmp

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

single : bool
dilutionLimit : DilutionLimit
cmp : Component
Returns: Component

withComponentDose med pc cmp

Full Usage: withComponentDose med pc cmp

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

med : Medication
pc : ProductComponent
cmp : Component
Returns: Component

withComponentQtyConc med pc cmp

Full Usage: withComponentQtyConc med pc cmp

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

med : Medication
pc : ProductComponent
cmp : Component
Returns: Component

withComponents med ord

Full Usage: withComponents med ord

Parameters:
Returns: Order

Adds the components of the medication and their items to the order, with empty order variables and no constraints.

med : Medication
ord : Order
Returns: Order

withDoseCount ord

Full Usage: withDoseCount ord

Parameters:
Returns: Order

Sets the dose count to 1 when the rules give it no constraints, as for a solution rule without a minimum and a maximum dose fraction. A count is created above 0, which is not a constraint.

ord : Order
Returns: Order

withItemConstraints med ord

Full Usage: withItemConstraints med ord

Parameters:
Returns: Order

Every constraint an item carries.

med : Medication
ord : Order
Returns: Order

withItemDilution dilutionLimit itm

Full Usage: withItemDilution dilutionLimit itm

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

dilutionLimit : DilutionLimit
itm : Item
Returns: Item

withItemDose med si itm

Full Usage: withItemDose med si itm

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

med : Medication
si : SubstanceItem
itm : Item
Returns: Item

withItemQtyConc med si itm

Full Usage: withItemQtyConc med si itm

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

med : Medication
si : SubstanceItem
itm : Item
Returns: Item

withOrderCount med ord

Full Usage: withOrderCount med ord

Parameters:
Returns: Order

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.

med : Medication
ord : Order
Returns: Order

withOrderableConstraints med ord

Full Usage: withOrderableConstraints med ord

Parameters:
Returns: Order

Every constraint the orderable carries.

med : Medication
ord : Order
Returns: Order

withOrderableDose med ord

Full Usage: withOrderableDose med ord

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

med : Medication
ord : Order
Returns: Order

withOrderableQuantity med ord

Full Usage: withOrderableQuantity med ord

Parameters:
Returns: Order

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.

med : Medication
ord : Order
Returns: Order

withPrescription med ord

Full Usage: withPrescription med ord

Parameters:
Returns: Order

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.

med : Medication
ord : Order
Returns: Order

Type something to start searching.