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

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

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


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirIO.java:
##########
@@ -1524,6 +1548,101 @@ private int parseBundleStatus(String status) {
     }
   }
 
+  /**
+   * ExecuteBundlesResult contains both successfully executed bundles and 
information help debugging
+   * failed executions (eg metadata & error msgs).
+   */
+  public static class ExecuteBundlesResult extends Write.AbstractResult {
+    private final Pipeline pipeline;
+    private final PCollection<FhirBundleResponse> successfulBundles;
+    private final PCollection<HealthcareIOError<FhirBundleResponse>> 
failedBundles;
+
+    private ExecuteBundlesResult(
+        Pipeline pipeline,
+        PCollection<FhirBundleResponse> successfulBundles,
+        PCollection<HealthcareIOError<FhirBundleResponse>> failedBundles) {
+      this.pipeline = pipeline;
+      this.successfulBundles = successfulBundles;
+      this.failedBundles = failedBundles;
+    }
+
+    /**
+     * Entry point for the ExecuteBundlesResult, storing the successful and 
failed bundles and their
+     * metadata.
+     */
+    public static ExecuteBundlesResult in(
+        Pipeline pipeline,
+        PCollection<FhirBundleResponse> successfulBundles,
+        PCollection<HealthcareIOError<FhirBundleResponse>> failedBundles) {
+      return new ExecuteBundlesResult(pipeline, successfulBundles, 
failedBundles);
+    }
+
+    @Override
+    public PCollection<String> getSuccessfulBodies() {
+      return this.successfulBundles.apply(
+          MapElements.into(TypeDescriptors.strings())
+              .via(bundleResponse -> 
bundleResponse.getFhirBundleParameter().getBundle()));

Review Comment:
   done





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

    Worklog Id:     (was: 775577)
    Time Spent: 4h  (was: 3h 50m)

> 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
>  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