RuleSet Module
Checks the rows of the RuleSets sheet against the dose rules, expands the rows without a generic, builds a rule set per kind and selects the rows of a rule set for a patient.
Types and nested modules
| Type/Module | Description |
|
Reads the names of each dose rule row: indication, generic, label, component, route and dose type. |
|
|
The names of a dose rule that the checks and the expansion of the rule set rows match on. |
Functions and values
| Function or value |
Description
|
Full Usage:
allows allowed name
Parameters:
string[]
name : string
Returns: bool
|
Whether a list of a rule set allows the name: an empty list allows any name, and names compare without regard to case.
|
|
Every nutrition category.
|
Full Usage:
check doseRules products rows
Parameters:
DoseRuleNames[]
products : Set<string>
rows : RuleSetData[]
Returns: Message list
|
Checks the rows against the dose rules and the generics of the Formulary sheet, and returns a warning for: a category with more than one label; an indication that no dose rule has; a generic that no dose rule under the indication has as a label, with the labels to use when dose rules have it as a generic name; and a generic or component under the indication of a row without a product. A product name is matched without regard to case, as the dose rules match their products.
|
Full Usage:
checkData doseRules products rows
Parameters:
DoseRuleData[]
products : FormularyProduct[]
rows : RuleSetData[]
Returns: Message list
|
Checks the rows against the dose rule data and the formulary products, and returns the warnings.
|
Full Usage:
distinctOf f rows
Parameters:
RuleSetData -> string
rows : RuleSetData[]
Returns: string array
|
Returns the distinct non-empty values of a field of the rows, in row order.
|
Full Usage:
expand doseRules rows
Parameters:
DoseRuleNames[]
rows : RuleSetData[]
Returns: RuleSetData array
|
Replaces each row without a generic by one row per distinct label of the dose rules under its indication, in the order of the dose rules. A row whose indication no dose rule has stays as it is. The evaluation does not filter on the indications of a rule set, so only the generics keep a medication out of a nutrition category.
|
|
Returns the rule set with only the rows that apply to the patient. A row without a location applies to every patient, and a row with a location only to a patient at that location. A row without a department applies to every patient, and a row with a department only to a patient of that department.
|
|
Returns the category name of a rule set kind in the rule set data.
|
|
Returns the rule set kind of a category name in the rule set data, or None for another name.
|
|
Every kind of rule set: one for each nutrition category, the emergency list and the standard infusions.
|
Full Usage:
nutritionCategoryOf sets indication generic
Parameters:
RuleSet[]
indication : string option
generic : string option
Returns: NutritionCategory option
|
Returns the nutrition category whose rule set names the indication and allows the generic, or None when there is none, also when the indication or the generic is missing.
|
|
Creates a rule set for every kind in the rule set data, with the label of the first rule of the kind and the rules in their order. Leaves out the rules of a category that is not a rule set category.
|
Full Usage:
tryFind category sets
Parameters:
NutritionCategory
sets : RuleSet[]
Returns: RuleSet option
|
Returns the rule set of a nutrition category, or None when there is none.
|
Full Usage:
tryFindWithRows category sets
Parameters:
NutritionCategory
sets : RuleSet[]
Returns: RuleSet option
|
Returns the rule set of a nutrition category, or None when there is none or when it has no rules, as a rule set for a patient has when none of its rules apply to the patient.
|
|
Returns the distinct category names in the rule set data that are not a rule set category, in their order.
|
GenPRES