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

Fix: Date search doesn't match ranges properly #4762

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

PTaladay
Copy link
Collaborator

@PTaladay PTaladay commented Dec 31, 2024

Description

Updates the logic to check if the date time is within the range on a given resource and if so will return that resource.

Related issues

Addresses [issue AB#131564].

Testing

Added additional unit test for validation and ran existing test to verify no new issues introduced.

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)

…and if included in the span that resource will be returned.
@PTaladay PTaladay added Bug Bug bug bug. 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 Open source This change is only relevant to the OSS code or release. labels Dec 31, 2024
@PTaladay PTaladay added this to the 2Wk07 milestone Dec 31, 2024
@PTaladay PTaladay requested a review from a team as a code owner December 31, 2024 19:54
@PTaladay PTaladay marked this pull request as draft December 31, 2024 20:00
@@ -65,7 +69,7 @@ public override Expression VisitMultiary(MultiaryExpression expression, object c
newExpressions.Add(expression.Expressions[^1]);
}

return newExpressions == null ? expression : Expression.And(newExpressions);
return newExpressions == null ? expression : checkDateTimeAgainstPeriod ? Expression.Or(Expression.And(newExpressions), Expression.And(dateInPeriodExpression)) : Expression.And(newExpressions);
Copy link
Member

Choose a reason for hiding this comment

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

nit: For clarity, I think we shouldn't nest ternary operators :)

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. Open source This change is only relevant to the OSS code or release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants