@lhncbc/ucum-lhc 5.0.4 → 6.0.0

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 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, suggest, molecularWeight)
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_ suggest a boolean to indicate whether or not suggestions are
178
- requested for a string that cannot be resolved to a valid unit;
179
- true indicates suggestions are wanted; false indicates they are not,
180
- and is the default if the parameter is not specified;
181
- * _@param_ molecularWeight the molecular weight of the substance in question
182
- when a conversion is being requested from mass to moles and vice versa.
183
- It is ignored if neither unit includes a measurement in moles. In such cases
184
- the mole-based unit must have a single mole unit in the numerator and the
185
- mass-based unit must have a single mass unit in the numerator.
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