-
Notifications
You must be signed in to change notification settings - Fork 243
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
Return unique include and revInclude resources per search filter match. #2544
base: master
Are you sure you want to change the base?
Conversation
engine/src/main/java/com/google/android/fhir/search/MoreSearch.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Show resolved
Hide resolved
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.
LGTM. NIT comment.
@@ -2369,7 +2369,7 @@ class SearchTest { | |||
.isEqualTo( | |||
""" | |||
SELECT * FROM ( | |||
SELECT rie.index_name, rie.resourceUuid, re.serializedResource | |||
SELECT DISTINCT rie.index_name, rie.resourceUuid, re.serializedResource |
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.
discussed with aditya - i'm worried about what it means to be sorting by a field that is repeated.... for example if you have a patient with two given names aaron and charlie, and another one with two given names barry and david, then what order should this query actually produce, if it's deterministic at all?
do we know that the ordering here is perserved somehow (i.e. we take the first value)?
// A person has multiple first names. Searching a group including Patient sorted by | ||
// Patient.GIVEN should return single copy of of the Patient resource. |
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.
can you explain a little bit more that the dupliatees of record are generated by the join sql statement for the sorting. and probably link to the issue as well.
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.
can you double check on the performance impact of this? doesn't have to produce a comprehensive report - but would be godo at least for the dataset in the github issue this is not having an appreciatable impact.
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2512
Description
meta.lastUpdated
, use that for index value.Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Type
Choose one: Bug fix
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.