Skip to content

Filter unversioned canonical refs from $package expansion parameters#1033

Merged
c-schuler merged 4 commits into
mainfrom
filter-unversioned-expansion-params
May 13, 2026
Merged

Filter unversioned canonical refs from $package expansion parameters#1033
c-schuler merged 4 commits into
mainfrom
filter-unversioned-expansion-params

Conversation

@c-schuler
Copy link
Copy Markdown
Contributor

Summary

Manifests can carry expansion parameters whose values are unversioned canonical URLs (e.g. system-version=http://snomed.info/sct or canonicalVersion=http://example.org/ValueSet/foo with no |version pin). Most terminology servers reject expansions when system-version / canonicalVersion entries lack a pin. The expansion would be non-deterministic so the resulting $package call fails for the entire manifest instead of just the offending entries.

Add a guard in PackageVisitor.handleValueSets: after copying the manifest's cqf-expansionParameters into the working params adapter, drop any entry whose value is a canonical URL without a version pin. Each dropped entry produces a logger.warn with the param name and value so authors can see which entries need pinning. Non-canonical-valued params (booleans, codes like displayLanguage, language tags, etc.) pass through unchanged.

The persisted manifest in the repository is untouched - the filter applies only to the in-memory copy used for Tx expansion and the manifest copy included in the response bundle. This keeps $package idempotent on stored state.

Test plan

  • Unit test: mixed-input case - unversioned http:// canonical dropped, unversioned urn:oid: canonical dropped, versioned http canonical kept, versioned urn canonical kept, language code + boolean kept
  • Unit test: defensive null / empty-params inputs don't throw
  • Full cqf-fhir-cr PackageVisitor test suite - no regressions
  • End-to-end verification against a real manifest in jpaserver-starter - $package completes; warnings appear for unversioned entries; Tx server no longer errors

@c-schuler c-schuler requested a review from brynrhodes May 13, 2026 15:18
@c-schuler c-schuler self-assigned this May 13, 2026
@c-schuler c-schuler added the enhancement New feature or request label May 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2026

Formatting check succeeded!

@sonarqubecloud
Copy link
Copy Markdown

@c-schuler c-schuler merged commit 389c88d into main May 13, 2026
8 of 9 checks passed
@c-schuler c-schuler deleted the filter-unversioned-expansion-params branch May 13, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants