| description | Validate Quantity and date/time values against minValue/maxValue constraints. |
|---|---|
| icon | arrows-left-right-to-line |
Validates minValue[x] / maxValue[x] constraints declared on a Structure Definition:
FHIRQuantityRangeValidator— Quantity ranges, driven by the#[FHIRQuantityRange]attributeFHIRTemporalRangeValidator—date/dateTime/instant/timeranges, driven by the#[FHIRTemporalRange]attribute
Both validators skip null values, so a range constraint never fires on an absent element.
FHIRQuantityRangeValidator compares a FHIR Quantity value against the constraint's min and
max bounds. A value below min or above max raises an ERROR:
The value {{ value }} is below the minimum {{ min }} {{ unit }}.
The value {{ value }} exceeds the maximum {{ max }} {{ unit }}.
Because units cannot be safely converted here, the comparison only proceeds when the instance and
the bound share the same system + code. Anything that prevents a safe comparison is
surfaced as a WARNING rather than a hard failure:
| Situation | Severity | Reason |
|---|---|---|
Value below min / above max (units match) |
ERROR | Genuine range violation |
| Instance unit differs from bound unit | WARNING | Cross-unit comparison not attempted |
Instance missing system or code |
WARNING | Cannot identify the unit |
Configured bound missing system or code |
WARNING | Malformed bound |
Instance value carries a comparator |
WARNING | Approximate value, not a precise measurement |
FHIRTemporalRangeValidator validates date, dateTime, instant, and time values against
min / max bounds. Model properties hold primitive wrapper objects (e.g. DatePrimitive) which
are \Stringable; the validator accepts both raw strings and \Stringable and compares their
string form. Empty strings are skipped.
timevalues are compared as plain strings.- Date-like values (
date/dateTime/instant) are parsed. Partial dates (YYYYorYYYY-MM) are expanded to the start of their period for themincheck and the end for themaxcheck, so2024satisfies aminof2024-06-01only if the whole year could fall on or after the bound.
An out-of-range value raises an ERROR:
The value {{ value }} is before the minimum {{ min }}.
The value {{ value }} is after the maximum {{ max }}.
An unparseable configured bound is surfaced as a WARNING (The configured {{ side }} bound {{ bound }} is not a valid FHIR {{ type }} string.), and an unparseable instance value raises
a separate diagnostic (The value {{ value }} is not a valid FHIR {{ type }} string.) rather than
silently passing.
See Validation Reports & Violation Codes for how these severities surface in the report.