Skip to content
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

Merged
merged 15 commits into from
May 27, 2021
Merged

Adds token search #461

merged 15 commits into from
May 27, 2021

Conversation

rkodev
Copy link
Contributor

@rkodev rkodev commented May 3, 2021

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

  • I have read and acknowledged the Code of conduct
  • I have read How to Contribute
  • I have read the Developer's guide
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally
  • I have built and run the reference app(s) to verify my change fixes the issue and/or does not break the reference app(s)

@epicadk
Copy link
Contributor

epicadk commented May 3, 2021

Can you also add modifiers as mentioned here https://www.hl7.org/fhir/search.html#token

@rkodev
Copy link
Contributor Author

rkodev commented May 4, 2021

@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.

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rkodev!

Comment on lines 70 to 71
var value: Any? = null,
var system: String? = null
Copy link
Collaborator

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.

Copy link
Contributor Author

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


@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>()

Copy link
Collaborator

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() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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))

Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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() {
Copy link
Collaborator

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() {

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rkodev 👍

@rkodev rkodev merged commit 94ef977 into master May 27, 2021
@rkodev rkodev deleted the feature/token_search branch May 27, 2021 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Support search for token types
4 participants