Skip to content

fix(fhirpath): pass new upstream fhir-test-cases from 2026-10-23 - #2230

Merged
smunini merged 1 commit into
mainfrom
fix/fhirpath-upstream-2026-10-23
Oct 24, 2026
Merged

smunini merged 1 commit into
mainfrom
fix/fhirpath-upstream-2026-10-23

Conversation

@smunini

@smunini smunini commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Why

On 2026-10-23, FHIR/fhir-test-cases merged oldrobot's PRs #316–#320. Since then the Test FHIRPath job, which runs the upstream corpus at HEAD, fails on every PR with 10 COVERAGE-LOST tests. Example: https://github.com/HeliosSoftware/hfs/actions/runs/40008205266/job/120650867951 (#2226). PRs #2226, #2227 and #2228 are red because of this, and so is anything else that reruns CI.

Fixes (engine, not known-failure entries)

Upstream test Cause Fix
testEscapedIdentifierUnicode none_of("`") in the delimited-identifier parser consumed the \, so escapes inside backticks never ran none_of("\\`") (both parsers)
testUnescapeJson3 unescape('json') ignored \uXXXX decode \uXXXX (surrogate pairs joined) and \/
testIndexer3 negative index raised InvalidIndex out of range, so empty
testSkip7/8, testTake8/9 skip({}) / take({}) raised an error empty count, so empty
testPlusDate23/24, testMinus9 datetime + duration only parsed second precision when a timezone was present, and always formatted to seconds parse hour/minute/second/fraction precision and keep the input precision in the result

The new cases are vendored into the local tests-fhir-r4.xml / tests-fhir-r5.xml, with inputs pointing at patient-example.json. That surfaced testLessThan28, which fails only in the in-process Rust suite: extension(url) on a FHIR primitive worked only through a hard-coded, fabricated patient-birthTime extension (with the value as a plain string). It now reads the primitive's own extensions, and the fabrication is gone. testExtension1-3 still pass.

parser_tests::test_multiple_expressions_from_file now requires invalid="syntax" expressions to be rejected, instead of expecting them to parse. This covers the new testLiteralUnicodeInvalid ('\u+041').

Verification

  • cargo test -p helios-fhirpath --features R4 and --features R5: all pass (r4 suite 749/749, r5 1144/1144, 0 undeclared).
  • cargo clippy -p helios-fhirpath --features R4,R5 --all-targets with the CI flag set: clean.
  • fhirpath-cli: all 10 upstream expressions give the expected results. Existing results such as @1973-12-25T00:00:00.000+10:00 + 7 days are unchanged.
  • The .NET harness was not run locally. This PR's own Test FHIRPath job is the check.

FHIR/fhir-test-cases merged oldrobot's PRs #316-#320 on 2026-10-23 and
the "Test FHIRPath" gate (which runs the upstream corpus) went red on
every PR with 10 undeclared failures. Fix the engine rather than declare
them:

- Delimited identifiers: `none_of("`")` consumed the backslash before
  the escape parser ran, so Patient.`name` never resolved.
- unescape('json'): decode \uXXXX (pairing UTF-16 surrogates) and \/.
- Indexer: a negative index is out of range, so the result is empty
  instead of an error.
- skip({}) / take({}): an empty count returns empty.
- DateTime + / - calendar duration: accept hour- and minute-precision
  values with a timezone (@2015-02-04T10Z, @2015-02-04T10:00Z) and keep
  the input precision in the result, so `= @2015-02-04T11:00Z` compares.

Vendor the new cases into the local r4/r5 corpora. testLessThan28 then
exposed that extension(url) on a FHIR primitive only worked through a
hard-coded fabricated birthTime extension; read the primitive's own
extensions instead and drop the fabrication. The parse-all test now
requires invalid="syntax" expressions to be rejected.
@claude

claude Bot commented Oct 24, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@smunini
smunini merged commit 8279cc6 into main Oct 24, 2026
17 of 19 checks passed
@smunini
smunini deleted the fix/fhirpath-upstream-2026-10-23 branch October 24, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant