View raw Markdown
type: fhirpath-operatoroperator: /category: Mathsection: 6.6.2source: fhirpath/operations.json

FHIRPath Operator: / (divide)

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.

For division involving quantities, the resulting quantity will have an appropriate unit:

12 'cm2' / 3 'cm' // 4.0 'cm'
12 / 0 // empty ({ })

Summary

Description

Divides the left operand by the right operand. The result is always Decimal, even if inputs are Integer. Each operand must be a single element. Division by zero results in empty collection. For quantities, the resulting quantity will have an appropriate unit.

Type Mapping