Search in sources :

Example 1 with ListHl7V2StoresResponse

use of com.google.api.services.healthcare.v1.model.ListHl7V2StoresResponse in project java-docs-samples by GoogleCloudPlatform.

the class Hl7v2StoreList method hl7v2StoreList.

public static void hl7v2StoreList(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<Hl7V2Store> stores = new ArrayList<>();
    do {
        // Create request and configure any parameters.
        Hl7V2Stores.List request = client.projects().locations().datasets().hl7V2Stores().list(datasetName).setPageSize(// Specify pageSize up to 1000
        100).setPageToken(pageToken);
        // Execute response and collect results.
        ListHl7V2StoresResponse response = request.execute();
        stores.addAll(response.getHl7V2Stores());
        // Update the page token for the next request.
        pageToken = response.getNextPageToken();
    } while (pageToken != null);
    // Print results.
    System.out.printf("Retrieved %s HL7v2 stores: \n", stores.size());
    for (Hl7V2Store data : stores) {
        System.out.println("\t" + data.toPrettyString());
    }
}
Also used : Hl7V2Stores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.Hl7V2Stores) ArrayList(java.util.ArrayList) ListHl7V2StoresResponse(com.google.api.services.healthcare.v1.model.ListHl7V2StoresResponse) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare) Hl7V2Store(com.google.api.services.healthcare.v1.model.Hl7V2Store)

Aggregations

CloudHealthcare (com.google.api.services.healthcare.v1.CloudHealthcare)1 Hl7V2Stores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.Hl7V2Stores)1 Hl7V2Store (com.google.api.services.healthcare.v1.model.Hl7V2Store)1 ListHl7V2StoresResponse (com.google.api.services.healthcare.v1.model.ListHl7V2StoresResponse)1 ArrayList (java.util.ArrayList)1