Search in sources :

Example 1 with FhirStores

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

Example 2 with FhirStores

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

Example 3 with FhirStores

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

Example 4 with FhirStores

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores in project java-docs-samples by GoogleCloudPlatform.

the class FhirStoreList method fhirStoreList.

public static void fhirStoreList(String datasetName) throws IOException {
    // String datasetName =
    // String.format(DATASET_NAME, "your-project-id", "your-region-id", "your-dataset-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;
    List<FhirStore> stores = new ArrayList<>();
    do {
        // Create request and configure any parameters.
        FhirStores.List request = client.projects().locations().datasets().fhirStores().list(datasetName).setPageSize(// Specify pageSize up to 1000
        100).setPageToken(pageToken);
        // Execute response and collect results.
        ListFhirStoresResponse response = request.execute();
        stores.addAll(response.getFhirStores());
        // Update the page token for the next request.
        pageToken = response.getNextPageToken();
    } while (pageToken != null);
    // Print results.
    System.out.printf("Retrieved %s Fhir stores: \n", stores.size());
    for (FhirStore data : stores) {
        System.out.println("\t" + data.toPrettyString());
    }
}
Also used : FhirStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores) ArrayList(java.util.ArrayList) FhirStore(com.google.api.services.healthcare.v1.model.FhirStore) ListFhirStoresResponse(com.google.api.services.healthcare.v1.model.ListFhirStoresResponse) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare)

Example 5 with FhirStores

use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores in project java-docs-samples by GoogleCloudPlatform.

the class FhirStoreSetIamPolicy method fhirStoreSetIamPolicy.

public static void fhirStoreSetIamPolicy(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();
    // Configure the IAMPolicy to apply to the store.
    // For more information on understanding IAM roles, see the following:
    // https://cloud.google.com/iam/docs/understanding-roles
    Binding binding = new Binding().setRole("roles/healthcare.fhirResourceReader").setMembers(Arrays.asList("domain:google.com"));
    Policy policy = new Policy().setBindings(Arrays.asList(binding));
    SetIamPolicyRequest policyRequest = new SetIamPolicyRequest().setPolicy(policy);
    // Create request and configure any parameters.
    FhirStores.SetIamPolicy request = client.projects().locations().datasets().fhirStores().setIamPolicy(fhirStoreName, policyRequest);
    // Execute the request and process the results.
    Policy updatedPolicy = request.execute();
    System.out.println("FHIR policy has been updated: " + updatedPolicy.toPrettyString());
}
Also used : Binding(com.google.api.services.healthcare.v1.model.Binding) Policy(com.google.api.services.healthcare.v1.model.Policy) FhirStores(com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores) SetIamPolicyRequest(com.google.api.services.healthcare.v1.model.SetIamPolicyRequest) CloudHealthcare(com.google.api.services.healthcare.v1.CloudHealthcare)

Aggregations

CloudHealthcare (com.google.api.services.healthcare.v1.CloudHealthcare)11 FhirStores (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores)9 FhirStore (com.google.api.services.healthcare.v1.model.FhirStore)6 Search (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores.Fhir.Search)2 ExportResourcesRequest (com.google.api.services.healthcare.v1.model.ExportResourcesRequest)2 GoogleCloudHealthcareV1FhirGcsDestination (com.google.api.services.healthcare.v1.model.GoogleCloudHealthcareV1FhirGcsDestination)2 GoogleCloudHealthcareV1FhirGcsSource (com.google.api.services.healthcare.v1.model.GoogleCloudHealthcareV1FhirGcsSource)2 HttpBody (com.google.api.services.healthcare.v1.model.HttpBody)2 ImportResourcesRequest (com.google.api.services.healthcare.v1.model.ImportResourcesRequest)2 ListFhirStoresResponse (com.google.api.services.healthcare.v1.model.ListFhirStoresResponse)2 NotificationConfig (com.google.api.services.healthcare.v1.model.NotificationConfig)2 Operation (com.google.api.services.healthcare.v1.model.Operation)2 Policy (com.google.api.services.healthcare.v1.model.Policy)2 SearchResourcesRequest (com.google.api.services.healthcare.v1.model.SearchResourcesRequest)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Capabilities (com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores.Fhir.Capabilities)1 Binding (com.google.api.services.healthcare.v1.model.Binding)1 DeidentifyConfig (com.google.api.services.healthcare.v1.model.DeidentifyConfig)1 DeidentifyFhirStoreRequest (com.google.api.services.healthcare.v1.model.DeidentifyFhirStoreRequest)1