Logo GenPRES

RenalRule Module

Parses the RenalRules sheet into renal rules, selects the renal rules for a patient and applies a renal rule to a dose rule.

Nested modules

Modules Description

DoseReduction

Converts a dose reduction to and from its sheet value: repl when the renal values replace the dose limits of the dose rule, rel when the renal values are factors that scale those dose limits, and the older value abs read as repl. An unknown value logs a warning and gives no reduction, which is written as an empty text.

Limit

Creates a renal limit from a target, a dose reduction and the dose ranges.

Functions and values

Function or value Description

adjustDoseLimit patientData renalRule dl

Full Usage: adjustDoseLimit patientData renalRule dl

Parameters:
Returns: DoseLimit

Applies the renal limit for the target of a dose limit. A replacing reduction replaces the bounds and a relative reduction multiplies them by the renal factors. Without a renal limit for the target, or without a reduction, the dose limit is unchanged.

patientData : PatientData
renalRule : RenalRule
dl : DoseLimit
Returns: DoseLimit

adjustDoseRule patientData renalRule doseRule

Full Usage: adjustDoseRule patientData renalRule doseRule

Parameters:
Returns: DoseRule

Applies a renal rule to the substance limits of a dose rule, and sets the renal source and, when the renal rule has them, the frequencies. A dose rule without an adjust unit takes the adjust unit that a substance limit took from the renal rule.

patientData : PatientData
renalRule : RenalRule
doseRule : DoseRule
Returns: DoseRule

appliesTo mapping generic route indication doseType rr

Full Usage: appliesTo mapping generic route indication doseType rr

Parameters:
    mapping : RouteMapping array
    generic : string option
    route : string option
    indication : string option
    doseType : DoseType option
    rr : RenalRule

Returns: bool

Whether a renal rule applies to a generic, a route, an indication and a dose type. A value that is not given, and a field the renal rule leaves blank, match every value.

mapping : RouteMapping array
generic : string option
route : string option
indication : string option
doseType : DoseType option
rr : RenalRule
Returns: bool

appliesToDoseRule routeMapping rr dr

Full Usage: appliesToDoseRule routeMapping rr dr

Parameters:
Returns: bool

Whether a renal rule applies to a dose rule: the generic, and the route, indication and dose type when the renal rule names them.

routeMapping : RouteMapping array
rr : RenalRule
dr : DoseRule
Returns: bool

checkedGroups data

Full Usage: checkedGroups data

Parameters:
Returns: (((string * string * string * string * BigRational option * BigRational option * DoseType * ValueUnit option * MinMax * RenalFunction option) * RenalRuleData array) * string list) array

Returns the groups of the sheet, each with the reasons the unit checks refuse it. A group that passes has an empty list.

data : RenalRuleData[]
Returns: (((string * string * string * string * BigRational option * BigRational option * DoseType * ValueUnit option * MinMax * RenalFunction option) * RenalRuleData array) * string list) array

create gen rte ind src age dt fr it rf limits

Full Usage: create gen rte ind src age dt fr it rf limits

Parameters:
Returns: RenalRule
gen : string
rte : string
ind : string
src : string
age : MinMax
dt : DoseType
fr : ValueUnit option
it : MinMax
rf : RenalFunction
limits : RenalLimit array
Returns: RenalRule

createRenalFunction contDial intDial perDial minGFR maxGFR

Full Usage: createRenalFunction contDial intDial perDial minGFR maxGFR

Parameters:
    contDial : string
    intDial : string
    perDial : string
    minGFR : RationalX option
    maxGFR : RationalX option

Returns: RenalFunction option
contDial : string
intDial : string
perDial : string
minGFR : RationalX option
maxGFR : RationalX option
Returns: RenalFunction option

describe rr

Full Usage: describe rr

Parameters:
Returns: string

Describes a renal rule by generic, route, indication, source and renal function, as a sheet author finds it.

rr : RenalRule
Returns: string

doseRuleWarnings routeMapping doseRules renalRules

Full Usage: doseRuleWarnings routeMapping doseRules renalRules

Parameters:
Returns: Message list

Returns warnings for the replacing renal limits checked against the dose rules they apply to. A per kg or per m2 renal bound in another measurement than the adjust unit of the dose rule gives a warning for every renal function. For a reduced renal function, a renal maximum above the dose rule maximum gives a warning. Only maxima of the same kind and unit group are compared, since there is no patient to convert a per kg bound with. The rules are used as the sheet gives them.

routeMapping : RouteMapping array
doseRules : DoseRule[]
renalRules : RenalRule[]
Returns: Message list

forPatient patientData renalRules

Full Usage: forPatient patientData renalRules

Parameters:
Returns: RenalRule[]

Returns the renal rules whose renal function and age apply to the patient. A patient without a renal function, or younger than 28 days, gets no renal rule.

patientData : CorePatientData
renalRules : RenalRule[]
Returns: RenalRule[]

fromTupleInclExcl

Full Usage: fromTupleInclExcl

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

fromTupleInclIncl

Full Usage: fromTupleInclIncl

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

get logger dataUrlId

Full Usage: get logger dataUrlId

Parameters:
    logger : Logger
    dataUrlId : string

Returns: Result<RenalRule array, Message list>
logger : Logger
dataUrlId : string
Returns: Result<RenalRule array, Message list>

