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 |
|
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. |
|
|
|
|
|
|
|
|
|
|
|
|
Functions and values
| Function or value |
Description
|
Full Usage:
appliesTo age wght gestAge t
Parameters:
ValueUnit option
wght : ValueUnit option
gestAge : ValueUnit
t : TotalsData
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.
|
|
Writes a bound of a norm as a Dutch number with a decimal comma, in at least 3 significant digits.
|
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. |
|
|
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.
|
Full Usage:
correctedDose routeMapping formRoutes totals norms age wght gestAge ords ord
Parameters:
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
|
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.
|
Totals with every value None, for a plan or a context before an evaluation calculates the totals.
|
|
|
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.
|
|
|
|
|
|
|
Full Usage:
getTotals routeMapping formRoutes totals norms age wght gestAge ords
Parameters:
RouteMapping array
formRoutes : FormRoute[]
totals : TotalsData array
norms : TotalNorm array
age : ValueUnit option
wght : ValueUnit option
gestAge : ValueUnit option
ords : Order array
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.
|
|
|
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.
|
|
|
Whether a Totals row has no patient bounds: no age, weight or gestational age.
|
Full Usage:
isTotalsOrder routeMapping formRoutes ord
Parameters:
RouteMapping array
formRoutes : FormRoute[]
ord : Order
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.
|
|
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.
|
|
|
Full Usage:
minDosePerc
Returns: int
|
The lowest percentage of the orderable quantity that a dose is lowered to.
|
The norm of a total without a norm: no name and no bounds.
|
|
|
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.
|
|
|
Full Usage:
remainingVolume routeMapping formRoutes totals norms age wght gestAge ords
Parameters:
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
|
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.
|
Full Usage:
toTotal source row perTimeUnit perKgUnit perTime perKg text
Parameters:
NormSource
row : TotalsData
perTimeUnit : Unit
perKgUnit : Unit
perTime : Variable
perKg : Variable
text : string
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.
|
Full Usage:
volumeRow totals norms age wght gestAge
Parameters:
TotalsData array
norms : TotalNorm array
age : ValueUnit option
wght : ValueUnit option
gestAge : ValueUnit option
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.
|
Full Usage:
withNorm norms row
Parameters:
TotalNorm array
row : TotalsData
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.
|
GenPRES