Logo GenPRES

PrescriptionRule Module

Combines the dose rules for a filter with the matching solution rules and renal rules into prescription rules for a patient.

Functions and values

Function or value Description

adjustDoseLimitToPatient freqs patientData dl

Full Usage: adjustDoseLimitToPatient freqs patientData dl

Parameters:
Returns: DoseLimit

Resolves a conflict between the adjusted bounds of a dose limit and its absolute bounds. An adjusted bound is a per kg or per m2 bound times the weight or the BSA of the patient. When an adjusted bound cannot be met within an absolute bound, the dose is fixed at that absolute bound and the per kg or per m2 limit is dropped. Returns the dose limit unchanged when the patient lacks the measurement.

freqs : ValueUnit option
patientData : PatientData
dl : DoseLimit
Returns: DoseLimit

collectSolutionRules

Full Usage: collectSolutionRules

Returns: PrescriptionRule array -> SolutionRule array
Returns: PrescriptionRule array -> SolutionRule array

comparedRule solutionRules pr

Full Usage: comparedRule solutionRules pr

Parameters:
Returns: HashId * ProductComponent[] array * DoseRule option * RenalRule[] * SolutionRule[]

Returns the parts of a prescription rule that are compared: the dose rule id, the products of each component, the renal rules and, when solutionRules is Counted, the solution rules. The products are compared because the patient selects the reconstitution of a product. The dose rule itself is compared only when a renal rule applies, because a renal rule changes the limits. A dose rule changed for a conflict between its limits is still the same rule. The patient is left out, since it differs between any two patients.

solutionRules : SolutionRuleComparison
pr : PrescriptionRule
Returns: HashId * ProductComponent[] array * DoseRule option * RenalRule[] * SolutionRule[]

componentNamesWithoutLimits dr

Full Usage: componentNamesWithoutLimits dr

Parameters:
Returns: string array

Returns the names of the components of the dose rule where neither the component limit nor any substance limit has a value.

dr : DoseRule
Returns: string array

departments

Full Usage: departments

Returns: PrescriptionRule array -> string array

Get all departments of an array of PrescriptionRules.

Returns: PrescriptionRule array -> string array

diluents prs

Full Usage: diluents prs

Parameters:
Returns: ProductComponent array
prs : PrescriptionRule[]
Returns: ProductComponent array

doseLimitMeasures dl

Full Usage: doseLimitMeasures dl

Parameters:
Returns: Unit list

Returns the measurement units that the per kg and per m2 bounds of a dose limit need: a weight unit for a per kg bound and a BSA unit for a per m2 bound. A limit with only absolute bounds needs none.

dl : DoseLimit
Returns: Unit list

doseTypes

Full Usage: doseTypes

Returns: PrescriptionRule array -> DoseType array
Returns: PrescriptionRule array -> DoseType array

emptyFilterOptions

Full Usage: emptyFilterOptions

Returns: FilterOptions

The filter options with no values.

Returns: FilterOptions

filter isAdditive doseRules solutionRules renalRules predilutions routeMapping filter

Full Usage: filter isAdditive doseRules solutionRules renalRules predilutions routeMapping filter

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

Returns the prescription rules for the filter. isAdditive finds the additives, the components that a component selection can leave out. The products of a dose rule are reconstituted and then pre-diluted with the predilutions.

isAdditive : GPK -> bool
doseRules : DoseRule array
solutionRules : SolutionRule[]
renalRules : RenalRule[]
predilutions : ProductPredilution[]
routeMapping : RouteMapping array
filter : DoseFilter
Returns: Result<PrescriptionRule array, Message list>

filterOptions prs

Full Usage: filterOptions prs

Parameters:
Returns: FilterOptions

The filter options of an array of PrescriptionRules.

prs : PrescriptionRule array
Returns: FilterOptions

forms

Full Usage: forms

Returns: PrescriptionRule array -> string array

Get all pharmaceutical forms of an array of PrescriptionRules.

Returns: PrescriptionRule array -> string array

frequencies

Full Usage: frequencies

Returns: PrescriptionRule array -> string array

Get all frequencies of an array of PrescriptionRules.

Returns: PrescriptionRule array -> string array

genders

Full Usage: genders

Returns: PrescriptionRule array -> string array

Get all genders of an array of PrescriptionRules.

Returns: PrescriptionRule array -> string array

generics

Full Usage: generics

Returns: PrescriptionRule array -> string array

Get all generics of an array of PrescriptionRules.

Returns: PrescriptionRule array -> string array

getDoseRule pr

Full Usage: getDoseRule pr

Parameters:
Returns: DoseRule

Get the DoseRule of a PrescriptionRule.

