Logo GenPRES

OrderContext Module

Declares the commands on an order context, creates an order context for patient data and evaluates a command on the context: looks up rules, makes the scenarios and changes the medication order of a scenario.

Types and nested modules

Type/Module Description

Command (Module)

Returns the order context that a command carries and the command as text.

Dto

Holds the serializable shape of an order context and converts a context to and from the Dto. Reading returns the errors of the filter, the patient data and every scenario.

Helpers

Splits prescription rules by the Divisible of their products, makes and calculates the orders of the rules and turns the calculated orders into scenarios.

Command (Type)

Functions and values

Function or value Description

adjustOfPatient patientData ord

Full Usage: adjustOfPatient patientData ord

Parameters:
Returns: ValueUnit option

The value of the patient the order is adjusted with, in the unit of the order. None when the patient does not have that value, or the order holds no adjust value.

patientData : PatientData
ord : Order
Returns: ValueUnit option

anyChosen f

Full Usage: anyChosen f

Parameters:
Returns: bool

Whether any of the five filter choices the rule lookup reads is made.

f : Filter
Returns: bool

applyChange category field clearOwn write ctx

Full Usage: applyChange category field clearOwn write ctx

Parameters:
Returns: OrderContext

Applies a change to one filter choice and removes the scenarios and the picked products. Emptying a choice also clears its options and the choices in the later steps; when no choice is left, the options of all lookup fields are cleared. A change to a field the rule lookup reads can give another dose rule, so it also clears the components, the dose rule components and the component selection.

category : OrderCategory
field : FilterField
clearOwn : bool
write : Filter -> Filter
ctx : OrderContext
Returns: OrderContext

applyToOrderScenario scenarioF ctx

Full Usage: applyToOrderScenario scenarioF ctx

Parameters:
Returns: OrderContext
scenarioF : OrderScenario -> OrderScenario
ctx : OrderContext
Returns: OrderContext

applyingToDepartment provider patientData drs

Full Usage: applyingToDepartment provider patientData drs

Parameters:
Returns: DoseRule array

The dose rules applying to the department of the patient: every rule with limits, and a dose rule without limits only when a solution rule for the department limits every component of it.

provider : IResourceProvider
patientData : CorePatientData
drs : DoseRule array
Returns: DoseRule array

chain category

Full Usage: chain category

Parameters:
Returns: FilterField list list

The order in which the filter choices are made, as steps. Emptying a choice clears the choices in the later steps, not the other choices in its own step. For a medication the indication and the generic share one step and narrow each other; for a nutrition order the generic comes first and the indication follows from it.

category : OrderCategory
Returns: FilterField list list

change category field chosen dt ctx

Full Usage: change category field chosen dt ctx

Parameters:
Returns: OrderContext

Sets or empties the choice of a filter field. Returns the context unchanged when the field already has that choice.

category : OrderCategory
field : FilterField
chosen : string option
dt : DoseType option
ctx : OrderContext
Returns: OrderContext

changeDiluent n ctx

Full Usage: changeDiluent n ctx

Parameters:
Returns: Result<OrderContext, string>

The diluent set to its nth option, or emptied with None.

n : int option
ctx : OrderContext
Returns: Result<OrderContext, string>

changeFilter category field n ctx

Full Usage: changeFilter category field n ctx

Parameters:
Returns: Result<OrderContext, string>

Sets a filter field to its nth option, counted from 0, or empties it with None. A diluent or a component change does not clear other choices, because the rule lookup does not read them. A component pick selects one component; setNthComponents selects several.

category : OrderCategory
field : FilterField
n : int option
ctx : OrderContext
Returns: Result<OrderContext, string>

changeOrder logger change ctx

Full Usage: changeOrder logger change ctx

Parameters:
Returns: OrderContext

Changes the order of the single scenario with the property command, without solving it.

logger : Logger
change : ChangePropertyCommand
ctx : OrderContext
Returns: OrderContext

changesAdjustedDose change

Full Usage: changesAdjustedDose change

Parameters:
Returns: bool

Whether the change sets or recalculates a dose per kg or per m2. A new change of a dose per kg or per m2 must be added here; the last case answers false for every change not listed.

change : ChangePropertyCommand
Returns: bool

choicesOpen ctx

Full Usage: choicesOpen ctx

Parameters:
Returns: bool

Whether the rule lookup would read a choice that the filter does not have: a list with one option and no choice.

