View raw Markdown
type: fhirpath-operatoroperator: <=category: Comparisonsection: 6.2.3source: fhirpath/operations.json

FHIRPath Operator: <= (less-or-equal)

The less or equal operator (<=) returns true if the first operand is less than or equal to the second. The operands must be of the same type, or convertible to the same type using implicit conversion.

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

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

@2018-01-01T16:00:00+11:00 <= @2018-01-01T15:00:00.0+10:00 // true (same moment in diff timezones)
@2018-01-01T16:00:00+12:00 <= @2018-01-01T15:00:00.0+10:00 // true (4pm+12 is less than 5pm+10 when timezones are considered)

@T10:30:00 <= @T10:00:00 // false
@T10 <= @T10:30 // empty ({ }) - different precisions
@T10:30:00 <= @T10:30:00.0 // true

Summary

Description

Returns true if the first operand is less than or equal to 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