use of com.google.api.services.healthcare.v1.model.ListFhirStoresResponse in project java-docs-samples by GoogleCloudPlatform.
the class FhirStoreList method fhirStoreList.
public static void fhirStoreList(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<FhirStore> stores = new ArrayList<>();
do {
// Create request and configure any parameters.
FhirStores.List request = client.projects().locations().datasets().fhirStores().list(datasetName).setPageSize(// Specify pageSize up to 1000
100).setPageToken(pageToken);
// Execute response and collect results.
ListFhirStoresResponse response = request.execute();
stores.addAll(response.getFhirStores());
// Update the page token for the next request.
pageToken = response.getNextPageToken();
} while (pageToken != null);
// Print results.
System.out.printf("Retrieved %s Fhir stores: \n", stores.size());
for (FhirStore data : stores) {
System.out.println("\t" + data.toPrettyString());
}
}
use of com.google.api.services.healthcare.v1.model.ListFhirStoresResponse in project beam by apache.
the class HttpHealthcareApiClient method listAllFhirStores.
@Override
public List<FhirStore> listAllFhirStores(String dataset) throws IOException {
ArrayList<FhirStore> fhirStores = new ArrayList<>();
String pageToken = "";
do {
ListFhirStoresResponse resp = client.projects().locations().datasets().fhirStores().list(dataset).setPageToken(pageToken).execute();
for (FhirStore fs : resp.getFhirStores()) {
fhirStores.add(fs);
}
if (resp.getNextPageToken() == null) {
break;
}
pageToken = resp.getNextPageToken();
} while (!pageToken.equals(""));
return fhirStores;
}
Aggregations