use of com.google.api.services.healthcare.v1.model.ListDicomStoresResponse 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());
}
}
Aggregations