use of com.google.api.services.healthcare.v1.model.DeidentifyConfig 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.model.DeidentifyConfig in project beam by apache.
the class FhirIOLROIT method test_FhirIO_deidentify.
@Test
public void test_FhirIO_deidentify() throws IOException {
String fhirStoreName = healthcareDataset + "/fhirStores/" + fhirStoreId;
String destinationFhirStoreName = healthcareDataset + "/fhirStores/" + deidFhirStoreId;
// use default DeidentifyConfig
DeidentifyConfig deidConfig = new DeidentifyConfig();
pipeline.apply(FhirIO.deidentify(fhirStoreName, destinationFhirStoreName, deidConfig));
pipeline.run();
}
use of com.google.api.services.healthcare.v1.model.DeidentifyConfig in project java-docs-samples by GoogleCloudPlatform.
the class DatasetDeIdentify method datasetDeIdentify.
public static void datasetDeIdentify(String srcDatasetName, String destDatasetName) throws IOException {
// String srcDatasetName =
// String.format(DATASET_NAME, "your-project-id", "your-region-id", "your-src-dataset-id");
// String destDatasetName =
// String.format(DATASET_NAME, "your-project-id", "your-region-id", "your-dest-dataset-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Configure what information needs to be De-Identified.
// For more information on de-identifying using tags, please see the following:
// https://cloud.google.com/healthcare/docs/how-tos/dicom-deidentify#de-identification_using_tags
TagFilterList tags = new TagFilterList().setTags(Arrays.asList("PatientID"));
DicomConfig dicomConfig = new DicomConfig().setKeepList(tags);
DeidentifyConfig config = new DeidentifyConfig().setDicom(dicomConfig);
// Create the de-identify request and configure any parameters.
DeidentifyDatasetRequest deidentifyRequest = new DeidentifyDatasetRequest().setDestinationDataset(destDatasetName).setConfig(config);
Datasets.Deidentify request = client.projects().locations().datasets().deidentify(srcDatasetName, deidentifyRequest);
// Execute the request, wait for the operation to complete, and process the results.
try {
Operation operation = request.execute();
while (operation.getDone() == null || !operation.getDone()) {
// Update the status of the operation with another request.
// Pause for 500ms between requests.
Thread.sleep(500);
operation = client.projects().locations().datasets().operations().get(operation.getName()).execute();
}
System.out.println("De-identified Dataset created. Response content: " + operation.getResponse());
} catch (Exception ex) {
System.out.printf("Error during request execution: %s", ex.toString());
ex.printStackTrace(System.out);
}
}
Aggregations