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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Functions and values
| Function or value |
Description
|
Full Usage:
applyFilters input ctx
Parameters:
CreateOrderContextInput
ctx : OrderContext
Returns: OrderContext
|
The context with each filter the input names set, and each one it leaves out untouched.
|
Full Usage:
buildPatient today provider input
Parameters:
DateTime
provider : IResourceProvider
input : CreateOrderContextInput
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.
|
Full Usage:
checkDepartment departments input
Parameters:
string[]
input : CreateOrderContextInput
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.
|
Full Usage:
createOrderContext today provider input
Parameters:
DateTime
provider : IResourceProvider
input : CreateOrderContextInput
Returns: Result<OrderContextSummaryOutput, string>
|
|
Full Usage:
evaluateOrderContext today provider input
Parameters:
DateTime
provider : IResourceProvider
input : CreateOrderContextInput
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.
|
Full Usage:
evaluationFailed reason
Parameters:
string
Returns: string
|
The error a tool answers when the evaluation did not give a context.
|
Full Usage:
filterOptionsFor provider patientData input
Parameters:
IResourceProvider
patientData : PatientData
input : FilterOptionsInput
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.
|
Full Usage:
getDoseRulesForContext provider input
Parameters:
IResourceProvider
input : DoseRulesForContextInput
Returns: (type) array
|
|
Full Usage:
getFilterOptions today provider input
Parameters:
DateTime
provider : IResourceProvider
input : FilterOptionsInput
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.
|
Full Usage:
getOrderScenarios today provider input
Parameters:
DateTime
provider : IResourceProvider
input : CreateOrderContextInput
Returns: Result<OrderScenarioOutput[], string>
|
|
Full Usage:
getSolutionRulesForContext provider input
Parameters:
IResourceProvider
input : SolutionRulesForContextInput
Returns: (type) array
|
|
|
|
Full Usage:
noEstimate missing
Parameters:
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.
|
|
Reads a gender from a string. Any string other than male or female is an unknown gender.
|
Full Usage:
patientAge pat
Parameters:
PatientData
Returns: int option * int option * int option * int option
|
The age parts of the patient as GenCORE completed them; none without an age.
|
|
The calculation weight of the patient in kg as GenCORE completed it, measured or estimated; none without one.
|
Full Usage:
readPatientData today resources dto
Parameters:
DateTime
resources : PatientDataResources option
dto : Dto
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.
|
|
Why the evaluation was refused, in the words a caller of the tools can act on.
|
|
|
Full Usage:
requireAgeOrMeasures input
Parameters:
CreateOrderContextInput
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.
|
Full Usage:
validPatient today provider input
Parameters:
DateTime
provider : IResourceProvider
input : CreateOrderContextInput
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.
|
GenPRES