Logo GenPRES

Orderable.Dose Module

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

Nested modules

Modules Description

Dto

Holds the serializable shape of a dose and converts a dose to and from the Dto.

Print

Prints the quantity, per time and rate of a dose, plain or adjusted, as plain text or Markdown, and the defined constraints of each as plain text.

Functions and values

Function or value Description

apply f dos

Full Usage: apply f dos

Parameters:
Returns: 'a
Type parameters: 'a

Apply f to a Dose

f : Dose -> 'a
dos : Dose
Returns: 'a

applyConstraints dos

Full Usage: applyConstraints dos

Parameters:
    dos : Dose - The Dose

Returns: Dose

Apply constraints to a Dose

dos : Dose

The Dose

Returns: Dose

applyOnlyMaxConstraints dos

Full Usage: applyOnlyMaxConstraints dos

Parameters:
    dos : Dose - The Dose

Returns: Dose

Applies only the max constraints to every variable of a dose.

dos : Dose

The Dose

Returns: Dose

applyPerTimeConstraints dos

Full Usage: applyPerTimeConstraints dos

Parameters:
Returns: Dose

Apply per time constraints to a Dose

dos : Dose
Returns: Dose

applyQuantityAdjustConstraints dos

Full Usage: applyQuantityAdjustConstraints dos

Parameters:
Returns: Dose

Apply only quantity adjust constraints to a Dose

dos : Dose
Returns: Dose

applyQuantityConstraints dos

Full Usage: applyQuantityConstraints dos

Parameters:
Returns: Dose

Apply quantity constraints to a Dose

dos : Dose
Returns: Dose

applyQuantityMaxConstraints dos

Full Usage: applyQuantityMaxConstraints dos

Parameters:
Returns: Dose

Apply only max quantity constraints to a Dose

dos : Dose
Returns: Dose

applyQuantityMinIncrConstraints dos

Full Usage: applyQuantityMinIncrConstraints dos

Parameters:
Returns: Dose

Applies only the min and increment constraints to the dose quantity, and restricts the adjusted dose quantity to values above zero.

dos : Dose
Returns: Dose

create qty ptm rte tot qty_adj ptm_adj rte_adj tot_adj

Full Usage: create qty ptm rte tot qty_adj ptm_adj rte_adj tot_adj

Parameters:
    qty : Quantity - The quantity of the dose
    ptm : PerTime - The per time of the dose
    rte : Rate - The rate of the dose
    tot : Total - The total of the dose
    qty_adj : QuantityAdjust - The quantity adjust of the dose
    ptm_adj : PerTimeAdjust - The per time adjust of the dose
    rte_adj : RateAdjust - The rate adjust of the dose
    tot_adj : TotalAdjust - The total adjust of the dose

Returns: Dose

Creates a dose from its order variables.

qty : Quantity

The quantity of the dose

ptm : PerTime

The per time of the dose

rte : Rate

The rate of the dose

tot : Total

The total of the dose

qty_adj : QuantityAdjust

The quantity adjust of the dose

ptm_adj : PerTimeAdjust

The per time adjust of the dose

rte_adj : RateAdjust

The rate adjust of the dose

tot_adj : TotalAdjust

The total adjust of the dose

Returns: Dose

createNew n

Full Usage: createNew n

Parameters:
    n : Name - The name of the dose

Returns: Dose

Creates a dose named after n, with every order variable without a unit.

n : Name

The name of the dose

Returns: Dose

fromOrdVars ovars dos

Full Usage: fromOrdVars ovars dos

Parameters:
Returns: Dose

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

ovars : OrderVariable list

The list of OrderVariables

dos : Dose

The old Dose

Returns: Dose

hasQuantityMaxConstraint dos

Full Usage: hasQuantityMaxConstraint dos

Parameters:
Returns: bool

Check if the quantity or quantityAdjust of a Dose has a max constraint

dos : Dose
Returns: bool

inf

Full Usage: inf

Returns: Dose -> Dose

Utility method to facilitate type inference

Returns: Dose -> Dose

isConstrained dos

Full Usage: isConstrained dos