getData dataUrlId

Full Usage: getData dataUrlId

Parameters:
    dataUrlId : string

Returns: Result<RenalRuleData array, Message list>
dataUrlId : string
Returns: Result<RenalRuleData array, Message list>

groupKey r

Full Usage: groupKey r

Parameters:
Returns: string * string * string * string * BigRational option * BigRational option * DoseType * ValueUnit option * MinMax * RenalFunction option

The key that the rows of one renal rule share.

r : RenalRuleData
Returns: string * string * string * string * BigRational option * BigRational option * DoseType * ValueUnit option * MinMax * RenalFunction option

groups data

Full Usage: groups data

Parameters:
Returns: ((string * string * string * string * BigRational option * BigRational option * DoseType * ValueUnit option * MinMax * RenalFunction option) * RenalRuleData array) array

The rows of the sheet with a generic and a source, grouped per renal rule.

data : RenalRuleData[]
Returns: ((string * string * string * string * BigRational option * BigRational option * DoseType * ValueUnit option * MinMax * RenalFunction option) * RenalRuleData array) array

hasAdjustedValue r

Full Usage: hasAdjustedValue r

Parameters:
Returns: bool

Whether a row has a value in a per kg or per m2 column.

r : RenalRuleData
Returns: bool

isReduced _arg1

Full Usage: isReduced _arg1

Parameters:
Returns: bool

Whether a renal function is reduced: an eGFR range that stays at or below 90 mL/min, or a form of dialysis.

_arg1 : RenalFunction
Returns: bool

limitMeasures rl

Full Usage: limitMeasures rl

Parameters:
Returns: Unit list

The measurements the per kg and per m2 bounds of a renal limit need.

rl : RenalLimit
Returns: Unit list

map logger data

Full Usage: map logger data

Parameters:
Returns: Result<RenalRule array, Message list>

The renal rules of the sheet, without those refused by the unit checks.

logger : Logger
data : RenalRuleData[]
Returns: Result<RenalRule array, Message list>

measureOf mm

Full Usage: measureOf mm

Parameters:
Returns: Unit option

The unit a per kg or per m2 range is adjusted with: the weight or the BSA unit in its bounds.

mm : MinMax
Returns: Unit option

ofRows logger (arg2, rules)

Full Usage: ofRows logger (arg2, rules)

Parameters:
Returns: RenalRule option

Makes the renal rule of the rows of one group. Returns None when the group has no renal function.

logger : Logger
arg1 : string * string * string * string * RationalX option * RationalX option * DoseType * ValueUnit option * MinMax * RenalFunction option
rules : RenalRuleData[]
Returns: RenalRule option

parseRenalRuleData data

Full Usage: parseRenalRuleData data

Parameters:
    data : string[][]

Returns: Result<RenalRuleData array, Message list>
data : string[][]
Returns: Result<RenalRuleData array, Message list>

refused logger data

Full Usage: refused logger data

Parameters:
Returns: (RenalRule * string list) array

The renal rules refused by the unit checks, each with the reasons.

logger : Logger
data : RenalRuleData[]
Returns: (RenalRule * string list) array

replaceDose adj (renal, renalAdj) (dose, doseAdj)

Full Usage: replaceDose adj (renal, renalAdj) (dose, doseAdj)

Parameters:
Returns: MinMax * MinMax

Returns the absolute and the per kg or per m2 bounds of one dose under a replacing renal reduction. The dose rule and the renal rule each give both forms, and adj, the weight or the BSA of the patient, converts a bound between the forms. A renal rule without any bound for the dose keeps the maximum of the dose rule and drops its minimum. For a side, minimum or maximum, that the renal rule gives in either form, the renal bounds replace the dose rule bounds in both forms. For a side the renal rule does not give, the dose rule bound stays, but moves to a renal bound on the other side that it conflicts with. Without adj, no per kg or per m2 bound of the dose rule is dropped.

adj : ValueUnit option
renal : MinMax
renalAdj : MinMax
dose : MinMax
doseAdj : MinMax
Returns: MinMax * MinMax

sameMeasure u1 u2

Full Usage: sameMeasure u1 u2

Parameters:
Returns: bool

Whether two adjust units measure the same: both a weight or both a BSA.

u1 : Unit
u2 : Unit
Returns: bool

unitRefusals rows

Full Usage: unitRefusals rows

Parameters:
Returns: string list

Returns the reasons the rows of a renal rule are refused at load: per kg and per m2 bounds in one rule, which the single adjust quantity of an order cannot hold, and a per kg or per m2 value without an adjust unit. Only the rows with a replacing reduction are checked, because the relative rows hold reduction factors without a unit in the same columns.

rows : RenalRuleData[]
Returns: string list

withoutRefused routeMapping refused doseRules

Full Usage: withoutRefused routeMapping refused doseRules

Parameters:
Returns: DoseRule array * Message list

Returns the dose rules without those a refused renal rule applies to, and one warning per refused renal rule. A refused renal rule matches no patient, so without this a patient in its eGFR range would get the full dose of the dose rule.

routeMapping : RouteMapping array
refused : (RenalRule * string list)[]
doseRules : DoseRule[]
Returns: DoseRule array * Message list

Type something to start searching.