Logo GenPRES

Totals Module

Calculates the totals of the orders per time and per kg per time, each with its state against the norm for the patient. A valid norm that the prescriber sets for a total replaces the norm per kg per time of the Totals sheet. Every total is None without a weight, or when the gestational age is required and not given.

Types and nested modules

Type/Module Description

Dto

Holds the serializable shape of the totals, each total as a text block Dto, a state, a norm and whether the norm is custom, and converts totals to and from the Dto.

CoreNeed

FormRoute

Limit

TotalsData

Functions and values

Function or value Description

appliesTo age wght gestAge t

Full Usage: appliesTo age wght gestAge t

Parameters:
Returns: bool

Whether a Totals row applies to a patient with this age, weight and gestational age. An unknown age or weight does not limit the rows. A preterm patient matches a row only when the row has gestational age bounds or no patient bounds at all, the same as for the dose rules.

age : ValueUnit option
wght : ValueUnit option
gestAge : ValueUnit
t : TotalsData
Returns: bool

boundText bound

Full Usage: boundText bound

Parameters:
Returns: string

Writes a bound of a norm as a Dutch number with a decimal comma, in at least 3 significant digits.

bound : RationalX
Returns: string

calc ords wght name fu tu

Full Usage: calc ords wght name fu tu

Parameters:
Returns: (string * Variable * Variable)[]

Calculates the totals of the orders for the item name in the unit fu per time unit tu; for the name volume, the total volume of the orders in mL per time unit tu. Returns the name of each total with the total per time and the total per kg per time; no totals without a weight.

ords : Order[]
wght : ValueUnit option
name : string
fu : Unit
tu : Unit
Returns: (string * Variable * Variable)[]

combineStates s1 s2

Full Usage: combineStates s1 s2

Parameters:
Returns: TotalState

Combines the states of a total against two norms: a norm without bounds adds nothing, and below one norm and above the other is outside.

s1 : TotalState
s2 : TotalState
Returns: TotalState

correctedDose routeMapping formRoutes totals norms age wght gestAge ords ord

Full Usage: correctedDose routeMapping formRoutes totals norms age wght gestAge ords ord

Parameters:
Returns: (ValueUnit * NearestSide) option

Returns the dose quantity of the order ord that brings the volume of the orders ords within the volume norm of the patient, with the side on which the nearest value of the dose range is taken. The orders ords include the order ord. For a volume above the maximum of the norm the dose is the highest value at most the dose that fits the maximum. When that value is below minDosePerc percent of the orderable quantity, the dose is the lowest value at least that percentage, also when the volume then stays above the maximum. For a volume below the minimum of the norm the dose is the lowest value at least the dose that reaches the minimum, and at most the orderable quantity, also when the volume then stays below the minimum. Returns None when the volume is within the norm, when the order adds no volume, when the dose quantity or the orderable quantity of the order is not a single value, and when the dose does not move in the direction of the norm, such as a dose that is already the whole orderable quantity.

routeMapping : RouteMapping array
formRoutes : FormRoute[]
totals : TotalsData array
norms : TotalNorm array
age : ValueUnit option
wght : ValueUnit option
gestAge : ValueUnit option
ords : Order[]
ord : Order
Returns: (ValueUnit * NearestSide) option

empty

Full Usage: empty

Returns: Totals

Totals with every value None, for a plan or a context before an evaluation calculates the totals.

Returns: Totals

fitsUnit cmp row

Full Usage: fitsUnit cmp row

Parameters:
Returns: bool

Whether the product unit of a component fits a FormRoute row: the unit is in the group of the DoseUnit of the row, or of the Unit of the row when it has no DoseUnit. A reconstituted product is in mL while its row has the unit before the reconstitution and DoseUnit mL. A component without a product with quantities fits any row.

cmp : Component
row : FormRoute
Returns: bool

formUnit cmp

Full Usage: formUnit cmp

