Performs general-purpose aggregation by evaluating the aggregator
expression for each element of the input collection. Within this
expression, the standard iteration variables of $this and $index can be
accessed, but also a $total aggregation variable.
The value of the $total variable is set to init, or empty ({ }) if no init
value is supplied, and is set to the result of the aggregator expression
after every iteration.
Using this function, sum can be expressed as:
value.aggregate($this + $total, 0)
Min can be expressed as:
value.aggregate(iif($total.empty(), $this, iif($this < $total, $this, $total)))
and average would be expressed as:
value.aggregate($total + $this, 0) / value.count()
Takes a collection of Boolean values and returns true if all the items are false.
If any items are true, the result is false. If the input is empty ({ }), the result is true.
Takes a collection of Boolean values and returns true if all the items are true.
If any items are false, the result is false. If the input is empty ({ }), the result is true.
Takes a collection of Boolean values and returns true if any of the items are false.
If all the items are true, or if the input is empty ({ }), the result is false.
Takes a collection of Boolean values and returns true if any of the items are true.
If all the items are false, or if the input is empty ({ }), the result is false.
DEPRECATED
The as() function is defined for backwards compatibility with previous implementations
of FHIRPath. However, we have chosen not to support it.
DEPRECATED
Merge the input and other collections into a single collection
without eliminating duplicate values. Combining an empty collection
with a non-empty collection will return the non-empty collection.
There is no expectation of order in the resulting collection.
http://hl7.org/fhirpath/#convertstoboolean-boolean
If the input collection contains a single item, this function will return true if:
the item is a Boolean
the item is an Integer that is equal to one of the possible integer representations of Boolean values
the item is a Decimal that is equal to one of the possible decimal representations of Boolean values
the item is a String that is equal to one of the possible string representations of Boolean values
The DateTime type represents date/time and partial date/time values in the
range @0001-01-01T00:00:00.000 to @9999-12-31T23:59:59.999 with a 1
millisecond step size. This range is defined based on a survey of datetime
implementations and is based on the most useful lowest common denominator.
Implementations can provide support for larger ranges and higher precision,
but must provide at least the range and precision defined here.
The Decimal type represents real values in the range (-10^28+1)/10^8 to
(10^28-1)/10^8 with a step size of 10^-8. Again, this is FHIRPath's official
definition, we use Dart's double, which I believe is the same range as
int but with 15 decimal points. FHIRPath's range is defined based on a
survey of decimal-value implementations and is based on the most useful
lowest common denominator. Implementations can provide support for larger
decimals and higher precision, but must provide at least the range and
precision defined here. In addition, implementations should use
fixed-precision decimal formats to ensure that decimal values are
accurately represented
Identifiers are used as labels to allow expressions to reference elements
such as model types and properties. FHIRPath supports two types of
identifiers, simple and delimited.
A delimited identifier is any sequence of characters enclosed in
backticks ( ` ):
The use of backticks allows identifiers to contains spaces, commas, and
other characters that would not be allowed within simple identifiers. This
allows identifiers to be more descriptive, and also enables expressions to
reference models that have property or type names that are not valid
simple identifiers.
Divides the left operand by the right operand (supported for Integer, Decimal, and Quantity).
The result of a division is always Decimal, even if the inputs are both Integer. For integer division, use the div operator.
If an attempt is made to divide by zero, the result is empty.
There is no literal representation for null in FHIRPath. This means that
when, in an underlying data object (i.e. they physical data on which the
implementation is operating) a member is null or missing, there will
simply be no corresponding node for that member in the tree, e.g.
Patient.name will return an empty collection (not null) if there are no
name elements in the instance.
In expressions, the empty collection is represented as { }.
Returns true if the collection has any elements, and false otherwise.
This is the opposite of empty(), and as such is a shorthand for
empty().not(). If the input collection is empty ({ }), the result is false.
The function can also take an optional criteria to be applied to the
collection prior to the determination of the exists. In this case, the
function is shorthand for where(criteria).exists().
Note that a common term for this function is any.
Identifiers are used as labels to allow expressions to reference elements
such as model types and properties. FHIRPath supports two types of
identifiers, simple and delimited.
A simple identifier is any alphabetical character or an underscore,
followed by any number of alpha-numeric characters or underscores
If the function takes an expression as a parameter, the function will
evaluate the expression passed for the parameter with respect to each of
the items in the input collection. These expressions may refer to the
special $this and $index elements, which represent the item from the input
collection currently under evaluation, and its index in the collection,
respectively. For example, in name.given.where($this > 'ba' and $this
< 'bc') the where() function will iterate over each item in the input
collection (elements named given) and $this will be set to each item when
the expression passed to where() is evaluated.
DEPRECATED
The as() function is defined for backwards compatibility with previous implementations
of FHIRPath. However, we have chosen not to support it.
DEPRECATED
The Quantity type represents quantities with a specified unit, where
the value component is defined as a Decimal, and the unit element is
represented as a String that is required to be either a valid Unified
Code for Units of Measure (UCUM) unit or one of the calendar duration
keywords, singular or plural.
The String type represents string values up to 2^31-1 characters in length.
String literals are surrounded by single-quotes and may use -escapes to
escape quotes and represent Unicode characters.
If the function takes an expression as a parameter, the function will
evaluate the expression passed for the parameter with respect to each of
the items in the input collection. These expressions may refer to the
special $this and $index elements, which represent the item from the input
collection currently under evaluation, and its index in the collection,
respectively. For example, in name.given.where($this > 'ba' and $this
< 'bc') the where() function will iterate over each item in the input
collection (elements named given) and $this will be set to each item when
the expression passed to where() is evaluated.
The Time type represents time-of-day and partial time-of-day values in the
range @T00:00:00.000 to @T23:59:59.999 with a step size of 1 millisecond.
This range is defined based on a survey of time implementations and is
based on the most useful lowest common denominator. Implementations can
provide support for higher precision, but must provide at least the range
and precision defined here. Time values in FHIRPath do not have a timezone
or timezone offset.
http://hl7.org/fhirpath/#toboolean-boolean
If the input collection contains a single item, this function will return a single boolean if:
the item is a Boolean
the item is an Integer and is equal to one of the possible integer representations of Boolean values
the item is a Decimal that is equal to one of the possible decimal representations of Boolean values
the item is a String that is equal to one of the possible string representations of Boolean values
If the item is not one the above types, or the item is a String, Integer, or Decimal, but is not equal to one of the possible values convertible to a Boolean, the result is empty.
Merge the two collections into a single collection,
eliminating any duplicate values (using = (Equals) (=) to
determine equality). There is no expectation of order in
the resulting collection.