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



##########
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:
       Hmm on second thought the best way to do this if for the user to use 
HAPI library search builder which will be better maintained. 
   I think we can add this as a suggestion in the docs rather than making this 
a beam dependency or duplicating the functionality. Thoughts?
   https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations_search.html




----------------------------------------------------------------
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:
[email protected]


Reply via email to