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

Fix search document Bundle with local reference through composition #5978

Merged
merged 11 commits into from
Jun 6, 2024

Conversation

codeforgreen
Copy link
Collaborator

@codeforgreen codeforgreen commented May 29, 2024

Fixes #5988

  1. Previously, when using placeholder references within a document bundle, the matching was done using the request url, which is not populated for standalone document bundles. That field would be populated for transaction bundles. The fix was simply to use the fullUrl of the bundle entry to match internal resources when resolving FHIRPath expression within a Bundle. See issue details for an example.
  2. I added some new test cases and merged existing test cases in a new test class FhirResourceDaoR4SearchBundleNoFTTest.
  3. While working on the fix, I found that using a parameter name that contains dot character would result in an ArrayIndexOutOfBounds when the resource is created/updated, which would happen in the ResourceLinkPredicateBuilder method createResourceLinkPaths. I noticed that the spec does not mention any restriction with respect to parameter name (code), therefore I applied two fixes here. One was try to first lookup a parameter using the full name including dot, and in case if not found, then try to build the chain. Second of all, the qualifier list provided can be empty and in such cases it should not produce an ArrayIndexOutOfBounds.
  4. I added some more tests to ResourceLinkPredicateBuilderTest to ensure mentioned issues are fixed.

Copy link

Formatting check succeeded!

@codeforgreen codeforgreen changed the title Test Bundle search with custom search parameters Fix search document Bundle with internal reference through composition Jun 5, 2024
@codeforgreen codeforgreen changed the title Fix search document Bundle with internal reference through composition Fix search document Bundle with local reference through composition Jun 5, 2024
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.42%. Comparing base (497b9f2) to head (d57019d).
Report is 81 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5978      +/-   ##
============================================
+ Coverage     83.39%   83.42%   +0.03%     
- Complexity    26927    27123     +196     
============================================
  Files          1681     1694      +13     
  Lines        103965   104730     +765     
  Branches      13189    13277      +88     
============================================
+ Hits          86702    87373     +671     
- Misses        11613    11660      +47     
- Partials       5650     5697      +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tadgh tadgh self-requested a review June 6, 2024 16:52

// This can happen during recursion, if not all the possible target types of one link in the chain
// support the next link
return new ArrayList<>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Collections.emptyList

@tadgh tadgh merged commit 00a6591 into master Jun 6, 2024
65 of 66 checks passed
@tadgh tadgh deleted the mm-20240529-test-search-bundle-custom-search-params branch June 6, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SearchParameter for Bundle document referencing resource through composition does not work
2 participants