FHIRPath v0.2.0.pre3
Pre-release
Pre-release
·
23 commits
to main
since this release
FHIRPath 0.2.0.pre3
Release status
- Release channel: pre-release
- Normative FHIRPath target: 2.0.0
- Capability set: parser, immutable-ast, collection-evaluation, plain-model-navigation, primitive-values, arithmetic, comparison-and-equivalence, boolean-logic, union-membership-and-type-operators, collection-functions, focus-variables, external-constants, custom-functions, compiled-expression-reuse, fhir-r4-model, structured-errors
- Trial-use (STU3-subset) features: stu3-aggregate-functions
- Supported Ruby CI matrix: Ruby 3.2 and Ruby 3.3
- License: MIT
Supported behavior
require "fhirpath", version —test/fhirpath_test.rb- Parse, immutable AST, source spans — foundation/parser tests
- Complete-input validation — parser regression tests
- String, Boolean, integer, decimal literals — foundation/core compatibility tests
- Scientific notation — core compatibility tests
- Empty and comma-separated collections — parser/evaluator tests
- Hash/Array/plain object navigation — foundation tests;
PlainModel - Unary/numeric arithmetic and string
+— parity/core compatibility tests;+propagates empty operands; a zero divisor for/,div,modyields an empty collection, while+,-,*operate on zero normally - Relational comparison — parity/core compatibility tests
- Collection equality/equivalence — core compatibility tests and vectors
- Finite JSON
Floattreated asDecimal— evaluator correctness tests; a finiteFloat(e.g. fromJSON.parse) compares, equals, arithmetically combines, and satisfiesis Decimal;NaN/Infinityare rejected as non-numeric - String
&concatenation — core compatibility tests; empty operands are treated as'' - Empty-aware Boolean operators — foundation/core compatibility tests
- Union,
in,contains,is,as— core compatibility tests and vectors; union eliminates duplicates from both operands using=equality in first-seen order;in/containsrequire a singleton operand and follow the empty-collection rules;is/astest built-in primitive types by runtime value and, when a model provider resolves the value, also test the FHIR logical type recorded by navigation (e.g.Observation.value is Quantity), withaspassing the value through unchanged on a match and yielding the empty collection on a mismatch - Indexers — foundation/parity tests
where,select,first,last,tail,take,skip,exists—test/subsetting_functions_test.rb- Aggregate functions
count(),sum(),avg(),max(),min()—test/aggregate_functions_test.rband aggregate vectors.count()follows FHIRPath 2.0.0 (integer count; empty ->[0]).sum/avg/max/minare FHIRPath 3.0.0 STU3 aggregate additions (published 2026-07-28; absent from 2.0.0 and the 3.0.0 ballot) shipped in the standard registry: empty input -> empty;sum()/avg()accept numeric items only (TypeErrorcodeexpected_numberotherwise), sum mixed Integer/Decimal input through Decimal, andavg()converts Integer items to Decimal before dividing;max()/min()use comparison-operator semantics for numeric and string items (incompatible item types raiseTypeErrorcodeincompatible_comparison); no input mutation. The STU3 subset is surfaced on the capability object:Capability.currentkeepsfhirpath2.0.0and declares markerstu3-aggregate-functionsintrial_use(capability surface tests in the same file) empty,not,all, Boolean aggregates — core compatibility tests$this,$index,$total— parity tests- Explicit external constants — foundation/core compatibility tests; values may come from
variables:or an explicitly injectedHostServicesconstant provider - Missing external constant provider —
test/host_services_test.rb; raisesUnknownConstantErrorwith code:unknown_constantand performs no fallback I/O - Constant-provider failures and redaction —
test/host_services_test.rb; raises genericHostErrorwithout retaining constant-provider exceptions as public causes or exposing their detail in diagnostics - Host callback configuration/reentrancy —
test/host_services_test.rb;HostServicesis immutable and each evaluation receives a fresh context - Custom registered functions — API/foundation tests
- Compiled-expression reuse — API/foundation tests
- Stable structured engine errors — API/foundation/parser tests
ofType()type filter —test/oftype_test.rb; filters collections by built-in (Integer,String,Decimal,Boolean,Date,DateTime,Time) and FHIR resource types recorded during navigation; logical-typeis/aspreviously deferred this slice- Date/Time/DateTime literals (
@...) —test/temporal_literals_test.rb; ISO 8601 with optional timezone (Z/±HH:MM) today(),now(),time()—test/temporal_now_test.rb- Temporal component extractors (
year,month,day,hour,minute,second,millisecond) —test/temporal_components_test.rb;millisecond()onDateTimereadssec_fraction * 1000 - Temporal timezone (
timezone(),timezoneOffset()) —test/temporal_components_test.rb - Temporal same-type comparison —
test/temporal_comparison_test.rb; cross-type raisesincompatible_comparison - FHIR primitive extension accessor (
._<name>) —test/primitive_extensions_test.rb; returns the underlying{value, extension}container or empty per FHIRPath 2.0.0 - FHIR R4 model adapter (
model: :r4) —test/r4_model_test.rb; dependency-freeFHIRPath::FHIR::R4::ModelProvider - FHIR R4
Observation.value[x]logical navigation — R4 choice vectors;valueQuantityandvalueStringresolve throughvalue, absent choice is empty - FHIR R4 logical-type
is/asover resolved choice values —test/r4_type_operator_test.rband R4 choice vectors; navigation records the resolved choice variant's FHIR logical type (Quantity,string, ...) andis/astest against it; empty-in/empty-out and PlainModel (no model metadata) behavior are covered; the type is recorded for collections produced directly by navigation (operators that rebuild collections, such asunion, do not yet propagate it); resource-level type tests andofType()remain deferred - FHIRPath 3.0 STU3 aggregate functions (
sum,avg,max,min) — shipped by default as the first STU3-subset additions to the standard registry — a deliberate, documented exception (declaredstu3-aggregate-functionsinCapability.current.trial_usewithfhirpathstaying2.0.0; seedocs/api.mdanddocs/support-matrix.md); semantics follow the aggregate row above
Explicitly unsupported or deferred behavior
- Temporal arithmetic with Quantity/Duration — no Quantity type yet
- Quantity/UCUM — no unit service or quantity implementation
- Advanced conversion/math/string/regex — not in standard registry
- FHIR R5 model adapter — no R5 provider
- Official HL7 shared test suite — importer is not yet bundled
- Other FHIRPath 3.0 STU3 features — not enabled by default
- Network I/O/global evaluator state — pure evaluation boundary
Host-dependent behavior
- Broader FHIR choice elements and primitive extensions — first R4 slice only covers
Observation.value[x] resolve()and terminology — requires injected host services
Verification evidence
- Compatibility vectors: 39 total (pass: 39, defect: 0, unsupported: 0, host-dependent: 0, not-run: 0).
- Release gates: Ruby matrix, tests, RuboCop, package build, installed-gem smoke test, and coverage validation ran on the tagged source.
- Artifact provenance: see
SHA256SUMS.txtattached to this release.
Limitations
This is a pre-release compatibility slice, not a claim of complete FHIRPath
conformance. Review the release support matrix
and conformance workflow
before using it in production.