View raw Markdown
type: fhirpath-operatoroperator: >category: Comparisonsection: 6.2.1source: fhirpath/operations.json

FHIRPath Operator: > (greater-than)

The greater than operator (>) returns true if the first operand is strictly greater than the second. The operands must be of the same type, or convertible to the same type using an implicit conversion.

10 > 5 // true
10 > 5.0 // true; note the 10 is converted to a decimal to perform the comparison
'abc' > 'ABC' // true
4 'm' > 4 'cm' // true (or { } if the implementation does not support unit conversion)

@2018-03-01 > @2018-01-01 // true - same precision
@2018-03 > @2018-03-01 // empty ({ }) - different precisions
@2018-03-01T10:30:00 > @2018-03-01T10:00:00 // true
@2018-03-01T10 > @2018-03-01T10:30 // empty ({ }) - different precisions
@2018-03-01T10:30:00 > @2018-03-01T10:30:00.0 // false (values are equal to seconds, trailing zeroes after the decimal are ignored)

@T10:30:00 > @T10:00:00 // true
@T10 > @T10:30 // empty ({ }) - different precisions
@T10:30:00 > @T10:30:00.0 // false - values are equal to seconds, trailing zeroes after the decimal are ignored

Summary

Description

Returns true if the first operand is strictly greater than the second. The operands must be of the same type, or convertible to the same type using implicit conversion. Both arguments must be collections with single values. String ordering is strictly lexical based on Unicode values.

Type Mapping