Logo GenPRES

Api Module

Creates the cached resource provider for a spreadsheet and reloads its cache, gives access to the loaded resources of a provider, and filters dose rules, solution rules and prescription rules for a patient.

Types

Type Description

CorePatientDataResources

Functions and values

Function or value Description

filterDoseRules provider filter doseRules

Full Usage: filterDoseRules provider filter doseRules

Parameters:
Returns: DoseRule array
provider : IResourceProvider
filter : DoseFilter
doseRules : DoseRule array
Returns: DoseRule array

filterPredilutions provider pat solutionRules

Full Usage: filterPredilutions provider pat solutionRules

Parameters:
Returns: ProductPredilution array

Returns the predilution rules of the provider for the solution rules and the patient, as SolutionRule.filterPredilutions selects them.

provider : IResourceProvider
pat : PatientData
solutionRules : SolutionRule[]
Returns: ProductPredilution array

filterPrescriptionRules provider filter

Full Usage: filterPrescriptionRules provider filter

Parameters:
Returns: Result<PrescriptionRule array, Message list>
provider : IResourceProvider
filter : DoseFilter
Returns: Result<PrescriptionRule array, Message list>

filterSolutionRules provider filter solutionRules

Full Usage: filterSolutionRules provider filter solutionRules

Parameters:
Returns: SolutionRule array

Returns the solution rules that match the filter, with the route mapping of the provider.

provider : IResourceProvider
filter : SolutionFilter
solutionRules : SolutionRule[]
Returns: SolutionRule array

get key provider

Full Usage: get key provider

Parameters:
Returns: 'T
Type parameters: 'T

Returns the registered resource for a typed key.

key : ResourceKey<'T>
provider : IResourceProvider
Returns: 'T

getCachedProviderWithDataUrlId logger dataUrlId

Full Usage: getCachedProviderWithDataUrlId logger dataUrlId

Parameters:
    logger : Logger
    dataUrlId : string

Returns: IResourceProvider
logger : Logger
dataUrlId : string
Returns: IResourceProvider

getDoseRules provider

Full Usage: getDoseRules provider

Parameters:
Returns: DoseRule[]
provider : IResourceProvider
Returns: DoseRule[]

getGStandProvider provider

Full Usage: getGStandProvider provider

Parameters:
Returns: GStandProvider
provider : IResourceProvider
Returns: GStandProvider

getNKFLinkProvider provider

Full Usage: getNKFLinkProvider provider

Parameters:
Returns: LinkProvider

Returns the link lookup for the Nederlands Kinderformularium, used by DoseRule.Print.toMarkdown.

When the resource load failed, Get raises KeyNotFoundException and this returns Source.getLink Set.empty [] instead, so a missing link never fails a request. A single Get call avoids the race of an IsLoaded check followed by Get while a reload fails.

provider : IResourceProvider
Returns: LinkProvider

getPatientDataResources provider

Full Usage: getPatientDataResources provider

Parameters:
Returns: CorePatientDataResources option

Returns the resources the patient data is completed with: the normal-value tables, the calculation weights and heights, and the eGFR band options. None when the normal-value rows did not parse.

provider : IResourceProvider
Returns: CorePatientDataResources option

getPrescriptionRules provider

Full Usage: getPrescriptionRules provider

Parameters:
Returns: PatientData -> Result<PrescriptionRule[], Message list>

Returns the prescription rules of the patient. The rules come from the cache of the load when the provider holds a cache, gives the solution rules, renal rules, route mappings, additive lookup and product predilutions the cache was built from, and gives the dose rules or the stand-alone dose rules of that load. Otherwise the rules are built on every call. A reload between the reads, or a provider that wraps another, can give other rules.

provider : IResourceProvider
Returns: PatientData -> Result<PrescriptionRule[], Message list>

getProductPredilutions provider

Full Usage: getProductPredilutions provider

Parameters:
Returns: ProductPredilution[]

Returns the product predilutions: the predilution rules, each with the substances of its diluent.

provider : IResourceProvider
Returns: ProductPredilution[]

getRenalRules provider

Full Usage: getRenalRules provider

Parameters:
Returns: RenalRule[]
provider : IResourceProvider
Returns: RenalRule[]

getRouteMapping provider

Full Usage: getRouteMapping provider

Parameters:
Returns: RouteMapping[]
provider : IResourceProvider
Returns: RouteMapping[]

getRuleSets provider pat

Full Usage: getRuleSets provider pat

Parameters:
Returns: RuleSet array

Reads the rule sets from the rule set data of the provider on every call, so a reload of the resources is seen. Each rule set has only the rules that apply to the patient.

provider : IResourceProvider
pat : PatientData
Returns: RuleSet array

getSolutionRules provider

Full Usage: getSolutionRules provider

Parameters:
Returns: SolutionRule[]
provider : IResourceProvider
Returns: SolutionRule[]

getTotals provider

Full Usage: getTotals provider

Parameters:
Returns: TotalsData[]
provider : IResourceProvider
Returns: TotalsData[]

isAdditive provider

Full Usage: isAdditive provider

Parameters:
Returns: string -> bool

Returns a lookup that tells whether the Formulary marks the product with a GPK as an additive.

provider : IResourceProvider
Returns: string -> bool

noRulesWarning filter

Full Usage: noRulesWarning filter

Parameters:
Returns: Message

Creates a warning that no prescription rule matches the filter, with its generic, route and form.

filter : DoseFilter
Returns: Message

reloadCache logger provider

Full Usage: reloadCache logger provider

Parameters:
logger : Logger
provider : IResourceProvider

Type something to start searching.