pr : PrescriptionRule
Returns: DoseRule

getDoseRules

Full Usage: getDoseRules

Returns: PrescriptionRule array -> DoseRule array

Get all DoseRules of an array of PrescriptionRules.

Returns: PrescriptionRule array -> DoseRule array

getForPatient isAdditive doseRules solutionRules renalRules predilutions routeMapping patientData

Full Usage: getForPatient isAdditive doseRules solutionRules renalRules predilutions routeMapping patientData

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

Get all matching PrescriptionRules for a given Patient.

isAdditive : GPK -> bool
doseRules : DoseRule array
solutionRules : SolutionRule[]
renalRules : RenalRule[]
predilutions : ProductPredilution[]
routeMapping : RouteMapping array
patientData : PatientData
Returns: Result<PrescriptionRule array, Message list>

getSolutionRules pr

Full Usage: getSolutionRules pr

Parameters:
Returns: SolutionRule[]

indications

Full Usage: indications

Returns: PrescriptionRule array -> string array

Get all indications of an array of PrescriptionRules.

Returns: PrescriptionRule array -> string array

isAdditiveComponent isAdditive cl

Full Usage: isAdditiveComponent isAdditive cl

Parameters:
Returns: bool

Returns true when isAdditive is true for the GPK of a product of the component.

isAdditive : GPK -> bool
cl : ComponentLimit
Returns: bool

isPrescribable patientData pr

Full Usage: isPrescribable patientData pr

Parameters:
Returns: bool

Returns true when the patient has every measurement, the weight or the BSA, that the per kg and per m2 bounds of the dose limits, the solution rules and the renal rules of the prescription rule need.

patientData : PatientData
pr : PrescriptionRule
Returns: bool

limitsComponent patientData solRule name

Full Usage: limitsComponent patientData solRule name

Parameters:
Returns: bool

Returns true when the first dilution limit of the component has a maximum quantity or a list of quantities. When the patient has the value for the adjust unit of the solution rule, a maximum quantity per adjust unit also counts. The order uses only that dilution limit. A minimum alone does not limit the component.

patientData : PatientData
solRule : SolutionRule
name : string
Returns: bool

optionalComponents isAdditive cls

Full Usage: optionalComponents isAdditive cls

Parameters:
Returns: string[]

Returns the names of the optional components: the additives after the first component.

isAdditive : GPK -> bool
cls : ComponentLimit[]
Returns: string[]

patients

Full Usage: patients

Returns: PrescriptionRule array -> string array

Get all patients of an array of PrescriptionRules.

Returns: PrescriptionRule array -> string array

routes

Full Usage: routes

Returns: PrescriptionRule array -> string array

Get all routes of an array of PrescriptionRules.

Returns: PrescriptionRule array -> string array

sameRules solutionRules atContext current

Full Usage: sameRules solutionRules atContext current

Parameters:
Returns: bool

Returns true when the rules for the current patient equal the rules at the context. Returns false when there are no rules for the current patient.

solutionRules : SolutionRuleComparison
atContext : PrescriptionRule array
current : PrescriptionRule array
Returns: bool

selectComponents isAdditive selection cls

Full Usage: selectComponents isAdditive selection cls

Parameters:
Returns: ComponentLimit[]

Returns all component limits for AllComponents. For a selection, returns the components that are not optional and the selected optional components.

isAdditive : GPK -> bool
selection : ComponentSelection
cls : ComponentLimit[]
Returns: ComponentLimit[]

solutionRulesByGeneric solutionRules

Full Usage: solutionRulesByGeneric solutionRules

Parameters:
Returns: string -> SolutionRule array

Returns a lookup of the solution rules by generic. The generic names are compared as String.equalsCapInsens compares them, in lower case and trimmed; a generic without solution rules gets an empty array.

solutionRules : SolutionRule[]
Returns: string -> SolutionRule array

toMarkdown getLink prs

Full Usage: toMarkdown getLink prs

Parameters:
Returns: string

Returns the prescription rules as markdown, after the patient data of the first rule. getLink makes the source links; Source.noLinks makes none. An empty array raises an exception.

getLink : LinkProvider
prs : PrescriptionRule[]
Returns: string

withLimitingSolutionRules pr

Full Usage: withLimitingSolutionRules pr

Parameters:
Returns: PrescriptionRule option

Keeps the solution rules with a dose count of at least 1 that limit every component without a limit, for the patient of the prescription rule. Returns None when no solution rule is left, and the rule unchanged when all components have a limit. Each solution rule gives its own scenario, so any other solution rule would give an order with a component without any limit.

pr : PrescriptionRule
Returns: PrescriptionRule option

Type something to start searching.