Logo GenPRES

Orderable.Component Module

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

Nested modules

Modules Description

Dto

Holds the serializable shapes of a component and of its products, and converts a component to and from the component Dto.

Print

Prints the quantities, the counts, the concentration and the dose values of a component as plain text or Markdown.

Functions and values

Function or value Description

Component.apply f comp

Full Usage: Component.apply f comp

Parameters:
Returns: 'a
Type parameters: 'a

Apply f to a Component comp

f : Component -> 'a
comp : Component
Returns: 'a

Component.applyConstraints cmp

Full Usage: Component.applyConstraints cmp

Parameters:
Returns: Component

Apply constraints to a Component

cmp : Component

The Component

Returns: Component

Component.applyToAllItems

Full Usage: Component.applyToAllItems

Returns: (Item -> Item) -> Component -> Component
Returns: (Item -> Item) -> Component -> Component

Component.applyToItem s

Full Usage: Component.applyToItem s

Parameters:
    s : string

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

Component.applyToItems pred f cmp

Full Usage: Component.applyToItems pred f cmp

Parameters:
Returns: Component
pred : Item -> bool
f : Item -> Item
cmp : Component
Returns: Component

Component.commonValues vals vu

Full Usage: Component.commonValues vals vu

Parameters:
Returns: ValueUnit

The values of vals that are also values of vu; no values when the two differ in unit group.

vals : ValueUnit
vu : ValueUnit
Returns: ValueUnit

Component.concentrations setsBack cmp

Full Usage: Component.concentrations setsBack cmp

Parameters:
Returns: Component list

Returns the component once per combination of item concentrations, with the items fixed to that combination. With products, a combination is the strengths of one or more products with the same strengths, and the component quantity is fixed to their form quantities. Without products, the combinations come from the value lists of the item concentrations. A combination is left out when it leaves no value for a variable that setsBack does not set back.

setsBack : OrderVariable -> bool
cmp : Component
Returns: Component list

Component.create id nm frm cmp_qty orb_qty orb_qty_adj orb_cnt ord_qty ord_cnt orb_cnc dos ii

Full Usage: Component.create id nm frm cmp_qty orb_qty orb_qty_adj orb_cnt ord_qty ord_cnt orb_cnc dos ii

Parameters:
    id : Id - The Id of the Component
    nm : Name - The name of the Component
    frm : string - The form of the Component
    cmp_qty : Quantity - The quantity of the Component
    orb_qty : Quantity - The quantity of the Component in the Orderable
    orb_qty_adj : QuantityAdjust - The quantity of the Component in the Orderable per adjust unit
    orb_cnt : Count - The count of the Component in the Orderable
    ord_qty : Quantity - The quantity of the Component in the Order
    ord_cnt : Count - The count of the Component in the Order
    orb_cnc : Concentration - The concentration of the Component in the Orderable
    dos : Dose - The dose of the Component
    ii : Item list - The list of Items in the Component

Returns: Component

Creates a component without products from its order variables, dose and items.

id : Id

The Id of the Component

nm : Name

The name of the Component

frm : string

The form of the Component

cmp_qty : Quantity

The quantity of the Component

orb_qty : Quantity

The quantity of the Component in the Orderable

orb_qty_adj : QuantityAdjust

The quantity of the Component in the Orderable per adjust unit

orb_cnt : Count

The count of the Component in the Orderable

ord_qty : Quantity

The quantity of the Component in the Order

ord_cnt : Count

The count of the Component in the Order

orb_cnc : Concentration

The concentration of the Component in the Orderable

dos : Dose

The dose of the Component

ii : Item list

The list of Items in the Component

Returns: Component

Component.createNew id orbN cmpN frm

Full Usage: Component.createNew id orbN cmpN frm

Parameters:
    id : string - The Id of the Component
    orbN : string - The name of the Orderable
    cmpN : string - The name of the Component
    frm : string - The form of the Component

Returns: Component

Creates a component without items, with every order variable without a unit.

id : string

The Id of the Component

orbN : string

The name of the Orderable

cmpN : string

The name of the Component

frm : string

The form of the Component

Returns: Component

Component.fromOrdVars ovars cmp

Full Usage: Component.fromOrdVars ovars cmp

Parameters:
Returns: Component

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

ovars : OrderVariable list

The list of OrderVariables

cmp : Component

The old Component

Returns: Component

Component.getDose cmp

Full Usage: Component.getDose cmp

Parameters:
Returns: Dose

Get the Component dose

cmp : Component
Returns: Dose

Component.getItems cmp

Full Usage: Component.getItems cmp

Parameters:
Returns: Item list

Get the Items in an Component

cmp : Component
Returns: Item list

Component.getName cmp

Full Usage: Component.getName cmp

Parameters:
Returns: Name

Get the name of a Component

cmp : Component
Returns: Name

Component.hasItem itm

Full Usage: Component.hasItem itm

Parameters:
    itm : string

Returns: Component -> bool
itm : string
Returns: Component -> bool

Component.inf

Full Usage: Component.inf

Returns: Component -> Component

Utility to facilitate type inference

Returns: Component -> Component

Component.isDoseConstrained cmp

Full Usage: Component.isDoseConstrained cmp

Parameters:
Returns: bool

Whether the rules constrain the dose of a component or the dose of one of its items. When they do not, these doses only follow from the other variables, and no recalculation applies to them.

cmp : Component
Returns: bool

Component.isDoseSolved

Full Usage: Component.isDoseSolved

Returns: Component -> bool
Returns: Component -> bool

Component.isItemsDoseSolved

Full Usage: Component.isItemsDoseSolved

Returns: Component -> bool
Returns: Component -> bool

Component.isSolved

Full Usage: Component.isSolved

Returns: Component -> bool
Returns: Component -> bool

Component.narrowToProducts cmp

Full Usage: Component.narrowToProducts cmp

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

Narrows the item concentrations and the component quantity to the values of the products that apply. Returns whether a value was removed, with the component. A component without products is returned unchanged; a component with products of which none applies is an error.

cmp : Component
Returns: Result<(bool * Component), string>

Component.pickNearestHigherElseLower cmp

Full Usage: Component.pickNearestHigherElseLower cmp

Parameters:
Returns: Component
cmp : Component
Returns: Component

Component.productApplies cmp p

Full Usage: Component.productApplies cmp p

Parameters:
Returns: bool

Whether a product applies to the values of a component: each strength of the product is among the concentration values of the item of that substance, and one of its form quantities is among the values of the component quantity. A variable without a value set excludes no product.

cmp : Component
p : ComponentProduct
Returns: bool

Component.productsThatApply cmp

Full Usage: Component.productsThatApply cmp

Parameters:
Returns: ComponentProduct list

The products of a component that apply to its values.

cmp : Component
Returns: ComponentProduct list

Component.setDoseUnit sn du

Full Usage: Component.setDoseUnit sn du

Parameters:
    sn : string
    du : Unit

Returns: Component -> Component
sn : string
du : Unit
Returns: Component -> Component

Component.toOrdVars cmp

Full Usage: Component.toOrdVars cmp

Parameters:
Returns: OrderVariable list

Return a Component as a list of OrderVariables

cmp : Component

The Component

Returns: OrderVariable list

Component.toString

Full Usage: Component.toString

Returns: Component -> string list

Create a string list from a Component where each string is a variable name with the value range and the Unit

Returns: Component -> string list

Component.tryItem itm

Full Usage: Component.tryItem itm

Parameters:
    itm : string

Returns: Component -> Item option

The item of a component with the name itm.

itm : string
Returns: Component -> Item option

Type something to start searching.