@lhncbc/ucum-lhc 5.0.4 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -10
- package/browser-dist/ucum-lhc.js +326 -77
- package/data/ucumDefs.min.json +1 -1
- package/package.json +1 -1
- package/source/config.js +18 -0
- package/source/ucumLhcUtils.js +166 -83
- package/source/ucumXmlDocument.js +15 -1
- package/source/unit.js +140 -3
- package/source/unitString.js +11 -3
- package/source-cjs/config.js +12 -0
- package/source-cjs/config.js.map +1 -1
- package/source-cjs/ucumLhcUtils.js +155 -69
- package/source-cjs/ucumLhcUtils.js.map +1 -1
- package/source-cjs/ucumXmlDocument.js +15 -1
- package/source-cjs/ucumXmlDocument.js.map +1 -1
- package/source-cjs/unit.js +139 -3
- package/source-cjs/unit.js.map +1 -1
- package/source-cjs/unitString.js +12 -4
- package/source-cjs/unitString.js.map +1 -1
package/README.md
CHANGED
|
@@ -161,7 +161,7 @@ of unit strings, and includes a link to the
|
|
|
161
161
|
the full deal.
|
|
162
162
|
|
|
163
163
|
<a id="convertUnitTo"></a>
|
|
164
|
-
#### convertUnitTo(fromUnitCode, fromVal, toUnitCode,
|
|
164
|
+
#### convertUnitTo(fromUnitCode, fromVal, toUnitCode, options)
|
|
165
165
|
|
|
166
166
|
This method converts a number of one type of unit to the equivalent number of
|
|
167
167
|
another type of unit. Note that the number returned is not trimmed or
|
|
@@ -174,15 +174,20 @@ using them in actual clinical settings.
|
|
|
174
174
|
* _@param_ fromVal the number of "from" units to be converted to "to" units;
|
|
175
175
|
* _@param_ toUnitCode the unit code/expression/string of the unit that the from
|
|
176
176
|
field is to be converted to;
|
|
177
|
-
* _@param_
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
177
|
+
* _@param_ options an optional hash of options that can be passed in:
|
|
178
|
+
* 'suggestions' a boolean to indicate whether or not suggestions are wanted
|
|
179
|
+
for a string that cannot be resolved to a valid unit; true indicates
|
|
180
|
+
suggestions are wanted; false indicates they are not, and is the default
|
|
181
|
+
if the parameter is not specified;
|
|
182
|
+
* 'molecularWeight' the molecular weight of the substance in question when a
|
|
183
|
+
conversion is being requested from mass to moles/equivalents and vice versa. It is
|
|
184
|
+
ignored if neither unit includes a measurement in moles. In such cases
|
|
185
|
+
the mole-based unit must have a single mole unit in the numerator and the
|
|
186
|
+
mass-based unit must have a single mass unit in the numerator.
|
|
187
|
+
* 'charge' the absolute value of the charge of the substance in question when a conversion
|
|
188
|
+
is being requested from mass/moles to equivalents and vice versa. It is required
|
|
189
|
+
when one of the units represents a value in equivalents and the other in mass or moles.
|
|
190
|
+
It is ignored if neither unit includes an equivalent unit
|
|
186
191
|
* _@returns_ a hash with six elements:
|
|
187
192
|
* 'status' the will be: 'succeeded' if the conversion was successfully
|
|
188
193
|
calculated; 'failed' if the conversion could not be made, e.g., if
|