ctx : OrderContext
Returns: bool

clearAll ctx

Full Usage: clearAll ctx

Parameters:
Returns: OrderContext

Empties the filter, the scenarios and the argumentation; the patient data stays.

ctx : OrderContext
Returns: OrderContext

clearChoice field f

Full Usage: clearChoice field f

Parameters:
Returns: Filter

Clears the choice of one filter field and leaves its options.

field : FilterField
f : Filter
Returns: Filter

clearField field f

Full Usage: clearField field f

Parameters:
Returns: Filter

Clears the choice and the options of one filter field. The options are cleared too because the rule lookup reads a single option as a choice, so the field would come back chosen. The next evaluation fills the options again.

field : FilterField
f : Filter
Returns: Filter

componentQuantities ord

Full Usage: componentQuantities ord

Parameters:
Returns: (string * ValueUnit) list option

The quantity in the orderable of each component, when every component holds a single quantity; None otherwise.

ord : Order
Returns: (string * ValueUnit) list option

contextTotals routeMapping formRoutes totalsData norms ctx

Full Usage: contextTotals routeMapping formRoutes totalsData norms ctx

Parameters:
Returns: Totals

The totals over the orders of the context's scenarios, for its patient's age, weight and gestational age. Each total is checked against the norm in norms with the name of its Totals row, or else against the standard norm of the row.

routeMapping : RouteMapping array
formRoutes : FormRoute[]
totalsData : TotalsData array
norms : TotalNorm array
ctx : OrderContext
Returns: Totals

contextTotalsFor routeMapping formRoutes totalsData norms patientData ctx

Full Usage: contextTotalsFor routeMapping formRoutes totalsData norms patientData ctx

Parameters:
Returns: Totals

The totals over the orders of the context's scenarios, for the age, weight and gestational age of the patient. Each total is checked against the norm in norms with the name of its Totals row, or else against the standard norm of the row.

routeMapping : RouteMapping array
formRoutes : FormRoute[]
totalsData : TotalsData array
norms : TotalNorm array
patientData : PatientData
ctx : OrderContext
Returns: Totals

contribution ctx

Full Usage: contribution ctx

Parameters:
Returns: OrderScenario option

Returns the scenario of a context with exactly one scenario, the order it adds to the plan. Returns None for several scenarios or none.

ctx : OrderContext
Returns: OrderScenario option

create logger provider patientData

Full Usage: create logger provider patientData

Parameters:
Returns: OrderContext

Creates a context for the patient data with the pick lists of the rules that can be prescribed for the patient. The pick lists are empty for a child without a weight.

logger : Logger
provider : IResourceProvider
patientData : PatientData
Returns: OrderContext

doseFilterFor patientData ctx

Full Usage: doseFilterFor patientData ctx

Parameters:
Returns: DoseFilter

Returns the dose filter for the picks, the diluent and the selected components of the context, with the given patient data.

patientData : PatientData
ctx : OrderContext
Returns: DoseFilter

doseRulesOf provider ctx

Full Usage: doseRulesOf provider ctx

Parameters:
Returns: DoseRule array

Returns the dose rules for the context as it is, before a command changes it: the stand-alone dose rules, plus the dose rules that need a main order when the context selects them. The context selects them with a picked indication and generic, where a single-option list counts as picked, and a dose type list of exactly one. Only a linked offer, whose dose types are narrowed to the link side, has such a list, because a pick or a seed does not change the lists of an evaluated context. Prescribing still refuses an order that needs a main order and has none. Returns an empty array when a resource is missing from the provider.

provider : IResourceProvider
ctx : OrderContext
Returns: DoseRule array

emptyFilter

Full Usage: emptyFilter

Returns: Filter

The filter with no options and no choices.

Returns: Filter

evaluate start logger provider cmd

Full Usage: evaluate start logger provider cmd

Parameters:
Returns: Result<Command, Message list>

Evaluates a command and maps the outcome to a result with messages, see ofOutcome.

start : DateTime
logger : Logger
provider : IResourceProvider
cmd : Command
Returns: Result<Command, Message list>

evaluateOutcome start logger provider cmd

Full Usage: evaluateOutcome start logger provider cmd

Parameters:
Returns: Result<Outcome<Command>, Message list>

Evaluates a command and returns the outcome. A command that looks up the rules is refused when no rule fits the picks or every medication lacks its diluent. A command on the scenario order is refused when the order cannot be solved, or when it changes a dose per kg or per m2 that the order does not have. Returns an error when the rule lookup fails or an index is past the options.

start : DateTime
logger : Logger
provider : IResourceProvider
cmd : Command
Returns: Result<Outcome<Command>, Message list>

filterFields

Full Usage: filterFields

Returns: FilterField list

The filter fields the rule lookup reads. The diluent and the components belong to the scenario, not to the lookup.

Returns: FilterField list

filterPicks ctx

Full Usage: filterPicks ctx

Parameters:
Returns: DoseFilter

Returns the five filter picks as the rule lookup reads them: the choice of a filter field, or else the only option of that field. The patient data of the dose filter is not set.

ctx : OrderContext
Returns: DoseFilter

filterScenariosByPreparation scs

Full Usage: filterScenariosByPreparation scs

Parameters:
Returns: OrderScenario array

The scenarios per dose type: only the preparable ones when there are any, otherwise all.

scs : OrderScenario[]
Returns: OrderScenario array

getRules logger provider ctx

Full Usage: getRules logger provider ctx

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

Returns the context with its pick lists narrowed to the options of the prescribable rules, and the rules themselves. A list with one option sets its choice. The rules are only returned when the indication, the generic, the dose type and the route or the form are picked. For a child without a weight the context is made afresh and there are no rules.

logger : Logger
provider : IResourceProvider
ctx : OrderContext
Returns: OrderContext * Result<PrescriptionRule array, Message list>

getScenarios start logger provider sent

Full Usage: getScenarios start logger provider sent

Parameters:
Returns: Result<Outcome<OrderContext>, Message list>

Looks up the rules for the context and makes its scenarios. Picks that match no rule are refused with the context as it was sent. When every medication lacks a needed diluent, the context with the narrowed picks is refused with NoDiluent. Returns the error when the rule lookup fails.

start : DateTime
logger : Logger
provider : IResourceProvider
sent : OrderContext
Returns: Result<Outcome<OrderContext>, Message list>

hasNoAdjustedDose ctx

Full Usage: hasNoAdjustedDose ctx

Parameters:
Returns: bool

Whether the one scenario of the context holds an order without a dose per kg or per m2.

ctx : OrderContext
Returns: bool

logOrderContext logger msg cmd

Full Usage: logOrderContext logger msg cmd

Parameters:
Returns: Command
logger : Logger
msg : string
cmd : Command
Returns: Command

matchedPatientData ctx

Full Usage: matchedPatientData ctx

Parameters:
Returns: PatientData

Returns the patient data of the context without its diagnoses, as the rule lookup takes it.

ctx : OrderContext
Returns: PatientData

matchesLinkSide routeMapping side ctx

Full Usage: matchesLinkSide routeMapping side ctx

Parameters:
Returns: bool

Whether the order context matches a side of a link rule, by the order it is narrowed to: the generic label, the indication, the route and the dose type of its scenario. A context that is not narrowed to one order matches no side.

routeMapping : RouteMapping array
side : LinkSide
ctx : OrderContext
Returns: bool

measurementMissing patientData prs

Full Usage: measurementMissing patientData prs

Parameters:
Returns: bool

Whether the patient lacks a measurement for every prescription rule: at least one rule, and none of them can be prescribed for the patient. No rules at all is not a missing measurement.

patientData : PatientData
prs : PrescriptionRule array
Returns: bool

narrowToLinkSide side ctx

Full Usage: narrowToLinkSide side ctx

Parameters:
Returns: OrderContext

The context's dose types narrowed to the dose types the side matches.

side : LinkSide
ctx : OrderContext
Returns: OrderContext

narrowToRuleSet set ctx

Full Usage: narrowToRuleSet set ctx

Parameters:
Returns: OrderContext

Narrows the indication and generic lists of the context filter to the names the rule set allows. The other lists and the picks do not change.

set : RuleSet
ctx : OrderContext
Returns: OrderContext

noDoseRulesMessage

Full Usage: noDoseRulesMessage

Returns: string

The error message that ofOutcome returns for a refusal without a context.

Returns: string

nth what n xs

Full Usage: nth what n xs

Parameters:
    what : string
    n : int
    xs : 'a[]

Returns: Result<'a, string>
Type parameters: 'a

Returns the nth item of the options, or an error when the index is out of range.

what : string
n : int
xs : 'a[]
Returns: Result<'a, string>

ofLinkSide side patientData

Full Usage: ofLinkSide side patientData

Parameters:
Returns: OrderContext

The order context a side of a link rule offers for the patient, before it is evaluated: the indication, the generic and the route set when the side gives them; a blank field is left open.

side : LinkSide
patientData : PatientData
Returns: OrderContext

ofOutcome outcome

Full Usage: ofOutcome outcome

Parameters:
Returns: Result<'a, Message list>
Type parameters: 'a

Maps an outcome to a result with messages. An evaluated outcome and a NotSolved, NoAdjustedDose or NoDiluent refusal return their value; any other refusal returns noDoseRulesMessage.

outcome : Outcome<'a>
Returns: Result<'a, Message list>

orderOfRule start logger orderId rules

Full Usage: orderOfRule start logger orderId rules

Parameters:
Returns: Order option

Builds the order of a single rule with the given order id. Returns None when there is not exactly one rule, when the rule gives more than one medication, or when the medication gives no order.

start : DateTime
logger : Logger
orderId : string
rules : PrescriptionRule[]
Returns: Order option

orderOnPatientData logger provider patientData sc ctx

Full Usage: orderOnPatientData logger provider patientData sc ctx

Parameters:
Returns: Outcome<OrderContext>

Updates the single order of the context for new patient data. The scenario gets the notice when the rules for the new patient data differ from the rules for the patient data of the context; a failed lookup leaves the notice unchanged. When the rules are the same, the limits that depend on the patient come from the current rule; without a single current rule the limits stay and a warning is logged. The order is calculated again when its adjust value or its limits changed; the dose the patient gets stays. The context keeps the patient data its rules were chosen for, so the rules can always be compared. An order that cannot be solved is refused unchanged and marked as not recalculated. The mark is removed when the new patient data has an adjust value and either the current rule is known or the adjust value changed.

logger : Logger
provider : IResourceProvider
patientData : CorePatientData
sc : OrderScenario
ctx : OrderContext
Returns: Outcome<OrderContext>

processScenarioOrder logger f ctx

Full Usage: processScenarioOrder logger f ctx

Parameters:
Returns: Outcome<OrderContext>
Type parameters: 'a

Processes the order of the single scenario with f. Refuses the context as it was sent with NotSolved when f fails. Logs a context without exactly one scenario and returns it unchanged.

logger : Logger
f : Order -> Result<Order, 'a>
ctx : OrderContext
Returns: Outcome<OrderContext>

reconcile logger provider ctx

Full Usage: reconcile logger provider ctx

Parameters:
Returns: OrderContext

Matches the filter choices of the context against the pick lists that the rules give for its patient data; a choice that is not in its list is removed. The scenarios are not changed.

logger : Logger
provider : IResourceProvider
ctx : OrderContext
Returns: OrderContext

refusal provider ctx

Full Usage: refusal provider ctx

Parameters:
Returns: Refusal

Returns the refusal for the context from the dose rules of the provider, see refusalOf. For a child without a weight no rule fits the patient. A dose rule without limits counts for the picks only when a solution rule of the department limits it. It counts for the patient only when a solution rule for the patient limits it, or when it has no products, which gives NoProducts.

provider : IResourceProvider
ctx : OrderContext
Returns: Refusal

refusalOf forPicks forPatient measurementMissing

Full Usage: refusalOf forPicks forPatient measurementMissing

Parameters:
    forPicks : 'a[]
    forPatient : 'a[]
    measurementMissing : bool

Returns: Refusal
Type parameters: 'a

Returns the refusal for an empty result: NoDoseRules when no dose rule fits the picks in the department of the patient, NoDoseRulesForPatient when none fits the patient, MeasurementMissing when the patient lacks a measurement for every prescription rule, and otherwise NoProducts, when the rule lookup dropped the rules for having no product or no dose type.

forPicks : 'a[]
forPatient : 'a[]
measurementMissing : bool
Returns: Refusal

refusedAsSent sent outcome

Full Usage: refusedAsSent sent outcome

Parameters:
Returns: Outcome<'a>
Type parameters: 'a

Puts the command as it was sent in a refused outcome, so a value that cannot be solved leaves the order as it was before the value was set.

sent : 'a
outcome : Outcome<'a>
Returns: Outcome<'a>

reloadResources start logger provider ctx

Full Usage: reloadResources start logger provider ctx

