janeliulwq commented on a change in pull request #13395:
URL: https://github.com/apache/beam/pull/13395#discussion_r528727526



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirIO.java
##########
@@ -1388,4 +1398,206 @@ public void deidentify(ProcessContext context)
       }
     }
   }
+
+  /** The type Search. */
+  public static class Search extends PTransform<PCollection<KV<String, 
Map<String, Object>>>, FhirIO.Search.Result> {
+    private static final Logger LOG = LoggerFactory.getLogger(Search.class);
+
+    private final ValueProvider<String> fhirStore;
+
+    /**
+     * Instantiates a new Search.
+     *
+     * @param fhirStore the fhir store
+     */
+    Search(ValueProvider<String> fhirStore) {
+      this.fhirStore = fhirStore;
+    }
+
+    /**
+     * Instantiates a new Search.
+     *
+     * @param fhirStore the fhir store
+     */
+    Search(String fhirStore) {
+      this.fhirStore = StaticValueProvider.of(fhirStore);
+    }
+
+    /** The type Result. */
+    public static class Result implements POutput, PInput {
+      private PCollection<String> resources;
+
+      private PCollection<HealthcareIOError<String>> failedSearches;
+      /** The Pct. */

Review comment:
       Done.

##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HttpHealthcareApiClient.java
##########
@@ -545,6 +529,26 @@ public HttpBody readFhirResource(String resourceId) throws 
IOException {
     return 
client.projects().locations().datasets().fhirStores().fhir().read(resourceId).execute();
   }
 
+  @Override
+  public HttpBody searchFhirResource(
+          String fhirStore,
+          String resourceType,
+          @Nullable Map<String, Object> parameters)
+          throws IOException {
+    SearchResourcesRequest request = new 
SearchResourcesRequest().setResourceType(resourceType);
+    Search search = client
+            .projects()
+            .locations()
+            .datasets()
+            .fhirStores()
+            .fhir()
+            .search(fhirStore, request);

Review comment:
       Done.




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