[ 
https://issues.apache.org/jira/browse/BEAM-14504?focusedWorklogId=775740&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-775740
 ]

ASF GitHub Bot logged work on BEAM-14504:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/May/22 21:10
            Start Date: 29/May/22 21:10
    Worklog Time Spent: 10m 
      Work Description: fbeevikm commented on code in PR #17741:
URL: https://github.com/apache/beam/pull/17741#discussion_r884324648


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirIO.java:
##########
@@ -1492,20 +1513,23 @@ private void parseResponse(ProcessContext context, 
String inputBody, HttpBody re
             // 20X's are successes, otherwise failure.
             if (statusCode / 100 == 2) {
               success++;
-              context.output(Write.SUCCESSFUL_BODY, entry.toString());
+              context.output(
+                  SUCCESSFUL_BUNDLES, FhirBundleResponse.of(context.element(), 
entry.toString()));
             } else {
               fail++;
               context.output(
-                  Write.FAILED_BODY,
+                  FAILED_BUNDLES,
                   HealthcareIOError.of(
-                      inputBody, HealthcareHttpException.of(statusCode, 
entry.toString())));
+                      FhirBundleResponse.of(context.element()),
+                      HealthcareHttpException.of(statusCode, 
entry.toString())));
             }
           }
           EXECUTE_BUNDLE_RESOURCE_SUCCESS.inc(success);
           EXECUTE_BUNDLE_RESOURCE_ERRORS.inc(fail);
         } else if (bundleType.equals(BUNDLE_RESPONSE_TYPE_TRANSACTION)) {
           EXECUTE_BUNDLE_RESOURCE_SUCCESS.inc(entries.size());
-          context.output(Write.SUCCESSFUL_BODY, bundle.toString());
+          context.output(
+              SUCCESSFUL_BUNDLES, FhirBundleResponse.of(context.element(), 
bundle.toString()));

Review Comment:
   I had to revert this change because of the exception. Since bundle is a 
jsonObject and not a JsonPrimitive, getAsString throws UnsupportedOperation 
exception.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 775740)
    Time Spent: 4h 40m  (was: 4.5h)

> Add support for including addittional parameters to executebundle method in 
> fhirio.
> -----------------------------------------------------------------------------------
>
>                 Key: BEAM-14504
>                 URL: https://issues.apache.org/jira/browse/BEAM-14504
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-healthcare
>            Reporter: Fathima Mohammed
>            Assignee: Fathima Mohammed
>            Priority: P2
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> Add FhirBundleWithMetadata in executebundles method so that we can pass 
> additional information like message id.
> FhirBundleWithMetadata represents a FHIR bundle, with it's metadata (eg. Hl7 
> messageId) to be executed on the intermediate FHIR store.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to