use of com.google.api.services.healthcare.v1.model.Dataset in project java-docs-samples by GoogleCloudPlatform.
the class HL7v2MessageGet method hl7v2MessageGet.
public static void hl7v2MessageGet(String hl7v2MessageName) throws IOException {
// String hl7v2MessageName =
// String.format(
// MESSAGE_NAME, "project-id", "region-id", "dataset-id", "hl7v2-id", "message-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Create request and configure any parameters.
Messages.Get request = client.projects().locations().datasets().hl7V2Stores().messages().get(hl7v2MessageName);
// Execute the request and process the results.
Message store = request.execute();
System.out.println("HL7v2 message retrieved: \n" + store.toPrettyString());
}
use of com.google.api.services.healthcare.v1.model.Dataset in project java-docs-samples by GoogleCloudPlatform.
the class HL7v2MessageList method hl7v2MessageList.
public static void hl7v2MessageList(String hl7v2StoreName) throws IOException {
// String hl7v2StoreName =
// String.format(
// HL7v2_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-hl7v2-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;
do {
// Create request and execute.
ListMessagesResponse messageResponse = client.projects().locations().datasets().hl7V2Stores().messages().list(hl7v2StoreName).setPageSize(100).setPageToken(pageToken).execute();
if (messageResponse.getHl7V2Messages() != null) {
// Print results.
System.out.printf("Retrieved %s HL7v2 messages: \n", messageResponse.getHl7V2Messages().size());
for (Message message : messageResponse.getHl7V2Messages()) {
System.out.println(message);
}
}
// Update the page token for the next request.
pageToken = messageResponse.getNextPageToken();
} while (pageToken != null);
}
use of com.google.api.services.healthcare.v1.model.Dataset 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.Dataset in project beam by apache.
the class HttpHealthcareApiClient method createDicomStore.
@Override
public DicomStore createDicomStore(String dataset, String name, @Nullable String pubsubTopic) throws IOException {
DicomStore store = new DicomStore();
if (pubsubTopic != null) {
NotificationConfig notificationConfig = new NotificationConfig();
notificationConfig.setPubsubTopic(pubsubTopic);
store.setNotificationConfig(notificationConfig);
}
return client.projects().locations().datasets().dicomStores().create(dataset, store).setDicomStoreId(name).execute();
}
use of com.google.api.services.healthcare.v1.model.Dataset 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