Repository navigation
fix(fhirpath): pass new upstream quantity ordering cases - #2251
Merged
Merged
Conversation
FHIR/fhir-test-cases 7da4308 (2026-10-19) added 13 cases for ordering quantities with different units, and the "Test FHIRPath" gate went red with 4 undeclared failures plus 6 cases skipped on evaluation errors. - A calendar year/month compared with any other unit (`1 year < 2 months`, `1 year <= 2 days`, `1 year > 1 'a'`) is empty: calendar years and months have no fixed length. The singular and plural keyword are the same unit, and durations of a week or less still order. - Quantities whose units are not commensurable (`1 'kg' < 2 'm'`) order to empty instead of raising a type error, matching `=`. - FHIR Quantity elements order as System.Quantity, so a unit-text-only quantity compares with a coded one of the same unit. Vendor the new cases and parameters-quantity-unit-text input into the local r4/r5 corpora.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Test FHIRPath" gate went red on every PR (e.g. #2248, run). The cause is FHIR/fhir-test-cases 7da4308 (2026-10-19), which added 13 cases on ordering quantities with different units. 4 of them failed:
testLessThan291 year < 2 monthstestLessOrEqual281 year <= 2 daystestGreaterThan281 year > 1 'a'testGreaterThan291 year > 2 months6 more were SKIPPED because evaluation raised errors (
1 'kg' < 2 'm'and the unit-textParameters.parameter[n].valuecases).Changes
ucum::is_calendar_year_or_month_unorderable: comparing a calendaryear/monthwith any other unit gives empty, because calendar years and months have no fixed length.yearvsyearsstill compares as the same unit. Durations of a week or less still order, so the existing6 days < 1 weekcases still pass.compare_inequality: units that are not commensurable now give empty instead of aTypeError, which matches=.compare_inequality: typed FHIR Quantity elements (Quantity, Age, Duration, ...) are compared as System.Quantity viafhir_quantity_from_object. A quantity with only a unit label now compares with a coded one that has the same unit.parameters-quantity-unit-text.jsoninput.Testing
r4_testsandr5_tests.cargo test -p helios-fhirpath --features R4,R5: all test binaries pass.cargo clippy -p helios-fhirpath --features R4,R5 --all-targetswith the CI flags: clean.