Skip to content

Support FHIRPath 3.0 STU 3 #72

Description

@delcroip

Is there a plan to support the function mentioned there ? https://build.fhir.org/ig/HL7/FHIRPath/en/changes.html

thanks in advance

I asked an LLM to describe what it means:

Description

Background

The official FHIRPath 3.0.0 STU 3 has been released with a significant number of new functions, improved semantics, and clarifications.


Goals

  • Achieve high conformance with FHIRPath 3.0.0 STU 3
  • Pass (or clearly document) the updated official fhir-test-cases
  • Maintain backward compatibility with existing 2.x behavior where possible
  • Update documentation and conformance table

Key Changes to Implement (from official changelog)

New Functions

  • coalesce()
  • sort()
  • repeatAll()
  • defineVariable()
  • matchesFull()
  • indexOf(), lastIndexOf()
  • comparable()
  • pathname()
  • Aggregate: sum(), min(), max(), avg()
  • Date/time extractors: yearOf(), monthOf(), dayOf(), hourOf(), minuteOf(), secondOf(), millisecondOf(), timezoneOffsetOf(), dateOf(), timeOf()
  • Boundary/precision: lowBoundary(), highBoundary(), precision()

Language / Type System

  • Long (integer64) literal with required L suffix
  • Constructor syntax support (System.String(...), etc.)
  • combine(preserveOrder) overload
  • Case-sensitivity options for regex functions (matches, replaceMatches, etc.)
  • Date/time subtraction improvements

Clarifications & Behavior Changes

  • Singleton evaluation rules
  • iif() lazy evaluation
  • Equality & comparison semantics
  • Quantity / UCUM handling
  • Many example corrections

Proposed Implementation Plan

  1. Grammar & Parser – Update FHIRPath.g4 and regenerate ANTLR artifacts (Long literal + constructor syntax).
  2. Core Functions – Implement by priority (see below).
  3. Type System – Add full Long support.
  4. Testing – Integrate latest fhir-test-cases and update conformance table.
  5. Documentation & Release – Update README, changelog, and bump version.

Priority Order

  1. Grammar + Long literal + constructor syntax
  2. coalesce, sort, aggregates (sum/min/max/avg)
  3. Date extractors + lowBoundary/highBoundary/precision
  4. String/index functions + repeatAll/combine
  5. defineVariable, comparable, pathname
  6. All clarifications and test fixes

Acceptance Criteria

  • All new 3.0 functions implemented (or explicitly marked as TODO in conformance table)
  • Conformance table updated with current status
  • No regression in existing Normative tests
  • README clearly states FHIRPath 3.0.0 STU 3 support level
  • New tests added for major features

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions