Product Module
Parses the Formulary sheet and builds, reconstitutes, pre-dilutes and filters the product components from G-Standaard products and Formulary rows.
Nested modules
| Modules | Description |
|
Creates the virtual products of the enteral rows of the Formulary sheet. A row without a parsable unit is left out. |
|
|
Tells whether the FormRoute mapping marks a pharmaceutical form as a solution. A form without a mapping is not a solution. |
|
|
Converts a venous access to and from the sheet codes PVL, CVL and TUBE. Any other code gives AnyAccess. |
|
|
Creates the virtual products of the parenteral rows of the Formulary sheet, with millilitre as the form unit. |
|
|
Parses the Predilution sheet and tests whether a predilution rule applies to a setting, an indication and a patient. |
|
|
Creates the product predilution of a predilution rule, with the substances of the diluent. |
|
|
Creates the product reconstitution of a reconstitution rule, with the substances of the solvent. |
|
|
Parses the Reconstitution sheet and selects the reconstitution rules for a location, a department, a route and a patient. |
Functions and values
| Function or value |
Description
|
Full Usage:
create gen frm rte substs
Parameters:
GenericName
frm : string
rte : string
substs : string array
Returns: ProductComponent
|
|
Full Usage:
createSubstance logger name conc unit formUnit unitMapping
Parameters:
Logger
name : string
conc : RationalX option
unit : string
formUnit : Unit
unitMapping : UnitMapping array
Returns: SubstanceItem option
|
|
Full Usage:
createVirtualProduct logger name form routes formUnit unitMapping substs
Parameters:
Logger
name : GPK
form : string
routes : string[]
formUnit : Unit
unitMapping : UnitMapping array
substs : (string * RationalX option) list
Returns: ProductComponent
|
Creates a virtual product from a parenteral or enteral row of the Formulary sheet, with the nutrient columns as its substances. The form is lowercased like the form of a G-Standaard product. Raises a FormatException for a substance name that is not a name and a unit.
|
Full Usage:
filter mapping route name form brand gpks hpks prods
Parameters:
RouteMapping array
-
The route mapping.
route : string
-
The route.
name : string
-
The generic name; empty matches any name. Ignores case and / + ( ).
form : string
-
The pharmaceutical form; empty matches any form, compared like the name.
brand : string
-
The brand of the trade products to keep; empty keeps every brand.
gpks : GPK array
-
The GPKs to keep; empty keeps every GPK.
hpks : HPK array
-
The HPKs of the trade products to keep when no brand is given; empty keeps every HPK.
prods : ProductComponent[]
-
The products.
Returns: ProductComponent[]
|
Returns the products that match the route, and the name, form and GPKs when given, with their trade products narrowed by brand or HPKs. When a brand or HPKs are given, a product without a matching trade product is left out.
|
Full Usage:
filterGenPresProductsByData routeMapping formularyProducts data genPresProducts
Parameters:
RouteMapping array
formularyProducts : FormularyProduct[]
data : DoseRuleData[]
genPresProducts : GenPresProduct[]
Returns: GenPresProduct[]
|
Keeps only the ZIndex generic products that the dose rule data can select, so fewer product components are built. A generic product is kept when its GPK is in the GPKs of a row, when one of its trade products is in the HPKs of a row, or, for a row with neither, when its product name is the component name of the row and one of its routes is the route of the row. Returns the GenPresProducts with only the kept generic products, and leaves out a GenPresProduct with none. Product.filter then selects the products per rule from this result, so the dose rules are the same as without this filter.
|
Full Usage:
filterOutTradeProducts brand ids prods
Parameters:
string
ids : HPK array
prods : ProductComponent[]
Returns: ProductComponent[]
|
|
|
Returns the distinct pharmaceutical forms of the products.
|
Full Usage:
fromGenPresProducts logger unitMapping routeMapping validForms formRoutes reconstitution parenteral enteral formularyProducts genPresProducts
Parameters:
Logger
unitMapping : UnitMapping array
routeMapping : RouteMapping array
validForms : string array
formRoutes : FormRoute[]
reconstitution : Reconstitution array
parenteral : ProductComponent[]
enteral : ProductComponent array
formularyProducts : FormularyProduct[]
genPresProducts : GenPresProduct[]
Returns: ProductComponent[]
|
Builds the product components from ZIndex GenPresProducts that are already loaded, and adds the parenteral and enteral virtual products. Performs no IO.
|
Full Usage:
generics products
Parameters:
ProductComponent array
Returns: GenericName array
|
Returns the distinct generics of the products.
|
Full Usage:
get logger unitMapping routeMapping validForms formRoutes reconstitution parenteral enteral formularyProducts
Parameters:
Logger
unitMapping : UnitMapping array
routeMapping : RouteMapping array
validForms : string array
formRoutes : FormRoute[]
reconstitution : Reconstitution array
parenteral : ProductComponent[]
enteral : ProductComponent array
formularyProducts : FormularyProduct[]
Returns: ProductComponent[]
|
Reads the ZIndex GenPresProducts and builds the product components with fromGenPresProducts, timing the call.
|
Full Usage:
getAdditionalSubstances fp
Parameters:
FormularyProduct
Returns: (string * BigRational option) list
|
|
Full Usage:
getFormularyProducts dataUrlId
Parameters:
string
Returns: Result<FormularyProduct[], Message list>
|
|
Full Usage:
gstandName fp gp
Parameters:
FormularyProduct option
gp : GenericProduct
Returns: string
|
The G-Standaard name of a generic product: the GStand column of its Formulary row, else the Generic column, lowercased; the ZIndex name when the product has no Formulary row.
|
Full Usage:
map logger unitMapping routeMapping formRoutes reconstitution name synonyms formQuantities fpOpt gp
Parameters:
Logger
unitMapping : UnitMapping array
routeMapping : RouteMapping array
formRoutes : FormRoute[]
reconstitution : ProductReconstitution[]
name : string
synonyms : string array
formQuantities : RationalX[]
fpOpt : FormularyProduct option
gp : GenericProduct
Returns: ProductComponent
|
|
Full Usage:
matchesSetting routeMapping loc dep rte route location department
Parameters:
RouteMapping array
loc : string option
dep : string option
rte : string option
route : string
location : string option
department : string option
Returns: bool
|
Whether a rule for a route, a location and a department applies to a setting. The route must match when the setting gives one, the location as PatientCategory.locationMatches decides, and the department as PatientCategory.departmentMatches decides.
|
Full Usage:
mixSubstances total liquidVol substs addedVol added
Parameters:
ValueUnit
liquidVol : ValueUnit
substs : SubstanceItem[]
addedVol : ValueUnit
added : SubstanceItem[]
Returns: SubstanceItem[]
|
Returns the substances of a volume of a liquid mixed with a volume of an added liquid, in a total volume. Each concentration and molar concentration of the liquid is multiplied by the volume of the liquid, and of the added liquid by the added volume, and divided by the total volume. A substance of the added liquid is added to the substance of the liquid with the same name, or else added as a new substance; a concentration in another unit group, such as mg against mmol, is not added.
|
Full Usage:
narrow brand gpks hpks prods
Parameters:
string
gpks : GPK array
hpks : HPK array
prods : ProductComponent[]
Returns: ProductComponent[]
|
Returns the products with one of the GPKs, and of those the trade products of the brand, or with one of the HPKs when no brand is given. Empty GPKs keep every product; an empty brand and empty HPKs keep every trade product. When a brand or HPKs are given, a product without a matching trade product is left out.
|
Full Usage:
parseFormularyProducts data
Parameters:
string[][]
Returns: Result<FormularyProduct[], Message list>
|
|
Full Usage:
predilute mapping loc dep fits rte indication preds prod
Parameters:
RouteMapping array
loc : string option
dep : string option
fits : Predilution -> bool
rte : string
indication : string
preds : ProductPredilution[]
prod : ProductComponent
Returns: ProductComponent array
|
Returns the product followed by one pre-diluted product per matching predilution of its GPK: the product volume of the product with the diluent volume of diluent, in the prepared volume of the two, as mixSubstances mixes the substances. The product is a liquid: a liquid product, or a product after the reconstitution. The label of a pre-diluted product names the predilution, for example "..., 3 mL verdund met 7 mL gluc 5%".
|
Full Usage:
productName virtualNames fp gp
Parameters:
Set<string>
fp : FormularyProduct option
gp : GenericProduct
Returns: string
|
Returns the name of a generic product: the AltName of its Formulary row as written, else its G-Standaard name. An AltName that is also the name of a virtual product is not used, so the parenteral fluids keep their virtual products until #1444 replaces them.
|
Full Usage:
reconstitute mapping loc dep fits rte prod
Parameters:
RouteMapping array
-
The route mapping.
loc : string option
-
The location.
dep : string option
-
The department.
fits : Reconstitution -> bool
-
Whether a reconstitution applies to the patient.
rte : string
-
The route; an empty route is not checked.
prod : ProductComponent
-
The product.
Returns: ProductComponent array * string seq
The product unchanged when it requires no reconstitution, else one product per matching
reconstitution rule: 1 mL of the product mixed with the solvent volume of solvent in the solvent
volume plus the expansion volume, as mixSubstances mixes the substances. A reconstituted product holds
only the reconstitution it was made with. Also returns a warning when no reconstitution rule matches.
|
Reconstitutes a product for a location, a department and a route.
|
Full Usage:
rename defaultName useGenName subst
Parameters:
string
useGenName : bool
subst : ProductSubstance
Returns: string
|
|
Full Usage:
substancesOf parenteral name
Parameters:
ProductComponent[]
name : string
Returns: SubstanceItem array
|
Returns the substances of the parenteral product whose generic name equals the name, ignoring case, and none when there is no such product.
|
|
Returns the distinct synonyms and generics of the products.
|
Full Usage:
virtualProductNames formularyProducts
Parameters:
FormularyProduct[]
Returns: Set<string>
|
The names of the virtual products: the Generic of every parenteral and enteral row, lowercased.
|
Full Usage:
virtualRoutes routeMapping fp
Parameters:
RouteMapping array
fp : FormularyProduct
Returns: string array
|
Returns the routes of a virtual product as ZIndex names, through the route mapping. Raises a FormatException for a route that the route mapping does not know.
|
GenPRES