Search in sources :

Example 1 with DeidentifyConfig

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();
}
Also used : DeidentifyFhirStoreRequest(com.google.api.services.healthcare.v1.model.DeidentifyFhirStoreRequest)

Example 2 with DeidentifyConfig

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();
}
Also used : DeidentifyConfig(com.google.api.services.healthcare.v1.model.DeidentifyConfig) Test(org.junit.Test)

Example 3 with DeidentifyConfig

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);
    }
}
Also used : Datasets(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets) DeidentifyDatasetRequest(com.google.api.services.healthcare.v1.model.DeidentifyDatasetRequest) DeidentifyConfig(com.google.api.services.healthcare.v1.model.DeidentifyConfig) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare) Operation(com.google.api.services.healthcare.v1.model.Operation) DicomConfig(com.google.api.services.healthcare.v1.model.DicomConfig) TagFilterList(com.google.api.services.healthcare.v1.model.TagFilterList) IOException(java.io.IOException)

Aggregations

DeidentifyConfig (com.google.api.services.healthcare.v1.model.DeidentifyConfig)2 CloudHealthcare (com.google.api.services.healthcare.v1.CloudHealthcare)1 Datasets (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets)1 DeidentifyDatasetRequest (com.google.api.services.healthcare.v1.model.DeidentifyDatasetRequest)1 DeidentifyFhirStoreRequest (com.google.api.services.healthcare.v1.model.DeidentifyFhirStoreRequest)1 DicomConfig (com.google.api.services.healthcare.v1.model.DicomConfig)1 Operation (com.google.api.services.healthcare.v1.model.Operation)1 TagFilterList (com.google.api.services.healthcare.v1.model.TagFilterList)1 IOException (java.io.IOException)1 Test (org.junit.Test)1