-
Notifications
You must be signed in to change notification settings - Fork 25
HttpClientUtils: POST and PUT handling / Resource ingestion priority #548
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
HttpClientUtils: POST and PUT handling / Resource ingestion priority #548
Conversation
…es can be posted in specific order together.
…ogger.info messages for readability.
…or each type of resource.
…cOS with the system managed cached Executor.
|
@echicoine-icf Will need to remove ThreadUtils changes since those are now covered by PR #555. Might need to rebase, or merge master to address the tests issues that github is reporting. |
…into POST-and-PUT-handling
sorry about that, forgot I had it in this PR. It's been removed here now, and the latest master branch pulled in |
|
@echicoine-icf Looks like we are reinventing the wheel a bit here. I understand the need, but am suspicious of the proposed solution. The priority ranking seems unnecessary. Why not just merge all the resources into a single transaction bundle? That removes the need for priority and always results in a POST request. Additionally, the bundle can be deduped to avoid redundant requests. Perhaps I am misunderstanding something? |
This comes from testing the RefreshIG operation against our hapi-fhir endpoint for weeks on end. I can't explain why, but this approach had the highest "success rate" with regard to the number of resources accepted by hapi-fhir. When I only focused on uploading transaction bundles, there were failures due to references to missing resources. Then when I started sending individual resources before those transaction bundles the bundles were accepted. I also am inclined to think madie's own sort of data integrity enforcement being looser than hapi-fhir's could be a source of frustration here. I had to sanitize their data in many different ways just to get it accepted by the endpoint (no numerical-only ids, no references to missing resources to name the two biggest ones.) |
|
@echicoine-icf So it is the case then that the bundling/packaging process includes resources with references to resources not included in the bundle? |
When I get some time I'll retest for clarity, but the files being persisted should be the same as what's in the transaction bundle. It's been a few months since I last worked on this so I'll give updates when I have further information. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #548 +/- ##
============================================
- Coverage 21.42% 21.39% -0.04%
+ Complexity 1703 1701 -2
============================================
Files 303 303
Lines 26379 26484 +105
Branches 4204 4246 +42
============================================
+ Hits 5653 5667 +14
- Misses 19787 19871 +84
- Partials 939 946 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
First off thank you for your input on this and guidance. I spent time today stepping through it and found a major oversight. In AbstractBundler the persistBundle call was coming after calls to add various resources to the bundle first. This would account for the missing resources. I've adjusted the abstract class to no longer require persistFilesFolder, and removed this function from MeasureBundler. The process will focus on ensuring the bundle has all the resources required. As to the changes to HttpClientUtils - bundles still require a different http method than individual resources, and in my tests I did manage to find an optimal order in which various individual resources should be persisted. For example, Encounter references Patient, or an Observation might reference an Encounter, etc. I think having HttpClientUtils handle sorting of resources and handling the different approach to sending them to a fhir server is a useful addition to the class to help keep it's capability robust. |
|
Closing this pull request as the defined goals are now out of scope from the initial request. Will open a new PR to address bug fixes with regard to persisting transaction bundles during Refresh |
This change helps to establish dependency ordering for persisting resources to a FHIR server for a more successful ingestion of data. The change also distinguishes between a POST and PUT call based on transaction Bundle vs Resource.
By creating this PR you acknowledge that your contribution will be licensed under Apache 2.0