Skip to content

Conversation

@mikaelweave
Copy link
Contributor

@mikaelweave mikaelweave commented Jan 20, 2026

When using _include and _revinclude together in FHIR search queries, the SQL generator was producing UNION statements with mismatched column counts. Include queries projected 3 columns (T1, Sid1, IsMatch) while other branches projected 4 columns (T1, Sid1, IsMatch, IsPartial).

The fix ensures IsPartial is always projected in HandleTableKindInclude() regardless of IsIncludesOperation flag.

Added E2E regression test to verify the fix.

Related issues

AB#181200

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)

When using _include and _revinclude together in FHIR search queries,
the SQL generator was producing UNION statements with mismatched column
counts. Include queries projected 3 columns (T1, Sid1, IsMatch) while
other branches projected 4 columns (T1, Sid1, IsMatch, IsPartial).

The fix ensures IsPartial is always projected in HandleTableKindInclude()
regardless of IsIncludesOperation flag.

Added E2E regression test to verify the fix.
@mikaelweave mikaelweave requested a review from a team as a code owner January 20, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants