Search in sources :

Example 51 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project beam by apache.

the class HttpHealthcareApiClient method ingestHL7v2Message.

@Override
public IngestMessageResponse ingestHL7v2Message(String hl7v2Store, Message msg) throws IOException {
    IngestMessageRequest ingestMessageRequest = new IngestMessageRequest();
    ingestMessageRequest.setMessage(msg);
    return client.projects().locations().datasets().hl7V2Stores().messages().ingest(hl7v2Store, ingestMessageRequest).execute();
}
Also used : IngestMessageRequest(com.google.api.services.healthcare.v1.model.IngestMessageRequest)

Example 52 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets 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();
}
Also used : ExportResourcesRequest(com.google.api.services.healthcare.v1.model.ExportResourcesRequest) GoogleCloudHealthcareV1FhirGcsDestination(com.google.api.services.healthcare.v1.model.GoogleCloudHealthcareV1FhirGcsDestination)

Example 53 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets 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 54 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project beam by apache.

the class HttpHealthcareApiClient method getEarliestHL7v2SendTime.

@Override
public Instant getEarliestHL7v2SendTime(String hl7v2Store, @Nullable String filter) throws IOException {
    ListMessagesResponse response = client.projects().locations().datasets().hl7V2Stores().messages().list(hl7v2Store).setFilter(filter).set("view", // needed to retrieve the value for sendtime
    "full").setOrderBy(// default order is ascending
    "sendTime").setPageSize(// Only interested in the earliest sendTime
    1).execute();
    if (response.isEmpty()) {
        throw new IllegalArgumentException(String.format("Could not find earliest send time. The filter %s  matched no results on " + "HL7v2 Store: %s", filter, hl7v2Store));
    }
    String sendTime = response.getHl7V2Messages().get(0).getSendTime();
    if (Strings.isNullOrEmpty(sendTime)) {
        LOG.warn(String.format("Earliest message in %s has null or empty sendTime defaulting to Epoch.", hl7v2Store));
        return Instant.ofEpochMilli(0);
    }
    // https://cloud.google.com/healthcare/docs/reference/rest/v1/projects.locations.datasets.hl7V2Stores.messages#Message
    return Instant.parse(sendTime);
}
Also used : ListMessagesResponse(com.google.api.services.healthcare.v1.model.ListMessagesResponse)

Example 55 with Datasets

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets 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

CloudHealthcare (com.google.api.services.healthcare.v1.CloudHealthcare)46 DicomStores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.DicomStores)11 FhirStores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores)9 Datasets (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets)8 Policy (com.google.api.services.healthcare.v1.model.Policy)8 Hl7V2Stores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.Hl7V2Stores)7 FhirStore (com.google.api.services.healthcare.v1.model.FhirStore)6 Message (com.google.api.services.healthcare.v1.model.Message)6 Operation (com.google.api.services.healthcare.v1.model.Operation)6 IOException (java.io.IOException)6 ArrayList (java.util.ArrayList)6 HttpResponse (com.google.api.client.http.HttpResponse)5 Messages (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.Hl7V2Stores.Messages)5 DicomStore (com.google.api.services.healthcare.v1.model.DicomStore)5 Binding (com.google.api.services.healthcare.v1.model.Binding)4 Dataset (com.google.api.services.healthcare.v1.model.Dataset)4 Hl7V2Store (com.google.api.services.healthcare.v1.model.Hl7V2Store)4 NotificationConfig (com.google.api.services.healthcare.v1.model.NotificationConfig)4 SetIamPolicyRequest (com.google.api.services.healthcare.v1.model.SetIamPolicyRequest)4 HashMap (java.util.HashMap)4