-
Notifications
You must be signed in to change notification settings - Fork 294
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
Add DateTimeType
to search
#419
Conversation
Well done in figuring out how the index tables work. |
Thankyou 😄. I'm not sure how I should handle the case when the Prefix is null should we throw an error or have a default value? |
core/src/main/java/com/google/android/fhir/search/MoreSearch.kt
Outdated
Show resolved
Hide resolved
core/src/test/java/com/google/android/fhir/search/SearchTest.kt
Outdated
Show resolved
Hide resolved
@jingtang10 I've added a test for the SQL query. But I think we should resolve #433 before we merge this. Converting to draft will add tests for all the cases. I just wanted to know whether I should continue adding the tests in |
Hi, can I have some help here? |
Marked as ready to review. But I haven't really added tests. I'm having trouble in figuring out where I should test if the query works as intended . Should I add the tests in the |
Added an empty commit because build test was failing here but seemed to be working fine locally. If it fails again I'll look into it. |
@aditya-07 , could you please review the changes? |
engine/src/main/java/com/google/android/fhir/search/MoreSearch.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/MoreSearch.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/MoreSearch.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/MoreSearch.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/MoreSearch.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Jing Tang <[email protected]>
Co-authored-by: Jing Tang <[email protected]>
Co-authored-by: Jing Tang <[email protected]>
engine/src/main/java/com/google/android/fhir/search/MoreSearch.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/MoreSearch.kt
Outdated
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.
Awesome! 😎
Thanks for the PR!
engine/src/test/java/com/google/android/fhir/search/SearchTest.kt
Outdated
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.
Thanks @epicadk this is cool!
I've left a few non-blocking comments. LGTM, approved 🚀
.apply { | ||
filter(Patient.DEATH_DATE) { | ||
prefix = ParamPrefixEnum.STARTS_AFTER | ||
value = DateTimeType("2013-03-14") |
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.
The DateTimeType
supplied above to patient
has time zone but not here. Will running the query in different time zones produce consistent results?
Can we add tests for that case or create an issue to add them later?
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, I have opened #567
): ConditionParam<Long> { | ||
val (start, end) = value.rangeEpochMillis | ||
return when (prefix) { | ||
ParamPrefixEnum.APPROXIMATE -> TODO("Not Implemented") |
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 we add more details here about ParamPrefixEnum.APPROXIMATE
e.g. link to spec and reason for not implementing.
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.
Also, an issue to track it :)
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 opened #568 and added a link to the issue in the TODO
private val DateTimeType.rangeEpochMillis | ||
get() = value.time to precision.add(value, 1).time - 1 | ||
|
||
private data class ConditionParam<T>(val condition: String, val params: List<T>) { |
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 we use varargs
for params?
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.
We can't use varargs in the primary constructor of a data class. I've created a secondary constructor for that reason. I realize I was still using listOf in the dateTime code, I've updated that now.
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straighforward changes).
Fixes #375
Description
Clear and concise code change description.
Add date to search
Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Followed a similar approach to that of string and reference
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