Bug fix related to fhirConnector#52
Bug fix related to fhirConnector#52sameeragunarathne merged 2 commits intoballerina-platform:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughThe pull request updates dependency versions in the Ballerina project and modifies HTTP response handling. Multiple package versions are bumped (including crypto, http, ftp, and others), three new data-related packages are introduced (data.csv, data.jsondata, data.xmldata), and HTTP success condition logic is expanded to recognize additional status codes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
fhir/utils.bal
Outdated
| map<string> responseHeaders = extractHeadersFromResponse(response); | ||
|
|
||
| if statusCode == STATUS_CODE_OK { | ||
| if (statusCode == STATUS_CODE_OK || statusCode == STATUS_CODE_CREATED || statusCode == STATUS_CODE_NO_CONTENT || statusCode == STATUS_CODE_ACCEPTED) { |
There was a problem hiding this comment.
can we consider 2xx to pass? if so we can check if the status code is within range of 200, 300
There was a problem hiding this comment.
Added with 28a647d. Fixed in other places as well
Bug Description
Overview
This pull request addresses a functional issue where the
fhirConnectormodule was not properly handling asynchronous response statuses from FHIR server operations. The fix ensures proper support for standard HTTP response codes used in long-running operations.Changes Made
Core Functionality Fix (utils.bal)
Updated the
getBundleResponsefunction to recognize HTTP status codes 201 (Created), 202 (Accepted), and 204 (No Content) as successful responses in addition to 200 (OK). This change aligns the response handling logic with the actual behavior of FHIR servers, particularly for thefhirserver:$exportoperation which returns a 202 status code to indicate accepted asynchronous processing.Dependency Updates (Dependencies.toml)
Updated multiple dependency package versions to their latest compatible releases:
These dependency updates maintain compatibility while providing access to the latest bug fixes and enhancements from the Ballerina ecosystem.