Search in sources :

Example 1 with NotificationConfig

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

the class Hl7v2StorePatch method patchHl7v2Store.

public static void patchHl7v2Store(String hl7v2StoreName, String pubsubTopic) throws IOException {
    // String hl7v2StoreName =
    // String.format(
    // HL7v2_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-hl7v2-id");
    // String pubsubTopic = "projects/your-project-id/topics/your-pubsub-topic";
    // Initialize the client, which will be used to interact with the service.
    CloudHealthcare client = createClient();
    // Fetch the initial state of the HL7v2 store.
    Hl7V2Stores.Get getRequest = client.projects().locations().datasets().hl7V2Stores().get(hl7v2StoreName);
    Hl7V2Store store = getRequest.execute();
    Hl7V2NotificationConfig notificationConfig = new Hl7V2NotificationConfig();
    notificationConfig.setPubsubTopic(pubsubTopic);
    List<Hl7V2NotificationConfig> notificationConfigs = new ArrayList<Hl7V2NotificationConfig>();
    notificationConfigs.add(notificationConfig);
    // Update the Hl7v2Store fields as needed as needed. For a full list of Hl7v2Store fields, see:
    // https://cloud.google.com/healthcare/docs/reference/rest/v1/projects.locations.datasets.hl7V2Store#Hl7v2Store
    store.setNotificationConfigs(notificationConfigs);
    // Create request and configure any parameters.
    Hl7V2Stores.Patch request = client.projects().locations().datasets().hl7V2Stores().patch(hl7v2StoreName, store).setUpdateMask("notificationConfigs");
    // Execute the request and process the results.
    store = request.execute();
    System.out.println("HL7v2 store patched: \n" + store.toPrettyString());
}
Also used : Hl7V2Stores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.Hl7V2Stores) Hl7V2NotificationConfig(com.google.api.services.healthcare.v1.model.Hl7V2NotificationConfig) ArrayList(java.util.ArrayList) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare) Hl7V2Store(com.google.api.services.healthcare.v1.model.Hl7V2Store)

Example 2 with NotificationConfig

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

the class FhirStorePatch method fhirStorePatch.

public static void fhirStorePatch(String fhirStoreName, String pubsubTopic) throws IOException {
    // String fhirStoreName =
    // String.format(
    // FHIR_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-fhir-id");
    // String pubsubTopic = "projects/your-project-id/topics/your-pubsub-topic";
    // Initialize the client, which will be used to interact with the service.
    CloudHealthcare client = createClient();
    // Fetch the initial state of the FHIR store.
    FhirStores.Get getRequest = client.projects().locations().datasets().fhirStores().get(fhirStoreName);
    FhirStore store = getRequest.execute();
    // Update the FhirStore fields as needed as needed. For a full list of FhirStore fields, see:
    // https://cloud.google.com/healthcare/docs/reference/rest/v1/projects.locations.datasets.fhirStores#FhirStore
    store.setNotificationConfig(new NotificationConfig().setPubsubTopic(pubsubTopic));
    // Create request and configure any parameters.
    FhirStores.Patch request = client.projects().locations().datasets().fhirStores().patch(fhirStoreName, store).setUpdateMask("notificationConfig");
    // Execute the request and process the results.
    store = request.execute();
    System.out.println("Fhir store patched: \n" + store.toPrettyString());
}
Also used : FhirStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores) NotificationConfig(com.google.api.services.healthcare.v1.model.NotificationConfig) FhirStore(com.google.api.services.healthcare.v1.model.FhirStore) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare)

Example 3 with NotificationConfig

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

the class DicomStorePatch method patchDicomStore.

public static void patchDicomStore(String dicomStoreName, String pubsubTopic) throws IOException {
    // String dicomStoreName =
    // String.format(
    // DICOM_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-dicom-id");
    // String pubsubTopic = "projects/your-project-id/topics/your-pubsub-topic";
    // Initialize the client, which will be used to interact with the service.
    CloudHealthcare client = createClient();
    // Fetch the initial state of the DICOM store.
    DicomStores.Get getRequest = client.projects().locations().datasets().dicomStores().get(dicomStoreName);
    DicomStore store = getRequest.execute();
    // Update the DicomStore fields as needed as needed. For a full list of DicomStore fields, see:
    // https://cloud.google.com/healthcare/docs/reference/rest/v1/projects.locations.datasets.dicomStores#DicomStore
    store.setNotificationConfig(new NotificationConfig().setPubsubTopic(pubsubTopic));
    // Create request and configure any parameters.
    DicomStores.Patch request = client.projects().locations().datasets().dicomStores().patch(dicomStoreName, store).setUpdateMask("notificationConfig");
    // Execute the request and process the results.
    store = request.execute();
    System.out.println("DICOM store patched: \n" + store.toPrettyString());
}
Also used : DicomStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.DicomStores) DicomStore(com.google.api.services.healthcare.v1.model.DicomStore) NotificationConfig(com.google.api.services.healthcare.v1.model.NotificationConfig) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare)

Example 4 with NotificationConfig

use of com.google.api.services.healthcare.v1.model.NotificationConfig 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();
}
Also used : NotificationConfig(com.google.api.services.healthcare.v1.model.NotificationConfig) FhirStore(com.google.api.services.healthcare.v1.model.FhirStore)

Example 5 with NotificationConfig

use of com.google.api.services.healthcare.v1.model.NotificationConfig 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();
}
Also used : DicomStore(com.google.api.services.healthcare.v1.model.DicomStore) NotificationConfig(com.google.api.services.healthcare.v1.model.NotificationConfig)

Aggregations

NotificationConfig (com.google.api.services.healthcare.v1.model.NotificationConfig)4 CloudHealthcare (com.google.api.services.healthcare.v1.CloudHealthcare)3 DicomStore (com.google.api.services.healthcare.v1.model.DicomStore)2 FhirStore (com.google.api.services.healthcare.v1.model.FhirStore)2 DicomStores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.DicomStores)1 FhirStores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores)1 Hl7V2Stores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.Hl7V2Stores)1 Hl7V2NotificationConfig (com.google.api.services.healthcare.v1.model.Hl7V2NotificationConfig)1 Hl7V2Store (com.google.api.services.healthcare.v1.model.Hl7V2Store)1 ArrayList (java.util.ArrayList)1