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

Combine pairs of DateTime predicates on the same search parameter #3903

Merged
merged 5 commits into from
Jun 18, 2024

Conversation

feordin
Copy link
Contributor

@feordin feordin commented Jun 6, 2024

Description

When we have a FHIR query like the following:
?issued=ge2024-04-22T00:00:00&issued=lt2024-04-23T00:00:00
We currently generate two CTE's in SQL and then join them. This is inefficient and can be improved if we combine the two conditions into one CTE.

Related issues

Addresses [issue AB#121039].

Testing

Manually tested against the example query. All other automated tests run for regression testing.

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.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@feordin feordin added Enhancement Enhancement on existing functionality. Area-SQL Area related to the SQL Server data provider Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs labels Jun 6, 2024
@feordin feordin added this to the S142 milestone Jun 6, 2024
@feordin feordin requested a review from a team as a code owner June 6, 2024 18:23
@feordin feordin requested a review from rajithaalurims June 10, 2024 20:56
@feordin
Copy link
Contributor Author

feordin commented Jun 11, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@feordin
Copy link
Contributor Author

feordin commented Jun 12, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@feordin
Copy link
Contributor Author

feordin commented Jun 13, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@feordin
Copy link
Contributor Author

feordin commented Jun 17, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@rajithaalurims rajithaalurims left a comment

Choose a reason for hiding this comment

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

Tested different scenarios of date search with this PR and got results as expected, so approving.

@feordin feordin merged commit 84afe6e into main Jun 18, 2024
47 checks passed
@feordin feordin deleted the personal/jaerwin/sql-date-combine branch June 18, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-SQL Area related to the SQL Server data provider Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Enhancement Enhancement on existing functionality. Schema Version unchanged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants