Logo GenPRES

SourceLoader Module

Fetches the medication index of the Nederlands Kinderformularium and parses the JSON into a list of medications. A failed fetch returns an error with the reason.

Functions and values

Function or value Description

fetchNKFMedications ()

Full Usage: fetchNKFMedications ()

Parameters:
    () : unit

Returns: Result<NKFMedication list, Message list>

Fetches the NKF medication index from nkfUrl.

() : unit
Returns: Result<NKFMedication list, Message list>

fetchNKFMedicationsFrom url

Full Usage: fetchNKFMedicationsFrom url

Parameters:
    url : string

Returns: Result<NKFMedication list, Message list>

Fetches the NKF medication index from the url, or returns an error with the reason. The url is a parameter so tests can make the fetch fail.

url : string
Returns: Result<NKFMedication list, Message list>

nkfTimeout

Full Usage: nkfTimeout

Returns: TimeSpan

The fetch timeout, far below the 100 second HttpClient default, because a connection that hangs stalls the whole resource load for a link that is only an annotation.

Returns: TimeSpan

nkfUrl

Full Usage: nkfUrl

Returns: string

The NKF medication index, as JSON.

Returns: string

Type something to start searching.