Skip to content

Fix scalar temporal union SQL rewrite#5606

Closed
mikaelweave wants to merge 4 commits into
mainfrom
mikaelweave/fix-temporal-rewrite
Closed

Fix scalar temporal union SQL rewrite#5606
mikaelweave wants to merge 4 commits into
mainfrom
mikaelweave/fix-temporal-rewrite

Conversation

@mikaelweave

@mikaelweave mikaelweave commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

AB#195104

Summary

  • Add SQL Server chained-search E2E coverage for exact Patient.birthdate equality through MedicationDispense and MedicationRequest references.
  • Handle top-level scalar temporal UnionExpression predicates in SQL search-param table splitting/counting.
  • Add a focused SQL unit regression test for top-level temporal union splitting.

Test Plan

  • dotnet test .\src\Microsoft.Health.Fhir.SqlServer.UnitTests\Microsoft.Health.Fhir.SqlServer.UnitTests.csproj --filter "FullyQualifiedName=Microsoft.Health.Fhir.SqlServer.UnitTests.Features.Search.Expressions.SearchParamTableExpressionExtensionsTests.GivenSearchParamTableExpressionWithTopLevelUnion_WhenSplitExpressions_ThenUnionIsReturned" --no-restore --nologo
  • dotnet build .\test\Microsoft.Health.Fhir.R4.Tests.E2E\Microsoft.Health.Fhir.R4.Tests.E2E.csproj --no-restore --nologo /p:NETCoreSdkVersion=9.0.314
  • dotnet build .\test\Microsoft.Health.Fhir.R4B.Tests.E2E\Microsoft.Health.Fhir.R4B.Tests.E2E.csproj --no-restore --nologo /p:NETCoreSdkVersion=9.0.314
  • dotnet build .\test\Microsoft.Health.Fhir.R5.Tests.E2E\Microsoft.Health.Fhir.R5.Tests.E2E.csproj --no-restore --nologo /p:NETCoreSdkVersion=9.0.314
  • dotnet build .\test\Microsoft.Health.Fhir.Stu3.Tests.E2E\Microsoft.Health.Fhir.Stu3.Tests.E2E.csproj --no-restore --nologo /p:NETCoreSdkVersion=9.0.314

Note: local E2E execution hung in this environment, so PR CI is the runtime E2E source of truth.

Related mitigation: PCR #195104.

Handle top-level temporal union expressions when splitting SQL search parameter table expressions, and add chained birthdate regression coverage for SQL Server.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mikaelweave mikaelweave requested a review from a team as a code owner June 10, 2026 19:40
@mikaelweave mikaelweave added this to the FY26\Q4\2Wk\2Wk24 milestone Jun 10, 2026
@mikaelweave mikaelweave added Bug Bug bug bug. 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 10, 2026
mikaelweave and others added 3 commits June 10, 2026 13:39
Keep top-level union predicates as normal search parameter table expressions so existing split logic handles aggregate UNION ALL generation without changing SmartV2 stats traversal.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.94%. Comparing base (777005d) to head (01fbd0e).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5606   +/-   ##
=======================================
  Coverage   76.94%   76.94%           
=======================================
  Files         997      997           
  Lines       36587    36603   +16     
  Branches     5526     5530    +4     
=======================================
+ Hits        28152    28166   +14     
  Misses       7086     7086           
- Partials     1349     1351    +2     

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 Bug Bug bug bug. No-ADR ADR not needed No-PaaS-breaking-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants