Logo GenPRES

GStand Module

Builds dose rules for a generic, a form and a route from the G-Standaard products and dose rules, for an optional age, weight, body surface area and generic product code.

Functions and values

Function or value Description

addIndicationsRoutesFormPatientDosages dr inds

Full Usage: addIndicationsRoutesFormPatientDosages dr inds

Parameters:
    dr : DoseRule - The starting Gstand DoseRule record
    inds : (type) seq - The indications, routes, form, patient and dosages

Returns: DoseRule

Add indications, routes, pharmaceutical form, patient and dosages to a starting GStand DoseRule.

dr : DoseRule

The starting Gstand DoseRule record

inds : (type) seq

The indications, routes, form, patient and dosages

Returns: DoseRule

calcBSAMinMax drs

Full Usage: calcBSAMinMax drs

Parameters:
Returns: MinMax -> MinMax

Get the min max bsa if there is one min bsa or max bsa i.e. if all min bsa are the same and all max bsa are the same.

drs : DoseRule seq

Returns: MinMax -> MinMax
System.InvalidOperationException Cannot calculate bsa min max with: {drs}

calcWeightMinMax drs

Full Usage: calcWeightMinMax drs

Parameters:
Returns: MinMax -> MinMax

Get the min max weight if there is one min weight or max weight i.e. if all min weights are the same and all max weights are the same.

drs : DoseRule seq

Returns: MinMax -> MinMax
System.InvalidOperationException Cannot calculate weight min max with: {drs}

config

Full Usage: config

Returns: CreateConfig

An empty CreateConfig.

Returns: CreateConfig

createDoseRules cfg age wght bsa gpk gen frm rte

Full Usage: createDoseRules cfg age wght bsa gpk gen frm rte

Parameters:
    cfg : CreateConfig - The CreateConfig
    age : AgeInMo - Age in Months
    wght : WeightInKg - Weight in Kg
    bsa : BSAInM2 - Body Surface Area in mˆ2
    gpk : int option - Optional GPK
    gen : string - Generic Name
    frm : string - Form
    rte : string - Route

Returns: DoseRule seq

Create the DoseRules.

The GPK is used to filter the GenPresProducts and use those GenericProducts to create the DoseRules. If the GPK is None then generic name, pharmaceutical form and route are used to filter the GenPresProducts.

cfg : CreateConfig

The CreateConfig

age : AgeInMo

Age in Months

wght : WeightInKg

Weight in Kg

bsa : BSAInM2

Body Surface Area in mˆ2

gpk : int option

Optional GPK

gen : string

Generic Name

frm : string

Form

rte : string

Route

Returns: DoseRule seq

foldDosages ds

Full Usage: foldDosages ds

Parameters:
    ds : (type) seq - The sequence of Dosages

Returns: (type)

Folds a sequence of Dosages to a single Dosages by minimizing the min and maximizing the max values.

ds : (type) seq

The sequence of Dosages

Returns: (type)

foldDoseRules rte age wght bsa gpk cfg dr gpps

Full Usage: foldDoseRules rte age wght bsa gpk cfg dr gpps

Parameters:
Returns: DoseRule

Fold the GenPresProducts to a single DoseRule.

rte : string

The route

age : AgeInMo

Age in Months

wght : WeightInKg

Weight in Kg

bsa : BSAInM2

Body Surface Area in mˆ2

gpk : int option

Optional GPK

cfg : CreateConfig

The CreateConfig

dr : DoseRule

The DoseRule

gpps : GenPresProduct seq

The GenPresProducts

Returns: DoseRule

foldMaximize mm mm_

Full Usage: foldMaximize mm mm_

Parameters:
Returns: MinMax

Folds two ranges into the widest range, with the smallest minimum and the largest maximum.

mm : MinMax
mm_ : MinMax
Returns: MinMax

getATCGroups gpk gpp

Full Usage: getATCGroups gpk gpp

Parameters:
Returns: ATCGroup array

Get the list of ATC groups for a GenPresProduct.

gpk : int option
gpp : GenPresProduct
Returns: ATCGroup array

