Skip to content

Support for Fire Arrow message channel queue && Upgrade dependencies#11

Open
bartekwk2 wants to merge 9 commits intomainfrom
upgrade-dependencies
Open

Support for Fire Arrow message channel queue && Upgrade dependencies#11
bartekwk2 wants to merge 9 commits intomainfrom
upgrade-dependencies

Conversation

@bartekwk2
Copy link
Copy Markdown
Collaborator

@bartekwk2 bartekwk2 commented Mar 10, 2026

  • Refactored message/event parsing to support HAPI message channel subscription, old ahds (AzureHealthDataService ) events are supported as well
  • Upgraded dependencies

Note

Medium Risk
Core message parsing/serialization and event modeling were refactored, so regressions could break queue processing across both formats despite added tests and documentation.

Overview
Adds support for consuming plain JSON HAPI/Fire Arrow MESSAGE-channel subscription notifications alongside existing AHDS/Event Grid CloudEvents by introducing pluggable parsing (AbstractFhirMessageParser) and queue-body encoding selection (QueueMessageEncoding).

Refactors the event model into a common FhirEvent base with format-specific AhdsFhirEvent/HapiFhirEvent, normalizes event types via converters, and optionally parses full-resource payloads into fhir_r4 Resource via payloadResource. Updates AzureMessageClient/Messenger.setupWithAzure to accept messageEncoding + parser, adjusts executor filtering to use fhirEvent.resourceType, and refreshes docs/tests; dependencies are upgraded (Freezed v3, http, adds fhir_r4).

Written by Cursor Bugbot for commit 0299b24. This will update automatically on new commits. Configure here.

@bartekwk2 bartekwk2 changed the title Support for Fire Arrow MESSAGE channel queue && Upgrade dependencies Support for Fire Arrow message channel queue && Upgrade dependencies Mar 10, 2026
@bartekwk2 bartekwk2 marked this pull request as ready for review March 11, 2026 06:27
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Double base64 encoding for poison queue messages
    • sanitizeMessage now reuses the already-base64 payload for base64 mode and only encodes raw JSON in none mode, preventing poison queue double encoding.

Create PR

Or push these changes by commenting:

@cursor push 375c698c5d
Preview (375c698c5d)
diff --git a/lib/src/fhir_message_client/azure_message_client.dart b/lib/src/fhir_message_client/azure_message_client.dart
--- a/lib/src/fhir_message_client/azure_message_client.dart
+++ b/lib/src/fhir_message_client/azure_message_client.dart
@@ -38,7 +38,9 @@
     final message = _serializeToFhirMessage(fhirPoisonedMessage);
     // Azure Put Message wraps the body in XML; raw JSON can contain <, >, &
     // and invalidate the document. Base64 so the payload is XML-safe.
-    final xmlSafeBody = base64.encode(utf8.encode(message));
+    final xmlSafeBody = _messageEncoding == QueueMessageEncoding.base64
+        ? message
+        : base64.encode(utf8.encode(message));
     await _storage.putQMessage(
       qName: _poisonQueueName,
       message: xmlSafeBody,

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread lib/src/fhir_message_client/azure_message_client.dart Outdated
Comment thread lib/src/fhir_message_client/models/fhir_event.dart Outdated
Comment thread lib/src/fhir_message_client/models/hapi/hapi_fhir_event.dart Outdated
Comment thread lib/src/fhir_message_client/models/hapi/hapi_fhir_event.dart
Comment thread lib/src/fhir_message_client/models/hapi/hapi_fhir_event.dart
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread lib/src/fhir_message_client/models/fhir_event_type_converter.dart
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.

1 participant