Skip to content

Comments

Bug fix related to fhirConnector#52

Merged
sameeragunarathne merged 2 commits intoballerina-platform:mainfrom
anjuchamantha:consent
Feb 18, 2026
Merged

Bug fix related to fhirConnector#52
sameeragunarathne merged 2 commits intoballerina-platform:mainfrom
anjuchamantha:consent

Conversation

@anjuchamantha
Copy link
Contributor

@anjuchamantha anjuchamantha commented Feb 18, 2026

Bug Description

When callOperation function is used for fhirserver:$export, the fhir server sends http 202 response.
But in getBundleResponse (which is called inside callOperation) the response is considered success only if fhirserver:$export response status code is 200.

Overview

This pull request addresses a functional issue where the fhirConnector module 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 getBundleResponse function 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 the fhirserver:$export operation 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:

  • Core packages updated: crypto (2.9.0 → 2.9.3), http (2.14.2 → 2.14.9), jwt (2.15.0 → 2.15.1), log (2.12.0 → 2.14.0), time (2.7.0 → 2.8.0)
  • New data handling packages added: data.csv (0.8.1), data.jsondata (1.1.3), and data.xmldata (1.5.3) to support enhanced data processing capabilities
  • Enhanced module integrations: FTP package updated (2.13.1 → 2.16.0) with new dependencies on crypto, data packages, and time

These dependency updates maintain compatibility while providing access to the latest bug fixes and enhancements from the Ballerina ecosystem.

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
Dependency Updates
fhir/Dependencies.toml
Distribution version updated to 2201.12.11; bumped versions for crypto (2.9.3), http (2.14.9), ftp (2.16.0), log (2.14.0), task (2.11.1), and others; added three new data packages (data.csv 0.8.1, data.jsondata 1.1.3, data.xmldata 1.5.3); expanded dependency graphs for ftp and http to include new data packages and time.
HTTP Response Handling
fhir/utils.bal
Extended getBundleResponse success condition to treat HTTP status codes 201 (Created), 202 (Accepted), and 204 (No Content) as successful responses alongside 200 (OK).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hoppity-hop, the deps align,
New data packages, how divine!
HTTP codes now more complete,
201, 202, what a treat!
Version bumps both far and wide,
Ballerina bounds with growing pride! 📦✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is incomplete and deviates from the provided template structure; it only partially documents the issue without covering required sections. Fill in the template sections including Purpose, Goals, Approach, Release note, and other required sections to meet documentation standards.
Title check ❓ Inconclusive The title is vague and does not specify which bug or what the fix addresses; it lacks clarity about the actual change. Use a more specific title such as 'Handle HTTP 202 Accepted responses in getBundleResponse' to clearly describe the bug fix.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

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

Choose a reason for hiding this comment

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

can we consider 2xx to pass? if so we can check if the status code is within range of 200, 300

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added with 28a647d. Fixed in other places as well

@sameeragunarathne sameeragunarathne merged commit d732ebc into ballerina-platform:main Feb 18, 2026
4 checks passed
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.

2 participants