-
Notifications
You must be signed in to change notification settings - Fork 249
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
Support Contains for string search #426
Conversation
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.
Thanks @epicadk for this change! Just a comment on the syntax for the search API.
engine/src/main/java/com/google/android/fhir/search/SearchDsl.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
Thanks @epicadk - I would really love to focus on the contains issue and handle the change of indexing in a separate PR. Is it ok? |
Yep sorry. Reverting the change. |
@jingtang10 done. |
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.
thanks!
engine/src/main/java/com/google/android/fhir/search/params/StringSearchModifier.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/params/StringSearchModifier.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/params/StringSearchModifier.kt
Outdated
Show resolved
Hide resolved
engine/src/test/java/com/google/android/fhir/search/SearchTest.kt
Outdated
Show resolved
Hide resolved
engine/src/test/java/com/google/android/fhir/search/SearchTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
Improve tests Improve Formatting
@jingtang10 done |
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.
Great! Thanks so much for this. Please feel free to merge after addressing the final few (nit) comments.
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Show resolved
Hide resolved
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
} | ||
assertThat(res).hasSize(1) | ||
assertThat(res[0].id).isEqualTo("Patient/${patient1.id}") | ||
assertThat(res[0].nameFirstRep.given.any { it.toString() == "Eve" }).isTrue() |
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 think just checking the patient id is right is enough?
engine/src/androidTest/java/com/google/android/fhir/db/impl/DatabaseImplTest.kt
Outdated
Show resolved
Hide resolved
chore: fix formatting
Thanks again @epicadk for this PR and merging! |
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #376
Description
Support contains for string search.
Alternative(s) considered
Explained in the comment on linked issue. I've removed the ParamPrefixEnum as a parameter of string filter because those params are only meant for Number Quantity and date parameters
refer https://www.hl7.org/fhir/search.html#prefix or the ParamPrefixEnum Javadoc
I also cannot find a
StringParamModifier
Enum like theTokenParamModifier
andUriParamQualifierEnum
Enums that's why I used the string param class. I think we could possibly create our own implementation of theStringParamModifier
class.The tests I have added to the FHIREngineImpl are from https://www.hl7.org/fhir/search.html#string
Type
Choose one: Feature
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