use of com.google.api.services.healthcare.v1.model.Dataset in project java-docs-samples by GoogleCloudPlatform.
the class DicomWebStoreInstance method dicomWebStoreInstance.
public static void dicomWebStoreInstance(String dicomStoreName, String filePath) throws IOException, URISyntaxException {
// String dicomStoreName =
// String.format(
// DICOM_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-dicom-id");
// String filePath = "path/to/file.dcm";
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
HttpClient httpClient = HttpClients.createDefault();
String uri = String.format("%sv1/%s/dicomWeb/studies", client.getRootUrl(), dicomStoreName);
URIBuilder uriBuilder = new URIBuilder(uri).setParameter("access_token", getAccessToken());
// Load the data from file representing the study.
File f = new File(filePath);
byte[] dicomBytes = Files.readAllBytes(Paths.get(filePath));
ByteArrayEntity requestEntity = new ByteArrayEntity(dicomBytes);
HttpUriRequest request = RequestBuilder.post(uriBuilder.build()).setEntity(requestEntity).addHeader("Content-Type", "application/dicom").build();
// Execute the request and process the results.
HttpResponse response = httpClient.execute(request);
HttpEntity responseEntity = response.getEntity();
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
System.err.print(String.format("Exception storing DICOM instance: %s\n", response.getStatusLine().toString()));
responseEntity.writeTo(System.err);
throw new RuntimeException();
}
System.out.println("DICOM instance stored: ");
responseEntity.writeTo(System.out);
}
use of com.google.api.services.healthcare.v1.model.Dataset in project java-docs-samples by GoogleCloudPlatform.
the class FhirStoreDelete method fhirStoreDelete.
public static void fhirStoreDelete(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.Delete request = client.projects().locations().datasets().fhirStores().delete(fhirStoreName);
// Execute the request and process the results.
request.execute();
System.out.println("FHIR store deleted.");
}
use of com.google.api.services.healthcare.v1.model.Dataset 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.Dataset in project java-docs-samples by GoogleCloudPlatform.
the class FhirStoreGetIamPolicy method fhirStoreGetIamPolicy.
public static void fhirStoreGetIamPolicy(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.GetIamPolicy request = client.projects().locations().datasets().fhirStores().getIamPolicy(fhirStoreName);
// Execute the request and process the results.
Policy policy = request.execute();
System.out.println("FHIR store IAMPolicy retrieved: \n" + policy.toPrettyString());
}
use of com.google.api.services.healthcare.v1.model.Dataset in project java-docs-samples by GoogleCloudPlatform.
the class FhirStoreGetMetadata method fhirStoreGetMetadata.
public static void fhirStoreGetMetadata(String fhirStoreName) throws IOException {
// String fhirStoreName =
// String.format(
// FHIR_NAME, "project-id", "region-id", "dataset-id", "store-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Create request and configure any parameters.
Capabilities request = client.projects().locations().datasets().fhirStores().fhir().capabilities(fhirStoreName);
// Execute the request and process the results.
HttpBody response = request.execute();
System.out.println("FHIR store metadata retrieved: " + response.toPrettyString());
}
Aggregations