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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]