You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/fhirpath/functions/math.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,3 +25,17 @@ Math functions operate on numeric values. Single-value functions (`abs()`,
25
25
|`min()`| Smallest item in the collection. |`(3 \| 1 \| 2).min()` → `1`|
26
26
|`max()`| Largest item in the collection. |`(3 \| 1 \| 2).max()` → `3`|
27
27
|`avg()`| Arithmetic mean of the collection. |`(2 \| 4 \| 6).avg()` → `4`|
28
+
29
+
## Precision & boundaries
30
+
31
+
These three functions report or derive the precision of a value. They accept a
32
+
decimal, integer, date, dateTime, or time, using FHIRPath positional precision
33
+
numbers (e.g. `YYYY`=4, `YYYY-MM`=6, `YYYY-MM-DD`=8 for dates; digits after the
34
+
decimal point for numbers). `lowBoundary()` and `highBoundary()` take an optional
35
+
output-precision argument.
36
+
37
+
| Function | Description | Example |
38
+
|----------|-------------|---------|
39
+
|`precision()`| Number of significant positions in the input. Trailing zeros on a decimal are preserved. |`(1.58700).precision()` → `5`|
40
+
|`lowBoundary([precision])`| Lowest value in the natural range the input represents. For numbers, `value - 0.5×10^-precision`; for dates/times, fills unspecified components with their minimum. |`(1.587).lowBoundary()` → `1.5865...`|
41
+
|`highBoundary([precision])`| Highest value in the natural range the input represents. For numbers, `value + 0.5×10^-precision`; for dates/times, fills unspecified components with their maximum. |`(1.587).highBoundary()` → `1.5875...`|
0 commit comments