Search in sources :

Example 36 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.

the class DicomStoreCreate method dicomStoreCreate.

public static void dicomStoreCreate(String datasetName, String dicomStoreId) 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();
    // Configure the dicomStore to be created.
    Map<String, String> labels = new HashMap<String, String>();
    labels.put("key1", "value1");
    labels.put("key2", "value2");
    DicomStore content = new DicomStore().setLabels(labels);
    // Create request and configure any parameters.
    DicomStores.Create request = client.projects().locations().datasets().dicomStores().create(datasetName, content).setDicomStoreId(dicomStoreId);
    // Execute the request and process the results.
    DicomStore response = request.execute();
    System.out.println("DICOM store created: " + response.toPrettyString());
}
Also used : HashMap(java.util.HashMap) DicomStore(com.google.api.services.healthcare.v1.model.DicomStore) DicomStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.DicomStores) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare)

Example 37 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.

the class DicomStoreExport method dicomStoreExport.

public static void dicomStoreExport(String dicomStoreName, String gcsUri) throws IOException {
    // String dicomStoreName =
    // String.format(
    // DICOM_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-dicom-id");
    // String gcsUri = "gs://your-bucket-id/path/to/destination/dir"
    // Initialize the client, which will be used to interact with the service.
    CloudHealthcare client = createClient();
    // Configure where the store will be exported too.
    GoogleCloudHealthcareV1DicomGcsDestination gcsDestination = new GoogleCloudHealthcareV1DicomGcsDestination().setUriPrefix(gcsUri);
    ExportDicomDataRequest exportRequest = new ExportDicomDataRequest().setGcsDestination(gcsDestination);
    // Create request and configure any parameters.
    DicomStores.Export request = client.projects().locations().datasets().dicomStores().export(dicomStoreName, exportRequest);
    // 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("DICOM store export complete." + operation.getResponse());
    } catch (Exception ex) {
        System.out.printf("Error during request execution: %s", ex.toString());
        ex.printStackTrace(System.out);
    }
}
Also used : DicomStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.DicomStores) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare) GoogleCloudHealthcareV1DicomGcsDestination(com.google.api.services.healthcare.v1.model.GoogleCloudHealthcareV1DicomGcsDestination) Operation(com.google.api.services.healthcare.v1.model.Operation) ExportDicomDataRequest(com.google.api.services.healthcare.v1.model.ExportDicomDataRequest) IOException(java.io.IOException)

Example 38 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.

the class DicomWebSearchForInstances method dicomWebSearchForInstances.

public static void dicomWebSearchForInstances(String dicomStoreName) throws IOException {
    // String dicomStoreName =
    // String.format(
    // DICOM_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-dicom-id");
    // Initialize the client, which will be used to interact with the service.
    CloudHealthcare client = createClient();
    // Create request and configure any parameters.
    DicomStores.SearchForInstances request = client.projects().locations().datasets().dicomStores().searchForInstances(dicomStoreName, "instances");
    // Execute the request and process the results.
    HttpResponse response = request.executeUnparsed();
    System.out.println("Dicom store instances found: \n" + response.toString());
}
Also used : DicomStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.DicomStores) HttpResponse(com.google.api.client.http.HttpResponse) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare)

Example 39 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.

the class FhirStoreDelete method fhirStoreDelete.

public static void fhirStoreDelete(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();
    // Create request and configure any parameters.
    FhirStores.Delete request = client.projects().locations().datasets().fhirStores().delete(fhirStoreName);
    // Execute the request and process the results.
    request.execute();
    System.out.println("FHIR store deleted.");
}
Also used : FhirStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare)

Example 40 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.

the class FhirStoreGet method fhirStoreGet.

public static void fhirStoreGet(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();
    // Create request and configure any parameters.
    FhirStores.Get request = client.projects().locations().datasets().fhirStores().get(fhirStoreName);
    // Execute the request and process the results.
    FhirStore store = request.execute();
    System.out.println("FHIR store retrieved: \n" + store.toPrettyString());
}
Also used : FhirStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores) FhirStore(com.google.api.services.healthcare.v1.model.FhirStore) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare)

Aggregations

CloudHealthcare (com.google.api.services.healthcare.v1.CloudHealthcare)46 DicomStores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.DicomStores)11 FhirStores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores)9 Datasets (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets)8 Policy (com.google.api.services.healthcare.v1.model.Policy)8 Hl7V2Stores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.Hl7V2Stores)7 FhirStore (com.google.api.services.healthcare.v1.model.FhirStore)6 Message (com.google.api.services.healthcare.v1.model.Message)6 Operation (com.google.api.services.healthcare.v1.model.Operation)6 IOException (java.io.IOException)6 ArrayList (java.util.ArrayList)6 HttpResponse (com.google.api.client.http.HttpResponse)5 Messages (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.Hl7V2Stores.Messages)5 DicomStore (com.google.api.services.healthcare.v1.model.DicomStore)5 Binding (com.google.api.services.healthcare.v1.model.Binding)4 Dataset (com.google.api.services.healthcare.v1.model.Dataset)4 Hl7V2Store (com.google.api.services.healthcare.v1.model.Hl7V2Store)4 NotificationConfig (com.google.api.services.healthcare.v1.model.NotificationConfig)4 SetIamPolicyRequest (com.google.api.services.healthcare.v1.model.SetIamPolicyRequest)4 HashMap (java.util.HashMap)4