fix(hts): IG conformance — multilingual display wording, designation order, hierarchical $expand#154
Merged
Conversation
…order, hierarchical $expand
The nightly "HTS Terminology IG Conformance" job checks out
HL7/fhir-tx-ecosystem-ig unpinned and uses validator_cli.jar latest, so the
upstream commit 741e6e7 ("add additional tests for language and secondary
displays") turned main red with no local changes. It added 7 tests that
exercise PR #149's multilingual code plus one new feature.
Fixes (all 4 matrices: sqlite/postgres × R4/R5):
- validate_code: when a display is valid in the CodeSystem's default language
but the requested displayLanguage has no designation, quote the *supplied*
display and use "…which is a valid display for the default language"
(NO_VALID_DISPLAY_FOUND_NONE_FOR_LANG_OK). Fixes validation-right-de-en,
validation-right-de-ende-N, and validation/simple-{code,coding,
codeableconcept}-good-language-none.
- expand/apply_display_language: front-insert the synthesised
preferredForLanguage designation (rotated primary display) instead of
pushing it last. The validator sorts designations by language (stable), so a
same-language explicit designation otherwise beats it to designation[0].
Fixes language-xform-en-multi-de-hard.
- expand: default to a hierarchical (nested) expansion when neither
excludeNested nor hierarchical is specified and the inline ValueSet wholly
includes is-a CodeSystem(s) with real parent/child edges. Adds the
code_system_is_hierarchical trait method (sqlite + postgres). Gated so it
flips only vs-expand-versionless across the whole IG suite — the ~100 other
excludeNested-omitting expand tests stay flat.
Adds regression tests for nested-by-default vs excludeNested=true.
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.
Why
The nightly HTS Terminology IG Conformance job (run 27456608477) went red with no new commits to
main. That workflow checks outHL7/fhir-tx-ecosystem-igunpinned and downloadsvalidator_cli.jarlatest on every run, so the upstream commit741e6e7"add additional tests for language and secondary displays" (2026-06-12 05:43 UTC, between the green 06-12 and red 06-13 runs) is what turned it red.It added 7 tests — 6 exercise PR #149's new multilingual code, 1 is a brand-new feature. Failures were identical across all 4 matrices (sqlite/postgres × R4/R5).
What
Multilingual display validation (
validate_code.rs) — when a display is valid in the CodeSystem's default language but the requesteddisplayLanguagehas no designation, quote the supplied display and use "…which is a valid display for the default language".Fixes
validation-right-de-en,validation-right-de-ende-N,validation/simple-{code,coding,codeableconcept}-good-language-none.Designation ordering (
expand.rsapply_display_language) — front-insert the synthesisedpreferredForLanguagedesignation (the rotated primary display) instead of pushing it last. The HL7 validator sorts designations by language (stable), so a same-language explicit designation was beating it todesignation[0].Fixes
language-xform-en-multi-de-hard.Hierarchical-by-default
\$expand(new feature) — when a request omits bothexcludeNestedandhierarchicaland the inline ValueSet wholly includes is-a CodeSystem(s) with real parent/child edges, return a nested expansion (tx.fhir.org behaviour). Adds thecode_system_is_hierarchicaltrait method (sqlite + postgres). I audited the whole IG suite: this gate flips exactlyvs-expand-versionless— the ~100 otherexcludeNested-omitting expand tests stay flat.Fixes
vs-expand-versionless.Testing
cargo fmt+ clippy (sqlite & postgres, CI flags) clean.expand_is_a_codesystem_nests_by_defaultandexpand_is_a_codesystem_flat_with_exclude_nested.