pabloem commented on a change in pull request #11702:
URL: https://github.com/apache/beam/pull/11702#discussion_r437721434



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirIO.java
##########
@@ -155,17 +168,53 @@
  * FhirIO.Write.Result writeResult =
  *     output.apply("Execute FHIR Bundles", 
FhirIO.executeBundles(options.getExistingFhirStore()));
  *
+ * // Alternatively you could use import for high throughput to a new store.
+ * FhirIO.Write.Result writeResult =
+ *     output.apply("Import FHIR Resources", 
FhirIO.executeBundles(options.getNewFhirStore()));
+ * // [End Writing ]
+ *
  * PCollection<HealthcareIOError<String>> failedBundles = 
writeResult.getFailedInsertsWithErr();
  *
+ * // [Begin Writing to Dead Letter Queue]
  * failedBundles.apply("Write failed bundles to BigQuery",
  *     BigQueryIO
  *         .write()
  *         .to(option.getBQFhirExecuteBundlesDeadLetterTable())
  *         .withFormatFunction(new HealthcareIOErrorToTableRow()));
+ * // [End Writing to Dead Letter Queue]
+ *
+ * // Alternatively you may want to handle DeadLetter with conditional update
+ * // [Begin Reconciliation with Conditional Update]
+ * failedBundles
+ *     .apply("Reconcile with Conditional Update",
+ *         FhirIO.ConditionalUpdate(fhirStore)
+ *             
.withFormatBodyFunction(HealthcareIOError<String>::getDataResource)
+ *             .withTypeFunction((HealthcareIOError<String> err) -> {
+ *               String body = err.getDataResource();
+ *               // TODO(user) insert logic to exctract type.
+ *               return params;
+ *             })
+ *             .withSearchParametersFunction((HealthcareIOError<String> err) 
-> {

Review comment:
       I think that makes total sense. Thanks!




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to