-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Issue with combo index search parameter when using date #6566
base: master
Are you sure you want to change the base?
Conversation
…x. The purpose is to run the 'fix' through the pipelines to see what fails.
Formatting check succeeded! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6566 +/- ##
============================================
- Coverage 83.54% 83.50% -0.04%
- Complexity 27432 28559 +1127
============================================
Files 1707 1797 +90
Lines 106185 111141 +4956
Branches 13397 13961 +564
============================================
+ Hits 88710 92808 +4098
- Misses 11750 12349 +599
- Partials 5725 5984 +259 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix looks good, but there is no test for the specific point of the fix, which is that the combo search is now considered. Please add test for that case.
...sources/ca/uhn/hapi/fhir/changelog/7_8_0/6603-combo-index-sp-not-invoked-with-dateparam.yaml
Outdated
Show resolved
Hide resolved
hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/param/DateRangeParamR4Test.java
Show resolved
Hide resolved
...sources/ca/uhn/hapi/fhir/changelog/7_8_0/6603-combo-index-sp-not-invoked-with-dateparam.yaml
Show resolved
Hide resolved
@ParameterizedTest | ||
@CsvSource(value = { | ||
"2025-01-01, true", | ||
"eq2025-01-01, false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow the test. If those two query strings are considered equivalent, why are we treating them differently? I guess it's because we turn this into a date range, but that logic is kinda confusing. Recommend at least adding comments here to explain what's going on with this test and why we should expect a different result for these two values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP at all. to avoid a regression, this test and its purpose needs be crystal clear on the first read.
the problem:
Given a combo index search parameters configured with a date search parameter components, combo index searching is skipped when a date query parameter value is submitted to the search stack.
root cause:
The root cause of the problem is that we default
DateRangeParam.myPrefix
to 'EQUAL' when parsing a query date parameter into aDateRangeParam
object. More specifically, query parameterbirthdate=2021-01-01
andbirthdate=eq2021-01-01
would yield the sameDateRangeParam
object withdateRangeParam.myPrefix=EQUAL
making it impossible to differentiate whether the prefix was specifically provided or not. As a result, searching the single table populated by combo index search parameters to optimise specific searches is skipped since thedateRangeParam
has a prefix. see SearchBuilder.validateParamValuesAreValidForComboParamwhat was done:
DateRangeParam
to not default the prefix to 'EQUAL' as doing so would make it impossible for indexes created by a combo search index parameters to be queried during searches;