use of com.google.api.services.healthcare.v1.model.DicomStore in project java-docs-samples by GoogleCloudPlatform.
the class DicomStoreList method dicomStoreList.
public static void dicomStoreList(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<DicomStore> stores = new ArrayList<>();
do {
// Create request and configure any parameters.
DicomStores.List request = client.projects().locations().datasets().dicomStores().list(datasetName).setPageSize(// Specify pageSize up to 1000
100).setPageToken(pageToken);
// Execute response and collect results.
ListDicomStoresResponse response = request.execute();
stores.addAll(response.getDicomStores());
// Update the page token for the next request.
pageToken = response.getNextPageToken();
} while (pageToken != null);
// Print results.
System.out.printf("Retrieved %s DICOM stores: \n", stores.size());
for (DicomStore data : stores) {
System.out.println("\t" + data.toPrettyString());
}
}
use of com.google.api.services.healthcare.v1.model.DicomStore in project java-docs-samples by GoogleCloudPlatform.
the class DicomStorePatch method patchDicomStore.
public static void patchDicomStore(String dicomStoreName, String pubsubTopic) throws IOException {
// String dicomStoreName =
// String.format(
// DICOM_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-dicom-id");
// String pubsubTopic = "projects/your-project-id/topics/your-pubsub-topic";
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Fetch the initial state of the DICOM store.
DicomStores.Get getRequest = client.projects().locations().datasets().dicomStores().get(dicomStoreName);
DicomStore store = getRequest.execute();
// Update the DicomStore fields as needed as needed. For a full list of DicomStore fields, see:
// https://cloud.google.com/healthcare/docs/reference/rest/v1/projects.locations.datasets.dicomStores#DicomStore
store.setNotificationConfig(new NotificationConfig().setPubsubTopic(pubsubTopic));
// Create request and configure any parameters.
DicomStores.Patch request = client.projects().locations().datasets().dicomStores().patch(dicomStoreName, store).setUpdateMask("notificationConfig");
// Execute the request and process the results.
store = request.execute();
System.out.println("DICOM store patched: \n" + store.toPrettyString());
}
use of com.google.api.services.healthcare.v1.model.DicomStore in project java-docs-samples by GoogleCloudPlatform.
the class DicomStoreGet method dicomeStoreGet.
public static void dicomeStoreGet(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.Get request = client.projects().locations().datasets().dicomStores().get(dicomStoreName);
// Execute the request and process the results.
DicomStore store = request.execute();
System.out.println("DICOM store retrieved: \n" + store.toPrettyString());
}
use of com.google.api.services.healthcare.v1.model.DicomStore in project beam by apache.
the class HttpHealthcareApiClient method createDicomStore.
@Override
public DicomStore createDicomStore(String dataset, String name, @Nullable String pubsubTopic) throws IOException {
DicomStore store = new DicomStore();
if (pubsubTopic != null) {
NotificationConfig notificationConfig = new NotificationConfig();
notificationConfig.setPubsubTopic(pubsubTopic);
store.setNotificationConfig(notificationConfig);
}
return client.projects().locations().datasets().dicomStores().create(dataset, store).setDicomStoreId(name).execute();
}
use of com.google.api.services.healthcare.v1.model.DicomStore 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());
}
Aggregations