use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project beam by apache.
the class HttpHealthcareApiClient method importFhirResource.
@Override
public Operation importFhirResource(String fhirStore, String gcsSourcePath, @Nullable String contentStructure) throws IOException {
GoogleCloudHealthcareV1FhirGcsSource gcsSrc = new GoogleCloudHealthcareV1FhirGcsSource();
gcsSrc.setUri(gcsSourcePath);
ImportResourcesRequest importRequest = new ImportResourcesRequest();
importRequest.setGcsSource(gcsSrc).setContentStructure(contentStructure);
return client.projects().locations().datasets().fhirStores().healthcareImport(fhirStore, importRequest).execute();
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project beam by apache.
the class HttpHealthcareApiClient method searchFhirResource.
@Override
public HttpBody searchFhirResource(String fhirStore, String resourceType, @Nullable Map<String, Object> parameters, String pageToken) throws IOException {
SearchResourcesRequest request = new SearchResourcesRequest().setResourceType(resourceType);
Search search = client.projects().locations().datasets().fhirStores().fhir().search(fhirStore, request);
if (parameters != null && !parameters.isEmpty()) {
parameters.forEach(search::set);
}
if (pageToken != null && !pageToken.isEmpty()) {
search.set("_page_token", URLDecoder.decode(pageToken, "UTF-8"));
}
return search.execute();
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project beam by apache.
the class HttpHealthcareApiClient method deidentifyFhirStore.
@Override
public Operation deidentifyFhirStore(String sourcefhirStore, String destinationFhirStore, DeidentifyConfig deidConfig) throws IOException {
DeidentifyFhirStoreRequest deidRequest = new DeidentifyFhirStoreRequest();
deidRequest.setDestinationStore(destinationFhirStore);
deidRequest.setConfig(deidConfig);
return client.projects().locations().datasets().fhirStores().deidentify(sourcefhirStore, deidRequest).execute();
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.
the class HL7v2MessageIngest method hl7v2MessageIngest.
public static void hl7v2MessageIngest(String hl7v2StoreName, String filePath) 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();
// Load the data from file and format it into an ingest request.
List<String> lines = Files.readAllLines(Paths.get(filePath), Charset.defaultCharset());
String data = String.join("\n", lines);
Message message = new Message().setData(data);
IngestMessageRequest ingestRequest = new IngestMessageRequest().setMessage(message);
// Create request and configure any parameters.
Messages.Ingest request = client.projects().locations().datasets().hl7V2Stores().messages().ingest(hl7v2StoreName, ingestRequest);
// Execute the request and process the results.
IngestMessageResponse response = request.execute();
System.out.println("HL7v2 message ingested: " + response.toPrettyString());
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.
the class HL7v2MessagePatch method hl7v2MessagePatch.
public static void hl7v2MessagePatch(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();
// Fetch the initial state of the message.
Messages.Get getRequest = client.projects().locations().datasets().hl7V2Stores().messages().get(hl7v2MessageName);
Message message = getRequest.execute();
// Update the Message fields as needed as needed. For a full list of Message fields, see:
// https://cloud.google.com/healthcare/docs/reference/rest/v1/projects.locations.datasets.hl7V2Stores.messages
Map<String, String> labels = new HashMap<>();
labels.put("key1", "value1");
labels.put("key2", "value2");
message.setLabels(labels);
// Create request and configure any parameters.
Messages.Patch request = client.projects().locations().datasets().hl7V2Stores().messages().patch(hl7v2MessageName, message).setUpdateMask("labels");
// Execute the request and process the results.
message = request.execute();
System.out.println("HL7v2 message patched: \n" + message.toPrettyString());
}
Aggregations