getATCs gpk gpp

Full Usage: getATCs gpk gpp

Parameters:
Returns: string array

Get the ATC codes for a GenPresProduct.

gpk : int option
gpp : GenPresProduct
Returns: string array

getDosage cfg n dsr

Full Usage: getDosage cfg n dsr

Parameters:
    cfg : CreateConfig - The Config
    n : string - The 'Name' of the Dosage
    dsr : (type) - The DoseRules

Returns: (type)

Get the Dosage and Indications for a given DoseRange and list of DoseRules. Uses a config to create a Dosage with a start, rate or total dose.

cfg : CreateConfig

The Config

n : string

The 'Name' of the Dosage

dsr : (type)

The DoseRules

Returns: (type)

getDoseRange dsg

Full Usage: getDoseRange dsg

Parameters:
    dsg : (type) - The DoseRange to map to

Returns: (type) The mapped DoseRange {| doseRange: DoseRange; doserules: list of Informedica.ZIndex.Lib.Types.DoseRule; frequencies: list of ValueUnit; inds: list of string; routes: list of string |}

Map MinMax DoseRanges to a DoseRange record.

dsg : (type)

The DoseRange to map to

Returns: (type)

The mapped DoseRange {| doseRange: DoseRange; doserules: list of Informedica.ZIndex.Lib.Types.DoseRule; frequencies: list of ValueUnit; inds: list of string; routes: list of string |}

getPatients cfg drs

Full Usage: getPatients cfg drs

Parameters:
Returns: (type) seq {| doseRules: DoseRule seq; patientCategory: PatientCategory; substanceDoses: {| Dosage: Dosage; indications: string list |} seq |} seq

Create the Dosages for a given list of DoseRules for a PatientCategory.

cfg : CreateConfig

The Config

drs : DoseRule seq

The ZIndex DoseRules

Returns: (type) seq

{| doseRules: DoseRule seq; patientCategory: PatientCategory; substanceDoses: {| Dosage: Dosage; indications: string list |} seq |} seq

getRoutes gpp

Full Usage: getRoutes gpp

Parameters:
Returns: string array

Get the list of routes for a GenPresProduct.

gpp : GenPresProduct
Returns: string array

getSubstanceDoses cfg drs

Full Usage: getSubstanceDoses cfg drs

Parameters:
Returns: (type) seq

Create the Dosages for a given list of DoseRules for a Substance.

cfg : CreateConfig

The Config

drs : DoseRule seq

The DoseRules

Returns: (type) seq

getTradeNames gpp

Full Usage: getTradeNames gpp

Parameters:
Returns: string list

Get a list of TradeNames for a GenPresProduct.

gpp : GenPresProduct
Returns: string list

groupByFst xs

Full Usage: groupByFst xs

Parameters:
    xs : ('a * 'b) seq

Returns: ('a * 'b seq) seq
Type parameters: 'a, 'b (requires comparison)

Utility function to get the grouped sequence of a seq of tuples. Grouping is by the first element of the tuple.

xs : ('a * 'b) seq
Returns: ('a * 'b seq) seq
Example

 let xs = [ (1, "a"); (1, "b"); (2, "c"); (2, "d") ]
 groupByFst xs |> Seq.toList
 // [(1, seq ["a"; "b"]); (2, seq ["c"; "d"])]
val xs: (int * string) list
module Seq from Microsoft.FSharp.Collections
val toList: source: 'T seq -> 'T list

groupGenPresProducts rte age wght bsa gpk cfg gpps

Full Usage: groupGenPresProducts rte age wght bsa gpk cfg gpps

Parameters:
Returns: (type) seq The grouped GenPresProducts.

Group the GenPresProducts by indications, routes, pharmaceutical form and products and add the patients and dosages.

rte : string

The route

age : AgeInMo

Age in Months

wght : WeightInKg

Weight in Kg

bsa : BSAInM2

Body Surface Area in mˆ2

gpk : int option

Optional GPK

cfg : CreateConfig

The CreateConfig

gpps : GenPresProduct seq

The GenPresProducts

Returns: (type) seq

The grouped GenPresProducts.

mapDoses n qty unit gstdsr

Full Usage: mapDoses n qty unit gstdsr

Parameters:
    n : string - The name of the substance
    qty : float - The quantity of the substance
    unit : Unit - The unit of the substance
    gstdsr : DoseRule - The GSTand DoseRule

Returns: (type) The mapped doses {| absDose: MinIncrMax; absM2: MinIncrMax; absPerKg: MinIncrMax; doserule: Informedica.ZIndex.Lib.Types.DoseRule; frequency: ValueUnit; groupBy: {| isOne: bool; name: string; time: string |}; indication: string; normDose: MinIncrMax; normM2: MinIncrMax; normPerKg: MinIncrMax; routes: list of string |}

Map G-Standard DoseRule doses to

  • normal min max dose
  • absolute min max dose
  • normal min max dose per kg
  • absolute min max dose per kg
  • normal min max dose per m2
  • absolute min max dose per m2
by calculating - substance form concentration * dose form quantity * frequency for each dose

n : string

The name of the substance

qty : float

The quantity of the substance

unit : Unit

The unit of the substance

gstdsr : DoseRule

The GSTand DoseRule

Returns: (type)

The mapped doses {| absDose: MinIncrMax; absM2: MinIncrMax; absPerKg: MinIncrMax; doserule: Informedica.ZIndex.Lib.Types.DoseRule; frequency: ValueUnit; groupBy: {| isOne: bool; name: string; time: string |}; indication: string; normDose: MinIncrMax; normM2: MinIncrMax; normPerKg: MinIncrMax; routes: list of string |}

mapFreqToValueUnit freq

Full Usage: mapFreqToValueUnit freq

Parameters:
Returns: ValueUnit The mapped frequency

Map GStand frequency string to a valid frequency ValueUnit.

freq : RuleFrequency

The frequency to map

Returns: ValueUnit

The mapped frequency

System.FormatException Cannot parse freq value unit
Example

 let freq : ZIndexTypes.RuleFrequency = { Frequency = 1.; Time = "dag" }
 mapFreq fr
 // ValueUnit ([|1N|], CombiUnit (Count (Times 1N), OpPer, Time (Day 1N)))
val freq: 'a

mapMinMax setMin setMax minmax minIncrMax

Full Usage: mapMinMax setMin setMax minmax minIncrMax

Parameters:
    setMin : Option<float> -> 'a -> 'a - Set the min value
    setMax : Option<float> -> 'a -> 'a - Set the max value
    minmax : RuleMinMax - The min max values
    minIncrMax : 'a - The minIncrMax to map to

Returns: 'a
Type parameters: 'a

Map a ZIndex MinMax to a GenCore MinIncrMax

setMin : Option<float> -> 'a -> 'a

Set the min value

setMax : Option<float> -> 'a -> 'a

Set the max value

minmax : RuleMinMax

The min max values

minIncrMax : 'a

The minIncrMax to map to

Returns: 'a
Example

 let setMin = ((Option.map ValueUnit.weightInKg) >> (Optic.set MinIncrMax.Optics.inclMinLens))
 let setMax = ((Option.map ValueUnit.weightInKg) >> (Optic.set MinIncrMax.Optics.inclMaxLens))
 mapMinMax setMin setMax DR.minmax MinIncrMax.empty
val setMin: (obj option -> obj)
module Option from Microsoft.FSharp.Core
val map: mapping: ('T -> 'U) -> option: 'T option -> 'U option
val setMax: (obj option -> obj)

mapTime s

Full Usage: mapTime s

Parameters:
    s : string

Returns: Unit option

Try to map a GStand time period to a valid unit.

s : string
Returns: Unit option

mergeDosages d ds

Full Usage: mergeDosages d ds

Parameters:
Returns: Dosage seq
d : Dosage
ds : Dosage seq
Returns: Dosage seq

parseTimeString s

Full Usage: parseTimeString s

Parameters:
    s : string

Returns: string

Make sure that a GSTand time string is a valid unit time string.

s : string
Returns: string

Type something to start searching.