Skip to content

Fix CapabilityStatement conformance for resources#5617

Open
v-rachitsh wants to merge 2 commits into
mainfrom
personal/v-rachitsh/capability-statement-fix-external
Open

Fix CapabilityStatement conformance for resources#5617
v-rachitsh wants to merge 2 commits into
mainfrom
personal/v-rachitsh/capability-statement-fix-external

Conversation

@v-rachitsh

Copy link
Copy Markdown
Contributor

Summary

Fixes #5394. External PR #5473

In STU3, CapabilityStatement.rest.resource.interaction has a minimum cardinality of 1 (spec). Resources like Parameters that are explicitly excluded from interaction population (line 303-307) were still appearing in the resource list with an empty interaction array, causing FHIR-conformant parsers (e.g., Firely SDK 6.x with strict validation) to reject the CapabilityStatement.

Changes

  • In CapabilityStatementBuilder.Build(), added a cleanup step that removes resource entries with no interactions before serialization
  • This ensures the output CapabilityStatement conforms to the FHIR standard across all versions

Why this approach

Rather than modifying how Parameters is handled specifically, this cleanup catches any resource that ends up with zero interactions — making it robust against future edge cases. The comment explains the STU3 cardinality requirement for maintainability.

Related issues

AB#191808

Testing

Describe how this change was tested.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@v-rachitsh v-rachitsh added this to the FY26\Q4\2Wk\2Wk26 milestone Jun 17, 2026
@v-rachitsh v-rachitsh requested a review from a team as a code owner June 17, 2026 00:41
@v-rachitsh v-rachitsh added Enhancement-Optimization Optimization on existing functionality. Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs No-PaaS-breaking-change No-ADR ADR not needed labels Jun 17, 2026
@v-rachitsh v-rachitsh changed the title Fix CapabilityStatement conformance for resources without interactions Fix CapabilityStatement conformance for resources Jun 17, 2026
@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.93%. Comparing base (abca618) to head (448d061).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5617      +/-   ##
==========================================
+ Coverage   76.90%   76.93%   +0.02%     
==========================================
  Files         997      997              
  Lines       36616    36622       +6     
  Branches     5529     5533       +4     
==========================================
+ Hits        28160    28175      +15     
+ Misses       7104     7095       -9     
  Partials     1352     1352              

see 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Enhancement-Optimization Optimization on existing functionality. No-ADR ADR not needed No-PaaS-breaking-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CapabilityStatement returned by the /metadata route does not conform to the FHIR standard

2 participants