-
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
Adds token search #461
Adds token search #461
Conversation
Can you also add modifiers as mentioned here https://www.hl7.org/fhir/search.html#token |
@epicadk Can we add this modifier in a separate PR, I think how we choose to implement the modifiers will affect how they are implemented for the other data types. |
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 @rkodev!
var value: Any? = null, | ||
var system: String? = null |
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.
swap the order of these two please? think it matches the description here https://www.hl7.org/fhir/search.html#token better. if both exist system is before code.
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.
Resolved. Renamed value
to code
and swapped the order
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/SearchDsl.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Jing Tang <jing.t86@gmail.com>
engine/src/main/java/com/google/android/fhir/search/SearchDsl.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/SearchDsl.kt
Outdated
Show resolved
Hide resolved
engine/src/test/java/com/google/android/fhir/search/SearchTest.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/SearchDsl.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/SearchDsl.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/SearchDsl.kt
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/google/android/fhir/search/SearchDsl.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Jing Tang <jing.t86@gmail.com>
Co-authored-by: Jing Tang <jing.t86@gmail.com>
Co-authored-by: Jing Tang <jing.t86@gmail.com>
|
||
@SearchDslMarker | ||
data class Search(val type: ResourceType, var count: Int? = null, var from: Int? = null) { | ||
internal val stringFilters = mutableListOf<StringFilter>() | ||
internal val referenceFilter = mutableListOf<ReferenceFilter>() | ||
internal val referenceFilters = mutableListOf<ReferenceFilter>() | ||
|
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.
remove this new line
@@ -206,6 +211,232 @@ class SearchTest { | |||
) | |||
} | |||
|
|||
@Test | |||
fun search_token_filter_by_coding_type() { |
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.
fun search_token_filter_by_coding_type() { | |
fun search_filter_token_coding() { |
same for all the test cases below
} | ||
|
||
fun filter(filter: TokenClientParam, coding: Coding) = | ||
tokenFilters.add(TokenFilter(parameter = filter, uri = coding.system, code = coding.code)) | ||
|
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.
sorry that i missed this - but isn't there also CodeableConcept
?
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.
This would require a or parameter. I left it out since we still do not support or
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.
} | ||
|
||
@Test | ||
fun search_token_filter_by_contact_point() { |
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.
add a case where there is no use
in contact poiont.
fun search_filter_token_contactPoint_missingUse() {
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 @rkodev 👍
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #431
Description
Adds filter by token
Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Type
Choose one: Feature
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