Logo GenPRES

DoseRule Module

Creates a G-Standaard dose rule for a generic, adds indications, routes, forms and patient dosages, converts units and turns the dose rule into Markdown text.

Types and nested modules

Type/Module Description

Dosage

Creates a dosage with start, single, rate and total dose ranges and a frequency, converts the units and turns the dosage into text.

DoseRange

Creates a dose range with normal and absolute limits, each also per kg and per m2, and calculates and converts dose ranges and turns them into text.

Dto

Holds the Dto of a G-Standaard dose rule and the conversions to and from the Dto.

FormDosage

Creates the dosage of pharmaceutical forms with generic products and trade products. A form that is empty or only white space gives None.

IndicationDosage

Creates the dosage of a list of indications, without route dosages.

Operators

Holds two operators that apply a function to the second and then the first element of a pair. The second operator returns the result paired with the second element.

Optics

Gets and adds the route dosages, gets, sets and adds the form and patient dosages, and gets and sets the substance dosages of a dose rule, found by indication, route, form and patient. The module also sets the generic name and the synonyms of a dose rule, and the generic and trade products of a form dosage.

PatientDosage

Creates a patient dosage for a patient category, with an empty form dosage and without substance dosages.

RouteDosage

Creates the dosage of a route, without form dosages. A route that is empty or only white space gives None.

TextConfig

A type to configure the text output of a DoseRule.

Functions and values

Function or value Description

addIndications inds dr

Full Usage: addIndications inds dr

Parameters:
    inds : string list - The list of Indications
    dr : DoseRule - The DoseRule

Returns: DoseRule

Add an IndicationDosage to a DoseRule.

inds : string list

The list of Indications

dr : DoseRule

The DoseRule

Returns: DoseRule

apply f dr

Full Usage: apply f dr

Parameters:
Returns: 'a
Type parameters: 'a

Utility function to apply a function f to a DoseRule dr.

f : DoseRule -> 'a
dr : DoseRule
Returns: 'a

convertRateUnitTo gen u dr

Full Usage: convertRateUnitTo gen u dr

Parameters:
    gen : string - The Generic
    u : Unit - The new RateUnit
    dr : DoseRule - The DoseRule

Returns: DoseRule

Convert the RateUnit of a DoseRule to a new RateUnit.

gen : string

The Generic

u : Unit

The new RateUnit

dr : DoseRule

The DoseRule

Returns: DoseRule

convertSubstanceUnitTo gen u dr

Full Usage: convertSubstanceUnitTo gen u dr

Parameters:
    gen : string - The Generic
    u : Unit - The new SubstanceUnit
    dr : DoseRule - The DoseRule

Returns: DoseRule

Convert the SubstanceUnit of a DoseRule to a new SubstanceUnit.

gen : string

The Generic

u : Unit

The new SubstanceUnit

dr : DoseRule

The DoseRule

Returns: DoseRule

create gen syn atc thg sub ggp gsg idl

Full Usage: create gen syn atc thg sub ggp gsg idl

Parameters:
    gen : string - The Generic
    syn : string list - Synonyms for the Generic
    atc : string - The ATC5 code for the Generic
    thg : string - The TherapeuticGroup for the Generic
    sub : string - The TherapeuticSubGroup for the Generic
    ggp : string - The GenericGroup for the Generic
    gsg : string - The GenericSubGroup for the Generic
    idl : IndicationDosage list - The list of IndicationDosages

Returns: DoseRule

Create a DoseRule.

gen : string

The Generic

syn : string list

Synonyms for the Generic

atc : string

The ATC5 code for the Generic

thg : string

The TherapeuticGroup for the Generic

sub : string

The TherapeuticSubGroup for the Generic

ggp : string

The GenericGroup for the Generic

gsg : string

The GenericSubGroup for the Generic

idl : IndicationDosage list

The list of IndicationDosages

Returns: DoseRule

createDosage n

Full Usage: createDosage n

Parameters:
    n : string

Returns: Dosage

Create a Dosage.

n : string
Returns: Dosage

createFormDosage

Full Usage: createFormDosage

