--- type: "fhirpath-operator" title: "FHIRPath Operator: > (greater-than)" operator: ">" category: "Comparison" section: "6.2.1" source: "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. ``` fhirpath 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 - **Category**: Comparison - **Section**: `6.2.1` - **Left Argument**: `String | Integer | Decimal | Quantity | Date | DateTime | Time` - **Right Argument**: `String | Integer | Decimal | Quantity | Date | DateTime | Time` - **Return Type**: `Boolean` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## 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 - `String-String` - `Integer-Integer` - `Integer-Decimal` - `Decimal-Integer` - `Decimal-Decimal` - `Quantity-Quantity` - `Date-Date` - `DateTime-DateTime` - `Time-Time`