View raw Markdown
type: fhirpath-operatoroperator: -category: Unary Operatorssection: 6.8.2source: fhirpath/operations.json

FHIRPath Operator: - (minus)

Subtracts the right operand from the left operand (supported for Integer, Decimal, and Quantity).

When subtracting quantities, the dimensions of each quantity must be the same, but not necessarily the unit.

3 'm' - 3 'cm' // 297 'cm'

Summary

Description

Unary negation operator. Negates the numeric value. If the value is a Quantity, the unit remains unchanged. If the result of negating cannot be represented, the result is empty. Supported for Integer, Long, Decimal, and Quantity. Using with any incompatible type will signal an error.

Type Mapping