Skip to content

SoF conformance: ViewDefinition search parameters and fixture housekeeping - #723

Merged
smunini merged 6 commits into
mainfrom
feat/sof-conformance
Aug 28, 2026
Merged

SoF conformance: ViewDefinition search parameters and fixture housekeeping#723
smunini merged 6 commits into
mainfrom
feat/sof-conformance

Conversation

@andyguz17

@andyguz17 andyguz17 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

ViewDefinition search parameters (#570)

  • Add data/sql-on-fhir-search-parameters.json: the 17 ViewDefinition SearchParameters (url, name, status, date, version, identifier, title, description, publisher, jurisdiction, resource, profile, and the context* family) copied from the current official SQL-on-FHIR IG build (hl7.fhir.uv.sql-on-fhir 3.0.0-ballot) under their official core-namespace canonicals (http://hl7.org/fhir/SearchParameter/ViewDefinition-{code}). The file is loaded through the existing custom-file mechanism (any data/*.json not matching search-parameters-*.json), so the verbatim HL7 spec artifacts data/search-parameters-r*.json and the loader's production code are untouched.
  • One deliberate, documented deviation from the published build: the two composite parameters (context-type-quantity, context-type-value) reference their components via legacy uv/sql-on-fhir canonicals upstream, which would never resolve in the registry (components would be silently skipped and the composites would index nothing). Our copy uses the core canonicals for those four component.definition values.
  • New tests: loader/registry survival tests per FHIR version (all 17 registered, active, retrievable by code and canonical, benign collision with the embedded fallback), an extractor-level test proving the composite context parameters actually index a matching useContext, and an integration suite (crates/rest/tests/view_definition_search_params.rs, 25 tests) covering GET /ViewDefinition?url|name|status|date|_lastUpdated, the CapabilityStatement entry (full interaction set + advertised searchParams; Library full interaction set), and a $reindex round trip restoring searchability of pre-existing ViewDefinitions.
  • Docs: the REST README notes that pre-existing ViewDefinitions require $reindex after upgrading to become searchable by the new parameters; the HFS README's data-directory tree lists the new file.

Conformance fixture housekeeping (#571)

  • Re-sync the SQL-on-FHIR conformance fixtures from upstream (byte-verbatim). Only tests/repeat.json changed (upstream fixture-data fix: required Questionnaire.status added, an invalid childless group item changed to display). No fixtures added or removed.
  • Rename the fixture directory from crates/sof/tests/sql-on-fhir-v2/ to the version-neutral crates/sof/tests/sql-on-fhir/, as decided in Decide: keep or rename crates/sof/tests/sql-on-fhir-v2 (path stability vs version-neutral name) #718: the fixtures track the current spec (3.0.0-ballot), not v2. Pure git mv (all 22 fixtures byte-identical), all path references updated, and the README's path-stability note removed in the same change. The one historical citation to the old FHIR/sql-on-fhir-v2 GitHub repository (a PR reference in emit.rs) is kept as provenance.
  • Pin the fixture JSON files to LF in .gitattributes so byte-verbatim comparison against upstream stays clean on Windows checkouts.
  • Conformance pass counts are unchanged after the re-sync and rename: 132/144 on SQLite, PostgreSQL, and MongoDB (PASS_FLOOR stays 132; the 12 remaining failures are the documented engine gap).

Testing

  • cargo fmt --all -- --check, cargo clippy -p helios-fhir -p helios-rest -p helios-persistence --all-targets -- -D warnings
  • cargo test -p helios-fhir search (default + --all-features), cargo test -p helios-persistence --lib search::extractor, cargo test -p helios-rest (full suite), cargo test -p helios-sof --tests
  • Conformance suites on SQLite, PostgreSQL, and MongoDB (Docker): 132/144 each, floor met — re-verified after the directory rename
  • Key suites re-run after merging main back into the branch: all green
  • Manual smoke against a live server: create + search by url/name/status/date/_lastUpdated, CapabilityStatement entry verified

Fixes #570
Fixes #571
Closes #718

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.59091% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/fhir/src/search/loader.rs 97.05% 3 Missing ⚠️
crates/persistence/src/search/extractor.rs 95.94% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread crates/fhir/src/search/loader.rs
…l IG custom file

Addresses review feedback on #723
andyguz17 and others added 3 commits August 27, 2026 17:19
…parameters

data/sql-on-fhir-search-parameters.json is now regenerated from the
official IG package (hl7.fhir.uv.sql-on-fhir) by
scripts/sync-sof-search-params.py instead of being maintained by hand.
The script strips generated narratives and rewrites the composites'
legacy component.definition canonicals to the core-namespace canonicals
the parameters declare (upstream inconsistency reported as
HL7/sql-on-fhir#403; the rewrite is a no-op once fixed upstream).

Regenerating also drops a spurious "language": "en" that the
hand-built file carried (present in no official artifact) and picks up
the pinned release's build date.

Claude-Session: https://claude.ai/code/session_01CktNg2DJpWsPFANE1VevR9
@smunini

smunini commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Tracking for the upstream composite-canonical inconsistency that scripts/sync-sof-search-params.py patches around (the composites' component.definition values reference legacy uv/sql-on-fhir canonicals no published SearchParameter declares):

Once fixed upstream, the script's canonical rewrite becomes a no-op and data/sql-on-fhir-search-parameters.json becomes a fully verbatim copy of the IG package.

https://claude.ai/code/session_01CktNg2DJpWsPFANE1VevR9

@smunini
smunini merged commit d7fb7dd into main Aug 28, 2026
12 checks passed
@smunini
smunini deleted the feat/sof-conformance branch August 28, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants