FHIRPath Specification
3.1.0 - STU 3 International flag

FHIRPath Specification, published by Implementable Technology Specifications WG. This guide is not an authorized publication; it is the continuous build for version 3.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/FHIRPath/ and changes regularly. See the Directory of published versions

Page standards status: Informative

FHIRPath Conformance Language References

IdExpectationRule
 SHALL
 MAY
 SHOULD
 SHOULD NOT
§1SHALLdec1:Implementations can provide support for larger decimals and higher precision, but SHALL provide at least the range and precision defined here.
§2SHALL dec1:Implementations can provide support for larger decimals and higher precision, but SHALL provide at least the range and precision defined here.§1
§3SHALLtm1:Implementations can provide support for higher precision, but SHALL provide at least the range and precision defined here.
§4SHALL tm1:Implementations can provide support for higher precision, but SHALL provide at least the range and precision defined here.§3
§5SHALLdt1:Implementations can provide support for larger ranges and higher precision, but SHALL provide at least the range and precision defined here.
§6MAYv1:Other specifications MAY introduce their own variables
§7MAYic2:If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment. However element selectors can return multiples where the object's structure supports it for that element. If not the engine MAY throw an error.
§8SHOULDr1:Implementations SHOULD include safety mechanisms to prevent infinite loops.
§9SHOULD r1:Implementations SHOULD include safety mechanisms to prevent infinite loops.§8
§10SHOULD
MAY
r4:Implementations SHOULD include safety mechanisms to prevent infinite loops. An implementation MAY impose a limit on the number of iterations, or MAY statically analyze the expression to ensure it navigates to child elements within the hierarchical structure.
§11SHOULD
MAY
r4:Implementations SHOULD include safety mechanisms to prevent infinite loops. An implementation MAY impose a limit on the number of iterations, or MAY statically analyze the expression to ensure it navigates to child elements within the hierarchical structure.§10
§12SHALLfmt1:Implementations SHALL support at least 3 digits (milliseconds); support for additional digits is optional.
§13SHALLuc1:When an operation requires one of its arguments to be converted to the "most granular" unit, implementations SHALL select the smaller unit of measurement.
§14SHALL uc1:When an operation requires one of its arguments to be converted to the "most granular" unit, implementations SHALL select the smaller unit of measurement.§13
§15SHALLuc2:If converting to/from years or months you SHALL use the shortest conversion chain possible (i.e. don't convert from days to months to years when you can go from direct days to years).
§16SHALL uc2:If converting to/from years or months you SHALL use the shortest conversion chain possible (i.e. don't convert from days to months to years when you can go from direct days to years).§15
§17SHOULDmch1:Regular expressions SHOULD function consistently, regardless of any culture- and locale-specific settings in the environment, SHOULD be case-sensitive, use 'single line' mode and allow Unicode characters.
§18SHOULD mch1:Regular expressions SHOULD function consistently, regardless of any culture- and locale-specific settings in the environment, SHOULD be case-sensitive, use 'single line' mode and allow Unicode characters.§17
§19SHOULDmch2:Regular expressions SHOULD function consistently, regardless of any culture- and locale-specific settings in the environment, SHOULD be case-sensitive, use 'single line' mode and allow Unicode characters.
§20SHOULD NOTdcd1:It SHOULD NOT replace with the unicode replacement character or allow ill formed UTF-8 content.
§21SHOULDtrc1:This log SHOULD be made available to the user in some appropriate fashion.
§22SHOULD trc1:This log SHOULD be made available to the user in some appropriate fashion.§21
§23SHOULDn1:implementations SHOULD consider providing options appropriate for their environment.
§24SHOULD n1:implementations SHOULD consider providing options appropriate for their environment.§23
§25SHOULDn2:To ensure deterministic evaluation, these operators SHOULD return the same value regardless of how many times they are evaluated within any given expression (i.e. now() SHOULD always return the same DateTime in a given expression, timeOfDay() SHOULD always return the same Time in a given expression, and today() SHOULD always return the same Date in a given expression.)
§26SHALLq6:Implementations are not required to fully support operations on units, but they SHALL at least respect units, recognizing when units differ.
§27SHALLq7:Implementations are not required to fully support operations on units, but they SHALL at least respect units, recognizing when units differ.
§28SHALLcmp1:Implementations are not required to fully support operations on units, but they SHALL at least respect units, recognizing when units differ.
§29MAYb1:implementations MAY use short-circuit evaluation to reduce computation
§30MAY b1:implementations MAY use short-circuit evaluation to reduce computation§29
§31SHALLm1:Implementations are not required to fully support operations on units, but they SHALL at least respect units, recognizing when units differ.
§32SHALLm3:Implementations that to not support processing UCUM units SHALL return empty when unable to correctly handle the units.
§33SHALLad1:Implementations are not required to fully support operations on units, but they SHALL at least respect units, recognizing when units differ.
§34SHOULDdta2:Implementers SHOULD produce a warning when decimal fractions are ignored in date/time arithmetic operations.
§35SHALLsum1:All items in the input collection SHALL be the same type, otherwise an exception is thrown.
§36SHALLmin1:All items in the input collection SHALL be the same type, otherwise an exception is thrown.
§37SHALLmax1:All items in the input collection SHALL be the same type, otherwise an exception is thrown.
§38SHALLavg1:All items in the input collection SHALL be the same type, otherwise an exception is thrown.
§39SHOULDrt1:the default run-time behavior of a compliant FHIRPath implementation SHOULD be weakly typed.
§40SHOULD rt1:the default run-time behavior of a compliant FHIRPath implementation SHOULD be weakly typed.§39
§41SHOULDmdl1:tooling SHOULD respect the case-sensitive settings for each model.
§df1SHOULDWhen computing the difference between datetime values with different timezone offsets, implementations SHOULD normalize the timezone when a precision of hour, minute, second, or millisecond is requested.
§dta1SHALLcalculations involving date/times and calendar durations SHALL use calendar semantics as specified in [ISO8601].
§dta3SHOULDAuthors SHOULD consider applying appropriate rounding functions (round(), floor(), truncate(), or ceiling()) to quantity-valued inputs with decimal values before using them in date/time arithmetic expressions where quantity values might not be whole numbers.
§dur1SHOULDWhen computing the duration between DateTime values with different timezone offsets, implementations SHOULD normalize the timezone when a precision of hour, minute, second, or millisecond is requested.
§ic1MAYIf the «typename» is omitted, an implementation MAY use a type appropriate to the context, or an anonymous type.
§if1SHALLThe criterion expression SHALL evaluate to a Boolean, consistent with singleton evaluation of collections.
§if2SHOULDIn other words, true-result SHOULD only be evaluated if the criterion evaluates to true, and otherwise-result SHOULD only be evaluated otherwise.
§imp1MAYNote that implies MAY use short-circuit evaluation in the case that the first operand evaluates to false.
§m2SHALLImplementations that do support units SHALL do so as specified by the [UCUM] specification.
§q1SHALLImplementations SHALL support equality, equivalence, comparison and arithmetic operations on quantities with units where the units are the same value, case-sensitively.
§q2MAYImplementations that do NOT support UCUM unit conversion MAY return empty ({ }) for calculations involving quantities with different units, except for equivalence, which returns false when a required conversion is not supported.
§q3SHALLImplementations that DO support UCUM conversions SHALL support implicit conversions where operations between quantities with different units are performed, and also explicitly through toQuantity(unit).
§q4SHALLIf the unit argument is provided, it SHALL be the string representation of a UCUM code (or a FHIRPath calendar duration keyword).
§q5SHOULDIf the unit argument is provided, it SHOULD be handled in the same way it is in the toQuantity() function above, except that where an empty result would result, false is returned.