Parameters:
Returns: bool

Whether the rules constrain a dose: one of its dose variables has defined constraints.

dos : Dose
Returns: bool

isPerTimeWithinConstraints useCalc dos

Full Usage: isPerTimeWithinConstraints useCalc dos

Parameters:
    useCalc : bool
    dos : Dose

Returns: bool
useCalc : bool
dos : Dose
Returns: bool

isQuantityWithinConstraints useCalc dos

Full Usage: isQuantityWithinConstraints useCalc dos

Parameters:
    useCalc : bool
    dos : Dose

Returns: bool
useCalc : bool
dos : Dose
Returns: bool

isRateWithinConstraints useCalc dos

Full Usage: isRateWithinConstraints useCalc dos

Parameters:
    useCalc : bool
    dos : Dose

Returns: bool
useCalc : bool
dos : Dose
Returns: bool

isSolved

Full Usage: isSolved

Returns: Dose -> bool True if all variables are solved, false otherwise

Check if all variables in a Dose are solved

Returns: Dose -> bool

True if all variables are solved, false otherwise

isWithinConstraints useCalc dos

Full Usage: isWithinConstraints useCalc dos

Parameters:
    useCalc : bool
    dos : Dose

Returns: bool
useCalc : bool
dos : Dose
Returns: bool

rateIsList dos

Full Usage: rateIsList dos

Parameters:
Returns: bool

Whether the rate of a dose is a list of more than one value.

dos : Dose
Returns: bool

rateIsRange dos

Full Usage: rateIsRange dos

Parameters:
Returns: bool

Whether the rate of a dose is a min, increment and max.

dos : Dose
Returns: bool

setDose set sch setRate dos

Full Usage: setDose set sch setRate dos

Parameters:
    set : OrderVariable -> OrderVariable - The function that sets the value of the order variable
    sch : Schedule - The schedule of the order
    setRate : bool - Whether a timed or once timed order sets the rate instead of the quantity
    dos : Dose - The Dose

Returns: Dose The Dose with the value set

Applies set to the dose rate of a continuous order, and to the dose quantity of the other orders. A timed or once timed order applies set to the dose rate when setRate is true.

set : OrderVariable -> OrderVariable

The function that sets the value of the order variable

sch : Schedule

The schedule of the order

setRate : bool

Whether a timed or once timed order sets the rate instead of the quantity

dos : Dose

The Dose

Returns: Dose

The Dose with the value set

setDoseUnit du dos

Full Usage: setDoseUnit du dos

Parameters:
    du : Unit - The dose unit
    dos : Dose - The Dose

Returns: Dose The Dose with the dose unit set

Converts the first unit of every variable of a dose to the dose unit du. For mg/kg/day the first unit is mg.

du : Unit

The dose unit

dos : Dose

The Dose

Returns: Dose

The Dose with the dose unit set

setNthValue nth

Full Usage: setNthValue nth

Parameters:
    nth : int

Returns: Schedule -> bool -> Dose -> Dose
nth : int
Returns: Schedule -> bool -> Dose -> Dose

setPercValue perc

Full Usage: setPercValue perc

Parameters:
    perc : int

Returns: Schedule -> bool -> Dose -> Dose
perc : int
Returns: Schedule -> bool -> Dose -> Dose

setToNonZeroPositive dos

Full Usage: setToNonZeroPositive dos

Parameters:
    dos : Dose - The Dose

Returns: Dose

Restricts every variable of a dose to values above zero.

dos : Dose

The Dose

Returns: Dose

toOrdVar p dos

Full Usage: toOrdVar p dos

Parameters:
Returns: OrderVariable

The order variable of property p of a dose.

p : DoseProperty
dos : Dose
Returns: OrderVariable

toOrdVars dos

Full Usage: toOrdVars dos

Parameters:
    dos : Dose - The dose

Returns: OrderVariable list

Return a Dose as a list of OrderVariables

dos : Dose

The dose

Returns: OrderVariable list

toString

Full Usage: toString

Returns: Dose -> string list

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

Returns: Dose -> string list

Type something to start searching.