Skip to content

FHIRPath Test Compliance

This page shows the current compliance status with the official FHIRPath test suite, indicating which features are currently supported by the OctoFHIR FHIRPath implementation.

Based on the latest test run of the official FHIRPath test suite:

StatusCountPercentage
Passed51272.0%
Failed19928.0%
⏭️ Skipped00.0%
Total711100%

The following FHIRPath features are currently working and pass the official tests:

  • Basic Path Navigation: Simple property access and navigation
  • Collection Operations: Basic collection handling and iteration
  • String Operations: String manipulation and comparison functions
  • Numeric Operations: Basic arithmetic and numeric comparisons
  • Boolean Logic: Basic boolean operations and comparisons
  • Type Checking: Basic type validation and conversion
  • Telecom Access: Patient telecom data access and filtering

The following features are not yet implemented or have known issues:

  • Advanced Functions: Many built-in functions like conformsTo() are not implemented
  • Complex Operators: Some advanced operators and syntax patterns
  • Date/Time Operations: Advanced date and time manipulation
  • Regular Expressions: Pattern matching and regex operations
  • Advanced Type Conversions: Complex type casting and conversion
  • Aggregate Functions: Advanced collection aggregation operations

Some tests are currently skipped due to:

  • Missing input data files
  • XML to JSON conversion requirements
  • Test environment setup issues

The official FHIRPath test suite is organized into several test groups. Here’s the status of major test groups:

  • testBasics: Partially supported - basic path navigation works
  • testMiscellaneousAccessorTests: Mixed results - some accessor patterns work
  • testConformsTo: Not supported - conformsTo() function not implemented
  • String Operations: Partially supported
  • Numeric Operations: Partially supported
  • Boolean Operations: Partially supported
  • Date/Time Operations: Limited support
  • Function Library: Many functions not yet implemented
  • Complex Expressions: Limited support for complex syntax
  • Error Handling: Basic error handling implemented

The following sections provide specific details about which tests are failing and why, organized by error type and test group.

These tests fail due to unsupported syntax or characters in the lexer:

  • testLiteralDateYear: @2014 - Unexpected character ’@’ at line 1, column 1
  • testLiteralDateMonth: @2014-01 - Unexpected character ’@’ at line 1, column 1
  • testLiteralDateDay: @2014-01-20 - Unexpected character ’@’ at line 1, column 1
  • testLiteralDateTimeYear: @2014T - Unexpected character ’@’ at line 1, column 1
  • testDateEqual: Date comparison expressions - Unexpected character ’@’ at line 1, column 21
  • testDollarThis1: Bundle.entry.select(resource as Patient).name.given.where($this.length() > 3) - Unexpected character ’$’ at line 1, column 36
  • testDollarThis2: Similar expression with ‘$this’ variable - Unexpected character ’$’ at line 1, column 36
  • testEscapedIdentifier: Expression with backtick identifiers - Unexpected character ’`’ at line 1, column 6
  • testSimpleBackTick1: Expression starting with backtick - Unexpected character ’`’ at line 1, column 1
  • testCollectionNotEqualEmpty: {} != {} - Unexpected character ’{’ at line 1, column 23
  • testExpressions: Expression with pipe operator - Unexpected character ’|’ at line 1, column 27
  • testLiteralInteger1: 1. - Expected digit after decimal point at line 1, column 3
  • testLiteralInteger0: 0. - Expected digit after decimal point at line 1, column 3
  • testLiteralIntegerMax: Large integer - Expected digit after decimal point at line 1, column 12

These tests fail because required FHIRPath functions are not yet implemented:

  • convertsToInteger(): 15+ tests fail (testStringLiteralConvertsToInteger, testBooleanLiteralConvertsToInteger, etc.)
  • convertsToBoolean(): 10+ tests fail (testLiteralBooleanTrue, testStringTrueLiteralConvertsToBoolean, etc.)
  • convertsToDecimal(): 10+ tests fail (testLiteralDecimal10, testDecimalLiteralConvertsToDecimal, etc.)
  • convertsToDate(): 3 tests fail (testStringYearConvertsToDate, testStringMonthConvertsToDate, etc.)
  • convertsToDateTime(): 7 tests fail (testStringYearConvertsToDateTime, testStringHourConvertsToDateTime, etc.)
  • convertsToTime(): 4 tests fail (testStringHourConvertsToTime, testStringMinuteConvertsToTime, etc.)
  • convertsToQuantity(): 10+ tests fail (testDecimalLiteralConvertsToQuantity, testStringQuantityLiteralConvertsToQuantity, etc.)
  • toInteger(): 5+ tests fail (testStringIntegerLiteralToInteger, testDecimalLiteralToInteger, etc.)
  • toDecimal(): 4 tests fail (testDecimalLiteralToDecimal, testBooleanLiteralToDecimal, etc.)
  • toQuantity(): 7 tests fail (testDecimalLiteralToQuantity, testStringQuantityLiteralToQuantity, etc.)
  • not(): 6 tests fail (testCollectionNotEmpty, testLiteralNotTrue, testLiteralNotFalse, etc.)
  • today(): 1 test fails (testDateNotEqualToday)
  • now(): 1 test fails (testDateTimeGreaterThanDate)
  • is(): 10+ tests fail (testStringLiteralIsNotInteger, testBooleanLiteralIsNotInteger, etc.)

These tests fail due to issues in expression parsing:

  • testLiteralIntegerLessThanPolarityTrue: +1 < 2 - Expected expression, got Token { token_type: Plus, lexeme: ”+”, position: 0, line: 1, column: 1 }

These tests fail due to type compatibility issues:

  • testPolarityPrecedence: Negation requires numeric operand
  • testLiteralIntegerGreaterThan: Comparison requires compatible operands
  • Passed: testSimple, testSimpleWithContext, testDollarOrderAllowed, testDollarOrderNotAllowed
  • Failed: testSimpleNone, testEscapedIdentifier, testSimpleBackTick1, testSimpleFail, testSimpleWithWrongContext
  • Passed: testLiteralTrue, testLiteralFalse, testLiteralString, testLiteralUnicode, testExpressionsEqual
  • Failed: Most date/time literals, type conversion tests, numeric parsing issues
  • Failed: Almost all tests due to missing type conversion and checking functions

testMiscellaneousAccessorTests (Mixed Results)

Section titled “testMiscellaneousAccessorTests (Mixed Results)”
  • Passed: testPatientTelecomTypes
  • Failed: testExtractBirthDate, testPatientHasBirthDate
  • ⏭️ Skipped: All tests due to XML to JSON conversion not implemented
  • ✅ Passed: The feature works correctly and matches expected FHIRPath behavior
  • ❌ Failed: The feature is not implemented or has bugs that cause incorrect results
  • ⏭️ Skipped: The test couldn’t run due to missing dependencies or setup issues

This implementation is actively being developed. The test compliance will improve over time as more features are implemented. Key areas of focus include:

  1. Function Library Expansion: Implementing missing built-in functions
  2. Operator Support: Adding support for advanced operators
  3. Error Handling: Improving error messages and edge case handling
  4. Performance: Optimizing evaluation performance for complex expressions

To run the official FHIRPath tests locally:

Terminal window
cd fhirpath-core
cargo test run_official_fhirpath_tests -- --nocapture

This will show detailed results for each test, including which expressions are being evaluated and their results.


Last updated: July 19, 2025 Test suite version: Official FHIRPath R4 tests