This fixes a bug where if descending sort is used and no resources match the sort field then the second phase of the sort, which gets fields that don't have the sort field, won't run.
Related issues
Addresses Bug 126375: Descending sort will return no results if no data has the search field
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.
Description
This fixes a bug where if descending sort is used and no resources match the sort field then the second phase of the sort, which gets fields that don't have the sort field, won't run.
Related issues
Addresses Bug 126375: Descending sort will return no results if no data has the search field
Testing
Describe how this change was tested.
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)