Logo GenPRES

GenOrderTools Module

Input/output types and tool handler functions for GenORDER MCP tools. All tools are read-only and delegate to GenOrder.Lib API functions.

Types

Type Description

CoreGender

CreateOrderContextInput

DoseRulesForContextInput

FilterOptionsInput

FilterOptionsOutput

OrderContextSummaryOutput

OrderScenarioOutput

SolutionRulesForContextInput

Functions and values

Function or value Description

applyFilters input ctx

Full Usage: applyFilters input ctx

Parameters:
Returns: OrderContext

The context with each filter the input names set, and each one it leaves out untouched.

input : CreateOrderContextInput
ctx : OrderContext
Returns: OrderContext

buildPatient today provider input

Full Usage: buildPatient today provider input

Parameters:
Returns: Result<PatientData, string>

Builds the patient data from the tool input through the patient data Dto. GenCORE completes it with the resources of the provider. Returns an error when a value of the input is invalid.

today : DateTime
provider : IResourceProvider
input : CreateOrderContextInput
Returns: Result<PatientData, string>

checkDepartment departments input

Full Usage: checkDepartment departments input

Parameters:
Returns: Result<CreateOrderContextInput, string>

The input with its department one the rules know, spelled as they spell it; none selects only the rules without a department. A department the rules do not know is refused with the names they do, since the department selects the rules and a misspelt one would silently select none. The spelling given wins when the rules know it; another case is taken only when it names exactly one of them, since the rules compare exactly.

departments : string[]
input : CreateOrderContextInput
Returns: Result<CreateOrderContextInput, string>

createOrderContext today provider input

Full Usage: createOrderContext today provider input

Parameters:
Returns: Result<OrderContextSummaryOutput, string>

evaluateOrderContext today provider input

Full Usage: evaluateOrderContext today provider input

Parameters:
Returns: Result<OrderContext, string>

The order context for the input's patient and filter selection, evaluated against the given provider. The patient is checked by validPatient; shared by createOrderContext and getOrderScenarios so the guards and the patient/filter/evaluate pipeline exist in exactly one place.

today : DateTime
provider : IResourceProvider
input : CreateOrderContextInput
Returns: Result<OrderContext, string>

evaluationFailed reason

Full Usage: evaluationFailed reason

Parameters:
    reason : string

Returns: string

The error a tool answers when the evaluation did not give a context.

reason : string
Returns: string

filterOptionsFor provider patientData input

Full Usage: filterOptionsFor provider patientData input

Parameters:
Returns: FilterOptionsOutput

The filter options for a patient already built and checked, so a caller that has just validated one (createOrderContext) asks for the options of the same patient, without a second check. The patient fields of the input are not read.

provider : IResourceProvider
patientData : PatientData
input : FilterOptionsInput
Returns: FilterOptionsOutput

getDoseRulesForContext provider input

Full Usage: getDoseRulesForContext provider input

Parameters:
Returns: (type) array
provider : IResourceProvider
input : DoseRulesForContextInput
Returns: (type) array

getFilterOptions today provider input

Full Usage: getFilterOptions today provider input

Parameters:
Returns: Result<FilterOptionsOutput, string>

The filter options for the patient of the input, refused when the input is no patient (see validPatient). The tool wrapper of filterOptionsFor.

today : DateTime
provider : IResourceProvider
input : FilterOptionsInput
Returns: Result<FilterOptionsOutput, string>

getOrderScenarios today provider input

Full Usage: getOrderScenarios today provider input

Parameters:
Returns: Result<OrderScenarioOutput[], string>
today : DateTime
provider : IResourceProvider
input : CreateOrderContextInput
Returns: Result<OrderScenarioOutput[], string>

getSolutionRulesForContext provider input

Full Usage: getSolutionRulesForContext provider input

Parameters:
Returns: (type) array
provider : IResourceProvider
input : SolutionRulesForContextInput
Returns: (type) array

hasAge input

Full Usage: hasAge input

Parameters:
Returns: bool

Whether the input gives any part of an age.

input : CreateOrderContextInput
Returns: bool

noEstimate missing

Full Usage: noEstimate missing

Parameters:
    missing : string list

Returns: string

The refusal when a measure could not be estimated from the age and sex given: the normal-value tables are not loaded, or hold no row for that age and sex. Names the measures the caller has to give, the ones still blank.

missing : string list
Returns: string

parseGender s

Full Usage: parseGender s

Parameters:
    s : string

Returns: Gender

Reads a gender from a string. Any string other than male or female is an unknown gender.

s : string
Returns: Gender

patientAge pat

Full Usage: patientAge pat

Parameters:
Returns: int option * int option * int option * int option

The age parts of the patient as GenCORE completed them; none without an age.

pat : PatientData
Returns: int option * int option * int option * int option

patientWeightKg pat

Full Usage: patientWeightKg pat

Parameters:
Returns: float option

The calculation weight of the patient in kg as GenCORE completed it, measured or estimated; none without one.

pat : PatientData
Returns: float option

readPatientData today resources dto

Full Usage: readPatientData today resources dto

Parameters:
Returns: Result<PatientData, string>

Reads patient data from a Dto on a date, with the resources when they are given. Returns the GenCORE messages when a value is invalid.

today : DateTime
resources : PatientDataResources option
dto : Dto
Returns: Result<PatientData, string>

refusalReason _arg1

Full Usage: refusalReason _arg1

Parameters:
Returns: string

Why the evaluation was refused, in the words a caller of the tools can act on.

_arg1 : Refusal
Returns: string

refusedAsError outcome

Full Usage: refusedAsError outcome

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

An evaluation as the tools answer it: the value evaluated, or an error that gives the reason for the refusal.

outcome : Outcome<'a>
Returns: Result<'a, string>

requireAgeOrMeasures input

Full Usage: requireAgeOrMeasures input

Parameters:
Returns: Result<unit, string>

Whether the input is a patient by the domain rule: an age, or a measured weight and height. With an age alone the weight and height are estimated, as the web client does; without either the rules would silently answer nothing, so the call is refused.

input : CreateOrderContextInput
Returns: Result<unit, string>

validPatient today provider input

Full Usage: validPatient today provider input

Parameters:
Returns: Result<(CreateOrderContextInput * PatientData), string>

The patient of the input, checked: an age or both measures (see requireAgeOrMeasures), a department the rules know if one is given (see checkDepartment), and, after the estimate, a patient the rules are looked up for: an adult, or a child with a weight. The rules would silently answer nothing for a child without a weight, so the caller is told to give it. Returns the input with the department as the rules spell it, next to the patient built from it.

today : DateTime
provider : IResourceProvider
input : CreateOrderContextInput
Returns: Result<(CreateOrderContextInput * PatientData), string>

Type something to start searching.