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 |
|
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. |
|
|
Creates a renal limit from a target, a dose reduction and the dose ranges. |
Functions and values
| Function or value |
Description
|
Full Usage:
adjustDoseLimit patientData renalRule dl
Parameters:
PatientData
renalRule : RenalRule
dl : DoseLimit
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.
|
Full Usage:
adjustDoseRule patientData renalRule doseRule
Parameters:
PatientData
renalRule : RenalRule
doseRule : DoseRule
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.
|
Full Usage:
appliesTo mapping generic route indication doseType rr
Parameters:
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.
|
Full Usage:
appliesToDoseRule routeMapping rr dr
Parameters:
RouteMapping array
rr : RenalRule
dr : DoseRule
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.
|
Full Usage:
checkedGroups data
Parameters:
RenalRuleData[]
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.
|
Full Usage:
create gen rte ind src age dt fr it rf limits
Parameters:
string
rte : string
ind : string
src : string
age : MinMax
dt : DoseType
fr : ValueUnit option
it : MinMax
rf : RenalFunction
limits : RenalLimit array
Returns: RenalRule
|
|
Full Usage:
createRenalFunction contDial intDial perDial minGFR maxGFR
Parameters:
string
intDial : string
perDial : string
minGFR : RationalX option
maxGFR : RationalX option
Returns: RenalFunction option
|
|
|
Describes a renal rule by generic, route, indication, source and renal function, as a sheet author finds it.
|
Full Usage:
doseRuleWarnings routeMapping doseRules renalRules
Parameters:
RouteMapping array
doseRules : DoseRule[]
renalRules : RenalRule[]
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.
|
Full Usage:
forPatient patientData renalRules
Parameters:
CorePatientData
renalRules : RenalRule[]
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.
|
|
|
|
|
|
|
Full Usage:
getData dataUrlId
Parameters:
string
Returns: Result<RenalRuleData array, Message list>
|
|
Full Usage:
groupKey r
Parameters:
RenalRuleData
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.
|
Full Usage:
groups data
Parameters:
RenalRuleData[]
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.
|
|
|
|
Whether a renal function is reduced: an eGFR range that stays at or below 90 mL/min, or a form of dialysis.
|
|
The measurements the per kg and per m2 bounds of a renal limit need.
|
Full Usage:
map logger data
Parameters:
Logger
data : RenalRuleData[]
Returns: Result<RenalRule array, Message list>
|
The renal rules of the sheet, without those refused by the unit checks.
|
|
|
Full Usage:
ofRows logger (arg2, rules)
Parameters:
Logger
arg1 : string * string * string * string * RationalX option * RationalX option * DoseType * ValueUnit option * MinMax * RenalFunction option
rules : RenalRuleData[]
Returns: RenalRule option
|
Makes the renal rule of the rows of one group. Returns None when the group has no renal function.
|
Full Usage:
parseRenalRuleData data
Parameters:
string[][]
Returns: Result<RenalRuleData array, Message list>
|
|
Full Usage:
refused logger data
Parameters:
Logger
data : RenalRuleData[]
Returns: (RenalRule * string list) array
|
The renal rules refused by the unit checks, each with the reasons.
|
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. |
|
|
|
|
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.
|
Full Usage:
withoutRefused routeMapping refused doseRules
Parameters:
RouteMapping array
refused : (RenalRule * string list)[]
doseRules : DoseRule[]
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.
|
GenPRES