Logo GenPRES

Utils Module

Holds helper modules for parallel work, results, messages, sheet downloads, TSV cells, numbers, units, values with a unit and ranges used across the formulary library.

Nested modules

Modules Description

BigRational

Parses a text of numbers separated by semicolons into BigRationals and pairs the first values of two arrays as options.

Message

Creates an error message from a source text and an exception.

MinMax

Creates a range from a pair of optional values, tests an optional value against a range, formats a range and reports inverted ranges.

Parallel

Holds a worker count for parallel work, two to the power of the rounded-down natural logarithm of the number of processors. The dose rule loader and the product module split their work into chunks of this size.

Result

Creates an error result from an exception, replaces the source of error messages, and folds an array of results into one result.

Tsv

Cleans a text for a TSV cell by replacing each tab and line break with a space. A null text gives an empty text.

Units

Holds the units of patient values and parses a time unit, a frequency unit and an adjust unit from a text.

ValueUnit

Holds the adult age in days, creates an optional single value with a unit, and formats a ValueUnit as Dutch text.

Web

Downloads a sheet of a Google spreadsheet as rows of cells and writes the time taken to the console. A failed download gives an empty array.

Type something to start searching.