Parameters:
Returns: Unit

Returns the unit of a form of a component: the unit of the quantities of its first product, or NoUnit when the component has no product with quantities.

cmp : Component
Returns: Unit

fromTupleInclExcl

Full Usage: fromTupleInclExcl

Returns: Unit option -> RationalX option * RationalX option -> MinMax

Creates a MinMax in a unit with an inclusive minimum and an exclusive maximum.

Returns: Unit option -> RationalX option * RationalX option -> MinMax

gestAgeOrTerm age gestAge

Full Usage: gestAgeOrTerm age gestAge

Parameters:
Returns: ValueUnit option

Returns the gestational age that selects the Totals rows: the given gestational age, or term when GenCORE does not require a gestational age for the age. Returns None when the gestational age is required and not given.

age : ValueUnit option
gestAge : ValueUnit option
Returns: ValueUnit option

getDosePerTime u tu pres dose

Full Usage: getDosePerTime u tu pres dose

Parameters:
Returns: Variable
u : Unit
tu : Unit
pres : Schedule
dose : Dose
Returns: Variable

getTotals routeMapping formRoutes totals norms age wght gestAge ords

Full Usage: getTotals routeMapping formRoutes totals norms age wght gestAge ords

Parameters:
Returns: Totals

Calculates the totals of the orders per kg and per time unit, each checked against the Totals row that applies to the age, weight and gestational age of the patient: per kg per time against the valid norm in norms with the name of the row, or else against the standard norm of the row, and per time against the row. The total has a custom norm when the norm in norms differs from the standard norm. Only the orders whose route and form are marked Totals in the FormRoute rows count. A total that lies partly outside the bounds of its Totals row is a Warning block. Without an order that counts, every total whose Totals row for the patient is marked as a nutrition total is 0. Every total is None without a weight, or when the gestational age is required and not given.

routeMapping : RouteMapping array
formRoutes : FormRoute[]
totals : TotalsData array
norms : TotalNorm array
age : ValueUnit option
wght : ValueUnit option
gestAge : ValueUnit option
ords : Order array
Returns: Totals

getVolume tu pres dose

Full Usage: getVolume tu pres dose

Parameters:
Returns: Variable option

Returns the volume of a dose in mL per time unit, or None when the dose has no volume.

tu : Unit
pres : Schedule
dose : Dose
Returns: Variable option

highestVolumePerKg routeMapping formRoutes wght fu tu perKgUnit ords

Full Usage: highestVolumePerKg routeMapping formRoutes wght fu tu perKgUnit ords

Parameters:
Returns: RationalX option

Returns the highest volume per kg per time of the orders that count in the totals, in perKgUnit. Returns 0 when no order has a volume, and None when the volume has no highest value.

routeMapping : RouteMapping array
formRoutes : FormRoute[]
wght : ValueUnit option
fu : Unit
tu : Unit
perKgUnit : Unit
ords : Order array
Returns: RationalX option

isForEveryPatient t

Full Usage: isForEveryPatient t

Parameters:
Returns: bool

Whether a Totals row has no patient bounds: no age, weight or gestational age.

t : TotalsData
Returns: bool

isTotalsOrder routeMapping formRoutes ord

Full Usage: isTotalsOrder routeMapping formRoutes ord

Parameters:
Returns: bool

Whether an order counts in the totals: the form of one of its components, on the route of the order, matches a FormRoute row marked Totals whose unit fits the component. An order with an empty route, a component with an empty form, or a form that has no FormRoute row does not count.

routeMapping : RouteMapping array
formRoutes : FormRoute[]
ord : Order
Returns: bool

isValidNorm norm

Full Usage: isValidNorm norm

Parameters:
Returns: bool

Whether a norm is valid: no bound is negative and the minimum does not exceed the maximum. A norm with only a minimum, only a maximum or no bound is valid.

norm : TotalNorm
Returns: bool

isVolume var

