On this page ⌄
Conformance
Which parts of the FHIRPath specification Kotlin FHIRPath 1.0.0-beta06 supports, which are partial, and which are missing.
Goal and scope
This page summarizes what version 1.0.0-beta06 supports. It covers the FHIRPath specification v3.0.0 and the FHIRPath section of FHIR R5. The engine for every FHIR version uses the R5 definitions.
The repository has the full table for every function and operator, with notes and links to the code. Read the conformance table for 1.0.0-beta06. The version on the main branch describes changes that are not released yet.
Supported
- Navigation and filtering. Paths,
where(),select(),repeat(),ofType(), andsort() - Existence and subsetting.
exists(),all(),empty(),count(),first(),last(),tail(),skip(),take(), and indexing - Strings, math, and conversion functions
- Aggregates.
aggregate(),sum(),min(),max(), andavg() - Dates and times. Date arithmetic,
now(),today(),precision(),lowBoundary(),highBoundary(), and component functions such asyearOf() - Types.
is,as, and reflection - Utility functions.
trace()andiif() - FHIR additions.
extension(),hasValue(), and the variables%resource,%context,%ucum,%sct, and%loinc - Quantities with UCUM units
Missing
Functions that need another service are missing by design, because the engine runs only in memory.
resolve(), which needs a store of resourcesmemberOf(),subsumes(), andsubsumedBy(), which need a terminology server
These features are not implemented in 1.0.0-beta06. Calling a missing function throws IllegalStateException with the message Function 'name' is not implemented.
coalesce(),repeatAll(),defineVariable(), andpathname()duration()anddifference()getValue(),conformsTo(),elementDefinition(),slice(),checkModifiers(), andhtmlChecks()- Creating objects in an expression, such as
Quantity('3', 'mg') - The
%rootResourcevariable. Using it throwsUnknown variable: %rootResource.
Partly supported
| Feature | Behavior in 1.0.0-beta06 |
|---|---|
Indexing, such as name[5] | Throws IndexOutOfBoundsException when the index is too large, instead of returning empty |
div and mod | Throw ArithmeticException or return a wrong result for some inputs |
+, -, and * on integers | Overflow wraps around without an error |
combine() | Has no preserveOrder parameter |
toInteger(), convertsToInteger(), toDecimal(), and convertsToDecimal() | Do not accept Long values |
toDecimal() on a string | Can lose precision for numbers with many digits |
toQuantity(unit) on a number | Ignores the unit and uses '1' |
ceiling(), floor(), round(), and truncate() | Do not accept quantities |
<, <=, >, and >= on quantities | Need the units to match after conversion |
as and ofType() | Match the exact type only, not subtypes |
= on resources | Compares the whole resource, not only the id |
Troubleshooting has workarounds for the ones you are most likely to meet.
Intentional differences
- Time zones. The engine never assumes a time zone. See How evaluation works.
- Official test cases. A few official FHIR test cases fail on purpose, where the test or the specification is believed to be wrong. The repository lists each one in Test conformance, with links to the discussions.
When a feature is missing
- Rewrite the expression with supported functions. For example, use
iif(a.exists(), a, b)instead ofcoalesce(a, b). - Do the step in Kotlin. Evaluate the parts of the expression that work, then combine the results in your code.
- For
resolve(), load the referenced resource in your app, then evaluate the next expression on it.
Next step
Troubleshooting lists error messages and their fixes.