feat(rest): advertise real search modifiers and includes in CapabilityStatement#157
Open
smunini wants to merge 1 commit into
Open
feat(rest): advertise real search modifiers and includes in CapabilityStatement#157smunini wants to merge 1 commit into
smunini wants to merge 1 commit into
Conversation
…yStatement `GET /metadata` previously hardcoded `searchInclude`/`searchRevInclude` to `["*"]` and never advertised search modifiers. This closes both gaps (the real per-resource search params were already emitted from the registry). Persistence: - Add `SearchProvider::modifiers_for_param_type` (defaulted to empty). The sqlite/postgres/elasticsearch/mongodb backends override it to expose their existing per-type modifier set (`modifiers_for_type`); `CompositeStorage` delegates with the same search-backend/primary routing as `supports_contained_search`. REST handler: - `searchInclude` is now derived from each type's real reference params (`Type:code`) instead of `["*"]`; omitted when a type has none. - `searchRevInclude` is derived from a reverse index of every reference param that targets the type (`Source:code`), instead of `["*"]`. - Each resource-specific `searchParam` carries the modifiers the backend honors as repeating `valueCode` extensions under `capabilitystatement-search-modifier` (R4/R5 `searchParam` has no native `modifier` element). Control params (`_id`, `_tag`, ...) are left as-is to avoid overclaiming. Tests: unit tests for include/revinclude derivation and the modifier extension; an integration test asserting real params, includes, and modifier extensions via `GET /metadata`.
Codecov Report❌ Patch coverage is 📢 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.
What
GET /metadatanow advertises the server's real search capabilities. The headline gap from the UI requirements doc (§7.9) — only seven static search params — was already fixed onmain; this closes the two remaining gaps:searchInclude/searchRevIncludewere hardcoded["*"]. They are now derived from real reference search params:searchInclude=Type:codefor each reference param defined on the type.searchRevInclude=Source:codefor every reference param (on any type) that targets this type.*).searchParamnow carries the modifiers the backend actually honors (:exact,:contains,:not,:identifier, …) as repeatingvalueCodeextensions underhttp://heliossoftware.com/fhir/StructureDefinition/capabilitystatement-search-modifier. R4/R5CapabilityStatement.rest.resource.searchParamhas no nativemodifierelement, so an extension is the spec-compatible carrier.How
SearchProvider::modifiers_for_param_type; sqlite/postgres/elasticsearch/mongodb override it to surface their existingmodifiers_for_typeset, so the advertisement is per-backend honest.CompositeStorage(the storage thehfsbinary runs) delegates with the same routing assupports_contained_search.build_resource_capability/build_search_params._id,_tag, …), to avoid overclaiming.Scope notes
_text/_contenttyping.comparatoris not advertised (no standard CapabilityStatement field).Tests
crates/rest/tests/capabilities_search_params.rs, SQLite + full spec registry):GET /metadataadvertisesPatient.name/Observation.code, non-wildcardPatientincludes, anObservation:*revinclude, and the modifier extension on a reference param.Verified:
cargo fmt --all; CI-stylecargo clippy -p helios-persistence -p helios-rest --all-targets --features elasticsearch,postgres -- -D warnings ...clean;helios-restcapabilities/sof_capabilities + new integration test, andhelios-persistencelib (665) all green.