Parameters:
Returns: Result<Outcome<OrderContext>, Message list>
start : DateTime
logger : Logger
provider : IResourceProvider
ctx : OrderContext
Returns: Result<Outcome<OrderContext>, Message list>

resolveChange cmd

Full Usage: resolveChange cmd

Parameters:
Returns: Result<(OrderContext * (OrderContext -> Command)), string> option

Applies a filter change, a component or scenario selection, or a seed to its context. Returns the changed context with the command it is evaluated as, or an error when an index is past the options. Returns None for any other command.

cmd : Command
Returns: Result<(OrderContext * (OrderContext -> Command)), string> option

restoreQuantities logger cmd

Full Usage: restoreQuantities logger cmd

Parameters:
Returns: OrderContext -> OrderContext

Sets the component quantities of the context as sent on the evaluated context after a component selection or a diluent choice. Any other command returns the context unchanged.

logger : Logger
cmd : Command
Returns: OrderContext -> OrderContext

ruleOfScenario provider sc ctx rules

Full Usage: ruleOfScenario provider sc ctx rules

Parameters:
Returns: PrescriptionRule array

Returns the rules the scenario was made from: split by Divisible to the groups of the picked products, or with the Divisible removed when the order fits only without it.

provider : IResourceProvider
sc : OrderScenario
ctx : OrderContext
rules : PrescriptionRule array
Returns: PrescriptionRule array

rulesByDivisible provider rules

Full Usage: rulesByDivisible provider rules

Parameters:
Returns: PrescriptionRule[] array

Splits each rule into one rule per group of products with the same Divisible, as the scenarios are made.

provider : IResourceProvider
rules : PrescriptionRule array
Returns: PrescriptionRule[] array

rulesFor logger provider patientData ctx

Full Usage: rulesFor logger provider patientData ctx

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

The prescribable rules for the picks of the context and the patient. A child without a weight has none.

logger : Logger
provider : IResourceProvider
patientData : CorePatientData
ctx : OrderContext
Returns: Result<PrescriptionRule array, Message list>

rulesForMainOrder routeMapping rules ctx

Full Usage: rulesForMainOrder routeMapping rules ctx

Parameters:
Returns: LinkRule array

The link rules for which the order context is the main order, when the context is narrowed to one order; none otherwise. Their linked sides are the orders that can be linked to it.

routeMapping : RouteMapping array
rules : LinkRule[]
ctx : OrderContext
Returns: LinkRule array

rulesVerdict logger ord atContext current

Full Usage: rulesVerdict logger ord atContext current

Parameters:
Returns: bool option

Whether the rules no longer apply to the order: compares the rules for the patient data of the context with the rules for the current patient data. Logs the error and returns None when a lookup failed.

logger : Logger
ord : Order
atContext : Result<PrescriptionRule array, Message list>
current : Result<PrescriptionRule array, Message list>
Returns: bool option

seedFilter source ind gen rte frm dt ctx

Full Usage: seedFilter source ind gen rte frm dt ctx

Parameters:
Returns: OrderContext

Sets the filter choices from a seed source. A Formulary or Parenteralia seed removes the scenarios and keeps the diluent only when the generic, the route and the form are unchanged, for Formulary also the indication. A Url seed keeps the diluent and the scenarios. A Reload changes nothing. The picked products and the components stay only when all five choices are unchanged.

source : SeedSource
ind : string option
gen : string option
rte : string option
frm : string option
dt : DoseType option
ctx : OrderContext
Returns: OrderContext

selectNthScenario n ctx

Full Usage: selectNthScenario n ctx

Parameters:
Returns: Result<OrderContext, string>

Narrows the context to its nth scenario and sets the form of that scenario as the filter form.

n : int
ctx : OrderContext
Returns: Result<OrderContext, string>

selectsRules patientData

Full Usage: selectsRules patientData

Parameters:
Returns: bool

Whether the rules are looked up for the patient data: always for an adult, for a child only with a weight. A height is not needed; a rule that needs a height is left out because it cannot be prescribed.

patientData : CorePatientData
Returns: bool

setComponentQuantities logger previous ctx

Full Usage: setComponentQuantities logger previous ctx

Parameters:
Returns: OrderContext

Sets the component quantities of the previous context again on a context rebuilt after a component selection or a diluent choice: each component by name, and the quantity of the previous diluent on the new diluent. Nothing is set when a component of the previous order has no single quantity, or when solving fails.

logger : Logger
previous : OrderContext
ctx : OrderContext
Returns: OrderContext

setFilter filter ctx

Full Usage: setFilter filter ctx

Parameters:
Returns: OrderContext
filter : Filter
ctx : OrderContext
Returns: OrderContext

setFilterForm frm ctx

Full Usage: setFilterForm frm ctx

Parameters:
Returns: OrderContext
frm : string
ctx : OrderContext
Returns: OrderContext

setFilterGeneric gen ctx

Full Usage: setFilterGeneric gen ctx

Parameters:
Returns: OrderContext
gen : string
ctx : OrderContext
Returns: OrderContext

setFilterIndication ind ctx

Full Usage: setFilterIndication ind ctx

Parameters:
Returns: OrderContext
ind : string
ctx : OrderContext
Returns: OrderContext

setFilterRoute rte ctx

Full Usage: setFilterRoute rte ctx

Parameters:
Returns: OrderContext
rte : string
ctx : OrderContext
Returns: OrderContext

setNthComponents ns ctx

Full Usage: setNthComponents ns ctx

Parameters:
Returns: Result<OrderContext, string>

Selects the components at these positions of the options. Returns an error when an index is out of range.

ns : int[]
ctx : OrderContext
Returns: Result<OrderContext, string>

settle contextOf narrow evaluate answer

Full Usage: settle contextOf narrow evaluate answer

Parameters:
    contextOf : 'a -> OrderContext
    narrow : 'a -> 'a
    evaluate : 'a -> Result<'a, 'e>
    answer : 'a

Returns: Result<'a, 'e>
Type parameters: 'a, 'e

Narrows the answer and evaluates it again while a pick list with one entry has no pick, at most five times, once for each list that can be left open. Stops when an evaluation does not change the narrowed filter. Returns the error of a failed evaluation.

contextOf : 'a -> OrderContext
narrow : 'a -> 'a
evaluate : 'a -> Result<'a, 'e>
answer : 'a
Returns: Result<'a, 'e>

toString stage ctx

Full Usage: toString stage ctx

Parameters:
Returns: string
Type parameters: 'a
stage : 'a
ctx : OrderContext
Returns: string

totalsFor routeMapping formRoutes totalsData norms patientData orders

Full Usage: totalsFor routeMapping formRoutes totalsData norms patientData orders

Parameters:
Returns: Totals

The totals over the orders whose route and form are marked Totals, for the age, weight and gestational age of the patient. Each total is checked against the norm in norms with the name of its Totals row, or else against the standard norm of the row.

routeMapping : RouteMapping array
formRoutes : FormRoute[]
totalsData : TotalsData array
norms : TotalNorm array
patientData : PatientData
orders : Order array
Returns: Totals

updateFilterIfOneScenario ctx

Full Usage: updateFilterIfOneScenario ctx

Parameters:
Returns: OrderContext
ctx : OrderContext
Returns: OrderContext

withDoseRulesOf ctx provider

Full Usage: withDoseRulesOf ctx provider

Parameters:
Returns: IResourceProvider

Wraps the provider so its dose rules are the dose rules of the context from doseRulesOf. Every dose rule lookup of an evaluation with the wrapped provider reads them: the pick lists, the scenarios and the refusal.

ctx : OrderContext
provider : IResourceProvider
Returns: IResourceProvider

withFilterPicks ctx

Full Usage: withFilterPicks ctx

Parameters:
Returns: OrderContext

Sets each filter choice to its pick from filterPicks. A choice that is made stays, a list with one option sets that option as the choice, and a list of more options stays without a choice.

ctx : OrderContext
Returns: OrderContext

withListsOfOtherPicks logger provider ctx

Full Usage: withListsOfOtherPicks logger provider ctx

Parameters:
Returns: OrderContext

Sets each pick list of a refused context to the options the rules for the patient give with all the other picks, so a pick that does not fit can be changed. The picks are not changed. For a child without a weight the lists are not changed.

logger : Logger
provider : IResourceProvider
ctx : OrderContext
Returns: OrderContext

withScenarios ctx meds scenarios

Full Usage: withScenarios ctx meds scenarios

Parameters:
Returns: Outcome<OrderContext>

Sets the scenarios on the context. Refuses with NoDiluent when there are no scenarios and every medication lacks a needed diluent. The medications are only made when there are no scenarios.

ctx : OrderContext
meds : unit -> Medication[]
scenarios : OrderScenario[]
Returns: Outcome<OrderContext>

Type something to start searching.