use of com.google.api.services.healthcare.v1.model.FhirStore in project java-docs-samples by GoogleCloudPlatform.
the class FhirStoreCreate method fhirStoreCreate.
public static void fhirStoreCreate(String datasetName, String fhirStoreId) throws IOException {
// String datasetName =
// String.format(DATASET_NAME, "your-project-id", "your-region-id", "your-dataset-id");
// String fhirStoreId = "your-fhir-id"
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Configure the FhirStore to be created.
Map<String, String> labels = new HashMap<String, String>();
labels.put("key1", "value1");
labels.put("key2", "value2");
String version = "STU3";
FhirStore content = new FhirStore().setLabels(labels).setVersion(version);
// Create request and configure any parameters.
FhirStores.Create request = client.projects().locations().datasets().fhirStores().create(datasetName, content).setFhirStoreId(fhirStoreId);
// Execute the request and process the results.
FhirStore response = request.execute();
System.out.println("FHIR store created: " + response.toPrettyString());
}
use of com.google.api.services.healthcare.v1.model.FhirStore in project java-docs-samples by GoogleCloudPlatform.
the class FhirStoreGet method fhirStoreGet.
public static void fhirStoreGet(String fhirStoreName) throws IOException {
// String fhirStoreName =
// String.format(
// FHIR_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-fhir-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Create request and configure any parameters.
FhirStores.Get request = client.projects().locations().datasets().fhirStores().get(fhirStoreName);
// Execute the request and process the results.
FhirStore store = request.execute();
System.out.println("FHIR store retrieved: \n" + store.toPrettyString());
}
use of com.google.api.services.healthcare.v1.model.FhirStore in project beam by apache.
the class HttpHealthcareApiClient method exportFhirResourceToGcs.
@Override
public Operation exportFhirResourceToGcs(String fhirStore, String gcsDestinationPrefix) throws IOException {
GoogleCloudHealthcareV1FhirGcsDestination gcsDst = new GoogleCloudHealthcareV1FhirGcsDestination();
gcsDst.setUriPrefix(gcsDestinationPrefix);
ExportResourcesRequest exportRequest = new ExportResourcesRequest();
exportRequest.setGcsDestination(gcsDst);
return client.projects().locations().datasets().fhirStores().export(fhirStore, exportRequest).execute();
}
use of com.google.api.services.healthcare.v1.model.FhirStore in project beam by apache.
the class HttpHealthcareApiClient method createFhirStore.
@Override
public FhirStore createFhirStore(String dataset, String name, String version, @Nullable String pubsubTopic) throws IOException {
FhirStore store = new FhirStore();
store.setVersion(version);
store.setDisableReferentialIntegrity(true);
store.setEnableUpdateCreate(true);
if (pubsubTopic != null) {
NotificationConfig notificationConfig = new NotificationConfig();
notificationConfig.setPubsubTopic(pubsubTopic);
store.setNotificationConfig(notificationConfig);
}
return client.projects().locations().datasets().fhirStores().create(dataset, store).setFhirStoreId(name).execute();
}
use of com.google.api.services.healthcare.v1.model.FhirStore 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