Logo GenPRES

Mapping Module

Reads the Units, Routes, FormRoute, ValidForms, Totals, RuleSets and LinkRules sheets into rows and maps unit names and route names.

Nested modules

Modules Description

Constants

Holds the names of the sheets read by the mapping functions.

Functions and values

Function or value Description

eqsRoute routeMapping r1 r2

Full Usage: eqsRoute routeMapping r1 r2

Parameters:
    routeMapping : RouteMapping array
    r1 : string option
    r2 : string

Returns: bool
routeMapping : RouteMapping array
r1 : string option
r2 : string
Returns: bool

filterFormRoutes routeMapping mapping rte form unt

Full Usage: filterFormRoutes routeMapping mapping rte form unt

Parameters:
Returns: FormRoute array
routeMapping : RouteMapping array
mapping : FormRoute[]
rte : string
form : string
unt : Unit
Returns: FormRoute array

formRouteRow unitMapping

Full Usage: formRouteRow unitMapping

Parameters:
Returns: (string -> string) -> (string -> float option) -> FormRoute

Map one row of the "FormRoute" sheet, using the unit mappings to parse the units. The dose limits are read only when the dose unit, or else the unit, resolves.

unitMapping : UnitMapping array
Returns: (string -> string) -> (string -> float option) -> FormRoute

getData dataUrlId sheet apply

Full Usage: getData dataUrlId sheet apply

Parameters:
    dataUrlId : string
    sheet : string
    apply : (string -> string) -> (string -> float option) -> 'a

Returns: Result<'a array, Message list>
Type parameters: 'a
dataUrlId : string
sheet : string
apply : (string -> string) -> (string -> float option) -> 'a
Returns: Result<'a array, Message list>

getFormRoutes dataUrlId unitMapping

Full Usage: getFormRoutes dataUrlId unitMapping

Parameters:
Returns: Result<FormRoute array, Message list>
dataUrlId : string
unitMapping : UnitMapping array
Returns: Result<FormRoute array, Message list>

getLinkRules dataUrlId

Full Usage: getLinkRules dataUrlId

Parameters:
    dataUrlId : string

Returns: Result<LinkRuleData array, Message list>

Returns the rows of the "LinkRules" sheet, blank rows included, so each row keeps its sheet row number.

dataUrlId : string
Returns: Result<LinkRuleData array, Message list>

getRouteMapping dataUrlId

Full Usage: getRouteMapping dataUrlId

Parameters:
    dataUrlId : string

Returns: Result<RouteMapping array, Message list>
dataUrlId : string
Returns: Result<RouteMapping array, Message list>

getRuleSets dataUrlId

Full Usage: getRuleSets dataUrlId

Parameters:
    dataUrlId : string

Returns: Result<RuleSetData array, Message list>

Returns the rows of the "RuleSets" sheet, without the rows that have no category.

dataUrlId : string
Returns: Result<RuleSetData array, Message list>

getSheetRows urlId sheets

Full Usage: getSheetRows urlId sheets

Parameters:
    urlId : string
    sheets : string list

Returns: Result<Map<string, string[][]>, Message list>

Fetches the rows of each of the sheets, by sheet name. Returns an error when any sheet fails to load. GenCORE parses and checks the rows.

urlId : string
sheets : string list
Returns: Result<Map<string, string[][]>, Message list>

getTotals dataUrlId

Full Usage: getTotals dataUrlId

Parameters:
    dataUrlId : string

Returns: Result<TotalsData array, Message list>
dataUrlId : string
Returns: Result<TotalsData array, Message list>

getUnitMapping dataUrlId

Full Usage: getUnitMapping dataUrlId

Parameters:
    dataUrlId : string

Returns: Result<UnitMapping array, Message list>
dataUrlId : string
Returns: Result<UnitMapping array, Message list>

getValidForms dataUrlId

Full Usage: getValidForms dataUrlId

Parameters:
    dataUrlId : string

Returns: Result<string array, Message list>
dataUrlId : string
Returns: Result<string array, Message list>

linkRuleRow get arg2

Full Usage: linkRuleRow get arg2

Parameters:
    get : string -> string
    arg1 : string -> float option

Returns: LinkRuleData

A row of the "LinkRules" sheet, every cell trimmed.

get : string -> string
arg1 : string -> float option
Returns: LinkRuleData

mapRoute mapping s

Full Usage: mapRoute mapping s

Parameters:
Returns: string option
mapping : RouteMapping array
s : string
Returns: string option

mapUnit mapping s

Full Usage: mapUnit mapping s

Parameters:
Returns: Unit option
mapping : UnitMapping array
s : string
Returns: Unit option

parseSheet apply data

Full Usage: parseSheet apply data

Parameters:
    apply : (string -> string) -> (string -> float option) -> 'a
    data : string[][]

Returns: Result<'a array, Message list>
Type parameters: 'a
apply : (string -> string) -> (string -> float option) -> 'a
data : string[][]
Returns: Result<'a array, Message list>

requiresReconstitution routeMapping formRoutes (rtes, unt, form)

Full Usage: requiresReconstitution routeMapping formRoutes (rtes, unt, form)

Parameters:
Returns: bool
routeMapping : RouteMapping array
formRoutes : FormRoute[]
rtes : string array
unt : Unit
form : string
Returns: bool

routeMappingRow get arg2

Full Usage: routeMappingRow get arg2

Parameters:
    get : string -> string
    arg1 : string -> float option

Returns: RouteMapping

Map one row of the "Routes" sheet. A separate function so the column-contract test runs without IO.

get : string -> string
arg1 : string -> float option
Returns: RouteMapping

routeOption rte

Full Usage: routeOption rte

Parameters:
    rte : string

Returns: string option

Returns None for an empty route, which asks for no route, and the route otherwise.

rte : string
Returns: string option

ruleSetRow get arg2

Full Usage: ruleSetRow get arg2

Parameters:
    get : string -> string
    arg1 : string -> float option

Returns: RuleSetData

Map one row of the "RuleSets" sheet, every cell trimmed; an empty Loc or Dep is None.

get : string -> string
arg1 : string -> float option
Returns: RuleSetData

totalsRow get arg2

Full Usage: totalsRow get arg2

Parameters:
    get : string -> string
    arg1 : string -> float option

Returns: TotalsData

Map one row of the "Totals" sheet.

get : string -> string
arg1 : string -> float option
Returns: TotalsData

unitMappingRow get arg2

Full Usage: unitMappingRow get arg2

Parameters:
    get : string -> string
    arg1 : string -> float option

Returns: UnitMapping

Map one row of the "Units" sheet.

get : string -> string
arg1 : string -> float option
Returns: UnitMapping

validFormRow get arg2

Full Usage: validFormRow get arg2

Parameters:
    get : string -> string
    arg1 : string -> float option

Returns: string

Map one row of the "ValidForms" sheet.

get : string -> string
arg1 : string -> float option
Returns: string

Type something to start searching.