type: fhirpath-functionfunction: toQuantitycategory: Conversionsection: 5.5.7.1source: fhirpath/functions.json
FHIRPath Function: toQuantity
No canonical section match found in index.md.
Summary
- Category: Conversion
- Section:
5.5.7.1 - Return Type:
Quantity - Empty Input Result:
empty - Errors on Multiple Input:
true
Description
If the input collection contains a single item, this function will return a single quantity if the item is an Integer or Decimal, a Quantity, a String convertible to a Quantity, or a Boolean.
Arguments
Type Mapping
Example
q.toQuantity('g') // changes the value and units in the quantity according to UCUM conversion rules