Analyze Module
Checks the mapping of dose rules back to sheet rows by a round trip of the rows through the dose rules. Loading merges all rows with the same identity, such as the same source, generic, route, patient, dose type and dose text, into one dose rule, so the mapping back cannot return the separate rows. Instead, runPass checks that every input row that loading keeps is contained in an output row with the same identity. Quantities are compared in base units, so 1000 mg equals 1 g. A first pass on the source data reports a missing row when the source has different content under one identity. A second pass on the output of the first pass, which has one rule per identity, finds every row, and fixpointDelta compares the rows of both passes.
Types
| Type | Description |
|
Compares the output of pass 1 (gen1) with the output of pass 2 (gen2) by rowKey. gen2 can lack rows of gen1, because the second forward map merges rows with the same identity but different dose values. This comes from the forward merge, not from a defect in the reverse map. |
|
|
The result of one round-trip pass: the generated rows and the containment counts. |
Functions and values
| Function or value |
Description
|
|
|
|
|
Full Usage:
containedIn gen orig
Parameters:
DoseRuleData
-
The generated row.
orig : DoseRuleData
-
The original input row.
Returns: bool
True when every quantity of orig is present in gen with the same value.
|
Tells whether a generated row contains an original row. The generated row may have more values. The caller checks the identity first.
|
|
Returns the dose limits of a row as tokens by limit name. Uses DoseRule.getDoseLimits, which builds the combined units such as mg/kg/day and drops values without a unit, as the forward map does.
|
Full Usage:
fixpointDelta gen1 gen2
Parameters:
DoseRuleData[]
-
The rows generated by pass 1.
gen2 : DoseRuleData[]
-
The rows generated by pass 2 from gen1.
Returns: FixpointDelta
The counts per direction and the rows of gen1 that are absent from gen2.
|
Compares the rows of two passes by rowKey, in both directions.
|
|
Returns the frequencies of a row as a set of canonical tokens, one per frequency, built with the units of the forward map. Equal frequencies in different time units give the same token. One token per frequency lets containedIn check for a subset.
|
|
|
|
Returns the identity key of a row. Leaves out the generated ids, the row and group numbers and the quantities.
|
|
|
Full Usage:
reasonLines genById orig
Parameters:
Map<string, DoseRuleData[]>
-
The generated rows by identity key.
orig : DoseRuleData
-
The missing input row.
Returns: string list
One line per value that the best generated row lacks or has different; "no identity match"
when no generated row has the same identity.
|
Explains why an input row is missing, using the generated row with the same identity that matches the most values.
|
|
Returns the key of a row used to remove duplicates: the identity key and all quantities as canonical tokens.
|
|
|
Full Usage:
runPass forward label input
Parameters:
DoseRuleData[] -> DoseRule[]
-
Builds the dose rules from rows; a parameter so this module needs no resource
provider.
label : string
-
The name of the pass in the report.
input : DoseRuleData[]
-
The dose rule data rows to check.
Returns: PassResult
The counts and the generated rows.
|
Runs one round trip over the input and checks that a generated row contains every surviving input row. Prints nothing.
|
|
Returns the administration time, interval and duration limits of a row as tokens by name.
|
Full Usage:
surviving doseRules data
Parameters:
DoseRule[]
data : DoseRuleData[]
Returns: DoseRuleData array
|
Returns the rows that loading keeps: the valid rows, without the rows that have no substance and no dose limits. A row without limits stays when its dose rule is kept without limits, because a solution rule limits it. A row belongs to the dose rule whose DataId has the RuleId of the row; a sheet row has no RuleId, so the RuleId is computed.
|
Full Usage:
trunc n s
Parameters:
int
s : string
Returns: string
|
|
GenPRES