Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_sort can cause ChainedSearch to return zero results #2347

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

brendankowitz
Copy link
Member

@brendankowitz brendankowitz commented Nov 10, 2021

Description

Fixes bug where _sort can cause Chained Search not to return correct results.

Previously, the sort options from the chained search's SearchOption object was not cleared, causing the sorting options to be passed through to the chained sub-search, which are not valid.

SELECT r.resourceId, r.resourceTypeName
FROM root r
WHERE r.isSystem = @param0
AND r.resourceTypeName = @param1
AND EXISTS (SELECT VALUE si FROM si IN r.searchIndices WHERE si.p = @Param2 AND si.c = @param3)
AND r.isHistory = @param0
AND r.isDeleted = @param0
ORDER BY r.sort["birthdate"].l ASC

Related issues

Addresses #2344, AB#86544

Testing

Adds E2E regression test

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 50 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, Dependencies, Enhancement, or New-Feature
  • Tag the PR with Azure API for FHIR if this will release to the Azure API for FHIR managed service (CosmosDB or common code related to service)
  • Tag the PR with Azure Healthcare APIs if this will release to the Azure Healthcare APIs managed service (Sql server or common code related to service)
  • Review squash-merge requirements

Semver Change (docs)

Patch

@brendankowitz brendankowitz requested a review from a team as a code owner November 10, 2021 19:35
@brendankowitz brendankowitz changed the title Fixes bug where _sort can cause Chained Search not to return correct results _sort can cause ChainedSearch to return incorrect results Nov 11, 2021
@brendankowitz brendankowitz added this to the S75 milestone Nov 11, 2021
@brendankowitz brendankowitz added Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR 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. labels Nov 11, 2021
Copy link
Contributor

@namadabu namadabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@brendankowitz brendankowitz merged commit a744898 into main Nov 11, 2021
@brendankowitz brendankowitz deleted the personal/bkowitz/chained-search-sort branch November 11, 2021 17:50
@brendankowitz brendankowitz changed the title _sort can cause ChainedSearch to return incorrect results _sort can cause ChainedSearch to return zero results Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants