lnogueir commented on code in PR #22152:
URL: https://github.com/apache/beam/pull/22152#discussion_r915210241


##########
sdks/go/pkg/beam/io/fhirio/common.go:
##########
@@ -91,18 +98,61 @@ func (c *fhirStoreClientImpl) search(storePath, 
resourceType string, queries map
        }
 
        searchRequest := &healthcare.SearchResourcesRequest{}
+       fhirService := 
c.healthcareService.Projects.Locations.Datasets.FhirStores.Fhir
+
        if resourceType == "" {
-               return c.fhirService.Search(storePath, 
searchRequest).Do(queryParams...)
+               return fhirService.Search(storePath, 
searchRequest).Do(queryParams...)
+       }
+       return fhirService.SearchType(storePath, resourceType, 
searchRequest).Do(queryParams...)
+}
+
+func (c *fhirStoreClientImpl) deidentify(srcStorePath, dstStorePath string, 
deidConfig *healthcare.DeidentifyConfig) (operationResults, error) {
+       deidRequest := &healthcare.DeidentifyFhirStoreRequest{
+               Config:           deidConfig,
+               DestinationStore: dstStorePath,
+       }
+       operation, err := 
c.healthcareService.Projects.Locations.Datasets.FhirStores.Deidentify(srcStorePath,
 deidRequest).Do()
+       if err != nil {
+               return operationResults{}, err
+       }
+       return c.waitTillCompleteAndCollectResults(operation)
+}
+
+func (c *fhirStoreClientImpl) waitTillCompleteAndCollectResults(operation 
*healthcare.Operation) (operationResults, error) {
+       var err error
+       for !operation.Done {
+               time.Sleep(5 * time.Second)

Review Comment:
   Sounds good. When I was testing with my tiny sample size, 15s seemed too 
long. But it makes sense since the use cases will have a much bigger sample 
size! Updated :) 



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

Reply via email to