Full Usage: isVolume var

Parameters:
Returns: bool
var : Variable
Returns: bool

minDosePerc

Full Usage: minDosePerc

Returns: int

The lowest percentage of the orderable quantity that a dose is lowered to.

Returns: int

noNorm

Full Usage: noNorm

Returns: TotalNorm

The norm of a total without a norm: no name and no bounds.

Returns: TotalNorm

normState u min max total

Full Usage: normState u min max total

Parameters:
Returns: TotalState

Returns the state of a calculated total against the bounds min and max in the unit u. The total and the bounds are compared as ValueUnits, so the total may be in another unit of the same group, such as mL/kg/min against bounds in mL/kg/day. Without a bound the state is NoNorm. A total without a lowest value lies partly below a minimum, and a total without a highest value lies partly above a maximum.

u : Unit
min : RationalX option
max : RationalX option
total : Variable
Returns: TotalState

normText minAdj maxAdj

Full Usage: normText minAdj maxAdj

Parameters:
Returns: string option

Returns the norm of a total in brackets, "(0,1 - 0,3)" for a minimum and a maximum, "(max 4)" for a maximum only, "(min 1)" for a minimum only, or None without a bound.

minAdj : RationalX option
maxAdj : RationalX option
Returns: string option

remainingVolume routeMapping formRoutes totals norms age wght gestAge ords

Full Usage: remainingVolume routeMapping formRoutes totals norms age wght gestAge ords

Parameters:
Returns: TotalNorm option

Returns the volume that is left within the volume norm of the patient while the orders are below the minimum of the norm: each bound of the norm minus the highest volume of the orders. The norm is the valid norm in norms with the name volume, or else the norm of the Totals row that applies to the patient. Returns None when the orders reach the minimum of the norm, when the norm has no minimum, when the volume of the orders has no highest value, without a weight and without a volume row for the patient.

routeMapping : RouteMapping array
formRoutes : FormRoute[]
totals : TotalsData array
norms : TotalNorm array
age : ValueUnit option
wght : ValueUnit option
gestAge : ValueUnit option
ords : Order array
Returns: TotalNorm option

toTotal source row perTimeUnit perKgUnit perTime perKg text

Full Usage: toTotal source row perTimeUnit perKgUnit perTime perKg text

Parameters:
Returns: IntakeTotal

Returns the total with its state against the bounds of its Totals row: the total per kg per time against MinPerTimeAdj and MaxPerTimeAdj in perKgUnit, and the total per time against MinPerTime and MaxPerTime in perTimeUnit. The text is a Warning block when the total is below, above or outside the norm. The total carries the norm per kg per time of the row and the source of that norm.

source : NormSource
row : TotalsData
perTimeUnit : Unit
perKgUnit : Unit
perTime : Variable
perKg : Variable
text : string
Returns: IntakeTotal

volumeRow totals norms age wght gestAge

Full Usage: volumeRow totals norms age wght gestAge

Parameters:
Returns: (TotalsData * Unit * Unit * Unit) option

Returns the volume row for the patient, with its norm replaced by the valid norm in norms with the name volume, and the unit of the row per kg per time. Returns None without a weight, without a volume row for the patient, and for a row without a unit or a time unit.

totals : TotalsData array
norms : TotalNorm array
age : ValueUnit option
wght : ValueUnit option
gestAge : ValueUnit option
Returns: (TotalsData * Unit * Unit * Unit) option

withNorm norms row

Full Usage: withNorm norms row

Parameters:
Returns: TotalsData

Returns the Totals row with its standard norm per kg per time replaced by the valid norm with the name of the row, ignoring case. A row without such a norm keeps its standard norm.

norms : TotalNorm array
row : TotalsData
Returns: TotalsData

zero u

Full Usage: zero u

Parameters:
Returns: Variable

Returns a total of 0 in the unit u.

u : Unit
Returns: Variable

Type something to start searching.