Search in sources :

Example 1 with ListDicomStoresResponse

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());
    }
}
Also used : ListDicomStoresResponse(com.google.api.services.healthcare.v1.model.ListDicomStoresResponse) DicomStore(com.google.api.services.healthcare.v1.model.DicomStore) DicomStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.DicomStores) ArrayList(java.util.ArrayList) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare)

Aggregations

CloudHealthcare (com.google.api.services.healthcare.v1.CloudHealthcare)1 DicomStores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.DicomStores)1 DicomStore (com.google.api.services.healthcare.v1.model.DicomStore)1 ListDicomStoresResponse (com.google.api.services.healthcare.v1.model.ListDicomStoresResponse)1 ArrayList (java.util.ArrayList)1