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

Added support to search using multiple resource types #697

Merged
merged 13 commits into from
Sep 2, 2021

Conversation

aditya-07
Copy link
Collaborator

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #611

Description
Added a nested search to the current Search class so that the user can do a search reverse chained search like
Return all Patients who have a Condition - Diabetes referenced by Condition.subject property

Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type
Choose one: Feature

Screenshots (if applicable)

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)

@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2021

Codecov Report

Merging #697 (b1d26a3) into master (6db0990) will increase coverage by 1.10%.
The diff coverage is 78.37%.

❗ Current head b1d26a3 differs from pull request most recent head 5c0a35e. Consider uploading reports for the commit 5c0a35e to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master     #697      +/-   ##
============================================
+ Coverage     52.80%   53.90%   +1.10%     
- Complexity      196      198       +2     
============================================
  Files            47       48       +1     
  Lines           981     1011      +30     
  Branches        136      139       +3     
============================================
+ Hits            518      545      +27     
- Misses          380      381       +1     
- Partials         83       85       +2     
Impacted Files Coverage Δ
...n/java/com/google/android/fhir/search/SearchDsl.kt 67.16% <50.00%> (+2.54%) ⬆️
.../java/com/google/android/fhir/search/MoreSearch.kt 71.49% <76.00%> (+1.04%) ⬆️
...ava/com/google/android/fhir/search/NestedSearch.kt 90.00% <90.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6db0990...5c0a35e. Read the comment docs.

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.

Great job!!!

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.

QQ: what happens when you try to have mulit-level nesting? Have you tested? Can you add a test case?

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.

QQ: what happens when you try to have mulit-level nesting? Have you tested? Can you add a test case?

@aditya-07
Copy link
Collaborator Author

QQ: what happens when you try to have mulit-level nesting? Have you tested? Can you add a test case?

Added search_practitioner_has_patient_has_conditions_diabetes_and_hypertension test which handles multiple mulit-level nestings.

$sortJoinStatement
WHERE a.resourceType = ?
$filterStatement
$sortOrderStatement
Copy link
Collaborator

Choose a reason for hiding this comment

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

please refactor so that count queries don't include sort order statement and limit statement? throw exception and add a test case as well please.

happy for you to do that in a follow-up immediately after this pr.

@aditya-07 aditya-07 enabled auto-merge (squash) September 1, 2021 20:47
@aditya-07 aditya-07 merged commit 844f397 into master Sep 2, 2021
@aditya-07 aditya-07 deleted the ak/search-by-multiple-resources branch September 2, 2021 02:52
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.

Search by multiple resource types
3 participants