Returns: string list -> GenericProductLabel list -> TradeProductLabel list -> FormDosage option

Create a FormDosage.

Returns: string list -> GenericProductLabel list -> TradeProductLabel list -> FormDosage option

createIndicationDosage

Full Usage: createIndicationDosage

Returns: string list -> IndicationDosage

Create an IndicationDosage.

Returns: string list -> IndicationDosage

createPatientDosage

Full Usage: createPatientDosage

Returns: PatientCategory -> PatientDosage

Create a PatientDosage.

Returns: PatientCategory -> PatientDosage

createRouteDosage

Full Usage: createRouteDosage

Returns: string -> RouteDosage option

Create a RouteDosage.

Returns: string -> RouteDosage option

createSubstanceDosage sn

Full Usage: createSubstanceDosage sn

Parameters:
    sn : string

Returns: Dosage option

Create a Dosage for a Substance.

sn : string
Returns: Dosage option

get

Full Usage: get

Returns: DoseRule -> DoseRule

Utility function to enable type inference.

Returns: DoseRule -> DoseRule

indxForm inds rt frm dr

Full Usage: indxForm inds rt frm dr

Parameters:
    inds : string list - The list of Indications
    rt : string - The Route
    frm : string list - The Form
    dr : DoseRule - The DoseRule

Returns: (int * int * int) option

Try find the indexs of a FormDosage in a DoseRule.

inds : string list

The list of Indications

rt : string

The Route

frm : string list

The Form

dr : DoseRule

The DoseRule

Returns: (int * int * int) option

indxIndications inds dr

Full Usage: indxIndications inds dr

Parameters:
    inds : string list - The list of Indications
    dr : DoseRule - The DoseRule

Returns: int option

Try find the index of an IndicationDosage in a DoseRule.

inds : string list

The list of Indications

dr : DoseRule

The DoseRule

Returns: int option

indxPatient inds rt frm pat dr

Full Usage: indxPatient inds rt frm pat dr

Parameters:
    inds : string list - The list of Indications
    rt : string - The Route
    frm : string list - The Form
    pat : PatientCategory - The PatientCategory
    dr : DoseRule - The DoseRule

Returns: (int * int * int * int) option

Try find the indexes of a PatientDosage in a DoseRule.

inds : string list

The list of Indications

rt : string

The Route

frm : string list

The Form

pat : PatientCategory

The PatientCategory

dr : DoseRule

The DoseRule

Returns: (int * int * int * int) option

indxRoute inds rt dr

Full Usage: indxRoute inds rt dr

Parameters:
    inds : string list - The list of Indications
    rt : string - The Route
    dr : DoseRule - The DoseRule

Returns: (int * int) option

Try find the indexs of a RouteDosage in a DoseRule.

inds : string list

The list of Indications

rt : string

The Route

dr : DoseRule

The DoseRule

Returns: (int * int) option

mdConfig

Full Usage: mdConfig

Returns: TextConfig

A Markdown text configuration for a DoseRule.

Returns: TextConfig

mdDosageText

Full Usage: mdDosageText

Returns: string
Returns: string

mdFormText

Full Usage: mdFormText

Returns: string
Returns: string

mdIndicationText

Full Usage: mdIndicationText

Returns: string
Returns: string

mdPatientText

Full Usage: mdPatientText

Returns: string
Returns: string

mdRouteText

Full Usage: mdRouteText

Returns: string
Returns: string

mdText

Full Usage: mdText

Returns: string
Returns: string

toString

Full Usage: toString

Returns: bool -> DoseRule -> string

Get the Markdown text of a DoseRule.

Returns: bool -> DoseRule -> string

toStringWithConfig config printRules dr

Full Usage: toStringWithConfig config printRules dr

Parameters:
    config : TextConfig - The textConfig
    printRules : bool - Whether to print the original DoseRules
    dr : DoseRule - The DoseRule

Returns: string

Convert a DoseRule to a string using a TextConfig.

config : TextConfig

The textConfig

printRules : bool

Whether to print the original DoseRules

dr : DoseRule

The DoseRule

Returns: string

Type something to start searching.