use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores in project beam by apache.
the class HttpHealthcareApiClient method importFhirResource.
@Override
public Operation importFhirResource(String fhirStore, String gcsSourcePath, @Nullable String contentStructure) throws IOException {
GoogleCloudHealthcareV1FhirGcsSource gcsSrc = new GoogleCloudHealthcareV1FhirGcsSource();
gcsSrc.setUri(gcsSourcePath);
ImportResourcesRequest importRequest = new ImportResourcesRequest();
importRequest.setGcsSource(gcsSrc).setContentStructure(contentStructure);
return client.projects().locations().datasets().fhirStores().healthcareImport(fhirStore, importRequest).execute();
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores in project beam by apache.
the class HttpHealthcareApiClient method searchFhirResource.
@Override
public HttpBody searchFhirResource(String fhirStore, String resourceType, @Nullable Map<String, Object> parameters, String pageToken) throws IOException {
SearchResourcesRequest request = new SearchResourcesRequest().setResourceType(resourceType);
Search search = client.projects().locations().datasets().fhirStores().fhir().search(fhirStore, request);
if (parameters != null && !parameters.isEmpty()) {
parameters.forEach(search::set);
}
if (pageToken != null && !pageToken.isEmpty()) {
search.set("_page_token", URLDecoder.decode(pageToken, "UTF-8"));
}
return search.execute();
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores in project beam by apache.
the class HttpHealthcareApiClient method deidentifyFhirStore.
@Override
public Operation deidentifyFhirStore(String sourcefhirStore, String destinationFhirStore, DeidentifyConfig deidConfig) throws IOException {
DeidentifyFhirStoreRequest deidRequest = new DeidentifyFhirStoreRequest();
deidRequest.setDestinationStore(destinationFhirStore);
deidRequest.setConfig(deidConfig);
return client.projects().locations().datasets().fhirStores().deidentify(sourcefhirStore, deidRequest).execute();
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores in project java-docs-samples by GoogleCloudPlatform.
the class FhirStoreList method fhirStoreList.
public static void fhirStoreList(String datasetName) throws IOException {
// String datasetName =
// String.format(DATASET_NAME, "your-project-id", "your-region-id", "your-dataset-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Results are paginated, so multiple queries may be required.
String pageToken = null;
List<FhirStore> stores = new ArrayList<>();
do {
// Create request and configure any parameters.
FhirStores.List request = client.projects().locations().datasets().fhirStores().list(datasetName).setPageSize(// Specify pageSize up to 1000
100).setPageToken(pageToken);
// Execute response and collect results.
ListFhirStoresResponse response = request.execute();
stores.addAll(response.getFhirStores());
// Update the page token for the next request.
pageToken = response.getNextPageToken();
} while (pageToken != null);
// Print results.
System.out.printf("Retrieved %s Fhir stores: \n", stores.size());
for (FhirStore data : stores) {
System.out.println("\t" + data.toPrettyString());
}
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores in project java-docs-samples by GoogleCloudPlatform.
the class FhirStoreSetIamPolicy method fhirStoreSetIamPolicy.
public static void fhirStoreSetIamPolicy(String fhirStoreName) throws IOException {
// String fhirStoreName =
// String.format(
// FHIR_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-fhir-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Configure the IAMPolicy to apply to the store.
// For more information on understanding IAM roles, see the following:
// https://cloud.google.com/iam/docs/understanding-roles
Binding binding = new Binding().setRole("roles/healthcare.fhirResourceReader").setMembers(Arrays.asList("domain:google.com"));
Policy policy = new Policy().setBindings(Arrays.asList(binding));
SetIamPolicyRequest policyRequest = new SetIamPolicyRequest().setPolicy(policy);
// Create request and configure any parameters.
FhirStores.SetIamPolicy request = client.projects().locations().datasets().fhirStores().setIamPolicy(fhirStoreName, policyRequest);
// Execute the request and process the results.
Policy updatedPolicy = request.execute();
System.out.println("FHIR policy has been updated: " + updatedPolicy.toPrettyString());
}
Aggregations