Logo GenPRES

Source Module

Declares the type of a Kinderformularium entry and the type of a link provider, converts a source to text, finds the Kinderformularium entry of a generic for a route, and builds the Markdown link to the Kinderformularium or the Farmacotherapeutisch Kompas for a generic.

Types

Type Description

LinkProvider

Returns the external formulary link for a source, the route of the rule and a generic label, or None when there is none. A function type, so DoseRule.Print stays pure and the resources load the NKF index.

NKFMedication

One Nederlands Kinder Formularium (NKF) entry: the generic name and the id its URL is built from.

Functions and values

Function or value Description

getLink routeWords meds source route gen

Full Usage: getLink routeWords meds source route gen

Parameters:
Returns: string option

Returns the Markdown link for the source NKF or FTK, the route of the rule and the generic label, with the name of the source as the text, or None for another source or a generic without a link. Only the NKF link reads routeWords, meds and the route, so an empty list, used when the NKF index could not be fetched, loses only the NKF links.

routeWords : Set<string>
meds : NKFMedication list
source : Source
route : string
gen : GenericLabel
Returns: string option

identified Item

Full Usage: identified Item

Parameters:
    Item : string

Returns: Source
Item : string
Returns: Source

name source

Full Usage: name source

Parameters:
Returns: string

Returns the name of a source as the formulary writes it: Kinderformularium for NKF, Farmacotherapeutisch Kompas for FTK, Lokaal for an empty source, and the text of any other source.

source : Source
Returns: string

nkfAdditionWords name

Full Usage: nkfAdditionWords name

Parameters:
    name : string

Returns: Set<string>

Returns the words in the parentheses of an NKF name, as oraal, en and intraveneus for "aciclovir (oraal en intraveneus)".

name : string
Returns: Set<string>

nkfBaseName name

Full Usage: nkfBaseName name

Parameters:
    name : string

Returns: string

Returns the NKF name without the parts in parentheses, as "adrenaline" for "adrenaline (epinefrine)".

name : string
Returns: string

nkfGeneric name

Full Usage: nkfGeneric name

Parameters:
    name : string

Returns: string

Returns the NKF name with the generics of a combination joined by "/" instead of "+".

name : string
Returns: string

noLinks arg1 arg2 arg3

Full Usage: noLinks arg1 arg2 arg3

Parameters:
Returns: string option

A link provider that never finds a link, for scripts and tests without external links. The resources use getLink with an empty index instead when the NKF fetch fails, which keeps the FTK links.

arg0 : Source
arg1 : string
arg2 : GenericLabel
Returns: string option

other Item

Full Usage: other Item

Parameters:
    Item : string

Returns: Source
Item : string
Returns: Source

toString _arg1

Full Usage: toString _arg1

Parameters:
Returns: string
_arg1 : Source
Returns: string

tryFindNKFMedication routeWords meds route gen

Full Usage: tryFindNKFMedication routeWords meds route gen

Parameters:
    routeWords : Set<string>
    meds : NKFMedication list
    route : string
    gen : string

Returns: NKFMedication option

Returns the NKF entry of the generic name: the entry with the generic as its whole name, else the single entry with the generic as its name without the parts in parentheses when its parentheses name no route of routeWords, else the single one of those entries that has the route as a word in its parentheses. Returns None when no single entry is found.

routeWords : Set<string>
meds : NKFMedication list
route : string
gen : string
Returns: NKFMedication option

Type something to start searching.