Logo GenPRES

Orderable Module

Creates, changes, checks and prints an orderable, which holds the components, the quantities and the dose of what is ordered.

Types and nested modules

Type/Module Description

Component

Creates, changes and checks a component of an orderable, with its items, quantities, counts, concentration, dose and products.

Dose

Creates a dose from its quantity, per time, rate and total variables, plain and adjusted, and applies constraints to and checks the dose variables.

Dto

Holds the serializable shape of an orderable and converts an orderable to and from the Dto.

Item

Creates, changes and checks an item, a substance in a component, with its quantities, concentrations and dose.

Print

Prints the orderable quantity, the order quantity, the order count and the dose values of an orderable as plain text or Markdown.

Name

Functions and values

Function or value Description

Orderable.apply f orb

Full Usage: Orderable.apply f orb

Parameters:
Returns: 'a
Type parameters: 'a

Apply f to Orderable ord

f : Orderable -> 'a
orb : Orderable
Returns: 'a

Orderable.applyConstraints orb

Full Usage: Orderable.applyConstraints orb

Parameters:
Returns: Orderable

Apply constraints to an Orderable

orb : Orderable

The Orderable

Returns: Orderable

Orderable.applyToAllComponents

Full Usage: Orderable.applyToAllComponents

Returns: (Component -> Component) -> Orderable -> Orderable

Orderable.applyToComponent s

Full Usage: Orderable.applyToComponent s

Parameters:
    s : string

Returns: (Component -> Component) -> Orderable -> Orderable
s : string
Returns: (Component -> Component) -> Orderable -> Orderable

Orderable.applyToComponents pred f orb

Full Usage: Orderable.applyToComponents pred f orb

Parameters:
Returns: Orderable
pred : Component -> bool
f : Component -> Component
orb : Orderable
Returns: Orderable

Orderable.create n orb_qty orb_qty_adj ord_qty ord_cnt dos_cnt dos cc

Full Usage: Orderable.create n orb_qty orb_qty_adj ord_qty ord_cnt dos_cnt dos cc

Parameters:
    n : Name - The name of the Orderable
    orb_qty : Quantity - The quantity of the Orderable
    orb_qty_adj : QuantityAdjust - The quantity of the Orderable per adjust unit
    ord_qty : Quantity - The quantity of the Orderable in the Order
    ord_cnt : Count - The count of the Orderable in the Order
    dos_cnt : Count - The count of the Orderable dose in the Order
    dos : Dose - The dose of the Orderable
    cc : Component list - The list of Components in the Orderable

Returns: Orderable

Creates an orderable from its order variables, its dose and its components.

n : Name

The name of the Orderable

orb_qty : Quantity

The quantity of the Orderable

orb_qty_adj : QuantityAdjust

The quantity of the Orderable per adjust unit

ord_qty : Quantity

The quantity of the Orderable in the Order

ord_cnt : Count

The count of the Orderable in the Order

dos_cnt : Count

The count of the Orderable dose in the Order

dos : Dose

The dose of the Orderable

cc : Component list

The list of Components in the Orderable

Returns: Orderable

Orderable.createNew id orbN

Full Usage: Orderable.createNew id orbN

Parameters:
    id : string - The Id of the Orderable
    orbN : string - The name of the Orderable

Returns: Orderable

Creates an orderable without components, with every order variable without a unit.

id : string

The Id of the Orderable

orbN : string

The name of the Orderable

Returns: Orderable

Orderable.fromOrdVars ovars orb

Full Usage: Orderable.fromOrdVars ovars orb

Parameters:
Returns: Orderable The new Orderable

Create a new Orderable from a list of OrderVariables using an old Orderable.

ovars : OrderVariable list

The list of OrderVariables

orb : Orderable

The old Orderable

Returns: Orderable

The new Orderable

Orderable.getComponents orb

Full Usage: Orderable.getComponents orb

Parameters:
Returns: Component list

Get the Components in an Orderable

orb : Orderable
Returns: Component list

Orderable.getDose orb

Full Usage: Orderable.getDose orb

Parameters:
Returns: Dose

Get the Orderable dose

orb : Orderable
Returns: Dose

Orderable.getName orb

Full Usage: Orderable.getName orb

Parameters:
Returns: Name

Get the name of the Orderable

orb : Orderable
Returns: Name

Orderable.hasComponent cmp

Full Usage: Orderable.hasComponent cmp

Parameters:
    cmp : string

Returns: Orderable -> bool
cmp : string
Returns: Orderable -> bool

Orderable.hasMaxDoseQuantityConstraint

Full Usage: Orderable.hasMaxDoseQuantityConstraint

Returns: Orderable -> bool
Returns: Orderable -> bool

Orderable.increaseQuantityIncrement logger maxCount incrs orb

Full Usage: Orderable.increaseQuantityIncrement logger maxCount incrs orb

Parameters:
    logger : Logger - The logger
    maxCount : RationalX - The maximum number of values
    incrs : Increment list - The increments to choose from
    orb : Orderable - The Orderable

Returns: Orderable

Sets the orderable quantity and every component orderable quantity to one increment from incrs: the smallest on which every component quantity has at most maxCount values, else the largest on which every quantity keeps at least two values. The orderable is unchanged when the component quantities already have at most maxCount values, or when no increment in incrs fits.

logger : Logger

The logger

maxCount : RationalX

The maximum number of values

incrs : Increment list

The increments to choose from

orb : Orderable

The Orderable

Returns: Orderable

Orderable.inf

Full Usage: Orderable.inf

Returns: Orderable -> Orderable

Utility function to facilitate type inference

Returns: Orderable -> Orderable

Orderable.isComponentsDoseSolved

Full Usage: Orderable.isComponentsDoseSolved

Returns: Orderable -> bool
Returns: Orderable -> bool

Orderable.isDoseSolved

Full Usage: Orderable.isDoseSolved

Returns: Orderable -> bool
Returns: Orderable -> bool

Orderable.isItemsDoseSolved

Full Usage: Orderable.isItemsDoseSolved

Returns: Orderable -> bool
Returns: Orderable -> bool

Orderable.isSolved

Full Usage: Orderable.isSolved

Returns: Orderable -> bool
Returns: Orderable -> bool

Orderable.narrowToProducts orb

Full Usage: Orderable.narrowToProducts orb

Parameters:
Returns: Result<(bool * Orderable), string list>

Narrows each component to the values of the products that apply. Returns whether a value was removed, with the orderable, or an error for each component of which no product applies.

orb : Orderable
Returns: Result<(bool * Orderable), string list>

Orderable.setDoseUnit sn du orb

Full Usage: Orderable.setDoseUnit sn du orb

Parameters:
Returns: Orderable
sn : string
du : Unit
orb : Orderable
Returns: Orderable

Orderable.toOrdVars orb

Full Usage: Orderable.toOrdVars orb

Parameters:
Returns: OrderVariable list

Return an Orderable as a list of OrderVariables

orb : Orderable

The Orderable

Returns: OrderVariable list

Orderable.toString

Full Usage: Orderable.toString

Returns: Orderable -> string list

Return a list of strings from an Orderable where each string is a variable name with the value range and the Unit

Returns: Orderable -> string list

Orderable.toStringWithConstraints

Full Usage: Orderable.toStringWithConstraints

Returns: Orderable -> string list
Returns: Orderable -> string list

Orderable.tryComponent cmp

Full Usage: Orderable.tryComponent cmp

Parameters:
    cmp : string

Returns: Orderable -> Component option

The component of an orderable with the name cmp.

cmp : string
Returns: Orderable -> Component option

Type something to start searching.