Package google.cloud.healthcare.v1beta1.fhir.stu3.grpc

Index

FhirService

gRPC service for handling FHIR resources in a FHIR store inside a healthcare dataset.

This service supports FHIR STU3 resources in the protocol buffer format as shown in https://github.com/google/fhir.

The API methods in this service are a gRPC adaptation of the FHIR REST API, and are not part of the FHIR specification. Not all of the methods in the REST API have been implemented. All gRPC and REST methods may be used interchangeably on the same FHIR store.

ConditionalDeleteResource

rpc ConditionalDeleteResource(ConditionalDeleteResourceRequest) returns (Empty)

Deletes FHIR resources that match a search query.

Implements a gRPC adaptation of the FHIR standard conditional delete interaction. If multiple resources match, all matching resources are deleted.

Search terms are provided in the request following the same pattern as the SearchResources method.

Not all FHIR resources that match the search query might be deleted because, by default, a maximum of 100 FHIR resources can be deleted. The number of FHIR resources that can be deleted depends on the page size of the returned resources, which you can control using the _count query parameter. Even when using _count, you can delete a maximum 1,000 FHIR resources per each call of this method.

Note: Unless resource versioning is disabled by setting the disable_resource_versioning flag on the FHIR store, the deleted resources are moved to a history repository that can still be retrieved through GetResourceVersion and related methods, unless they are removed by the DeleteResourceVersions method.

This method requires thehealthcare.fhirStores.searchResources and healthcare.fhirResources.delete permissions on the parent FHIR store.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ConditionalUpdateResource

rpc ConditionalUpdateResource(ConditionalUpdateResourceRequest) returns (ContainedResource)

If a resource is found based on the search criteria specified in the request, updates the entire contents of that resource.

Implements a gRPC adaptation of the FHIR standard conditional update interaction.

Search terms are provided in the request following the same pattern as the SearchResources method.

If the search criteria identify more than one match, the request returns a FailedPrecondition error. If the search criteria identify zero matches, and the supplied resource body contains an id, and the FHIR store has enable_update_create set, creates the resource with the client-specified ID. It is strongly advised not to include or encode any sensitive data such as patient identifiers in client-specified resource IDs. Those IDs are part of the FHIR resource path recorded in Cloud Audit Logs and Pub/Sub notifications. Those IDs can also be contained in reference fields within other resources. If the search criteria identify zero matches, and the supplied resource body does not contain an id, the resource is created with a server-assigned ID as per the CreateResource method.

On success, the response is a ContainedResource representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store contain an OperationOutcome resource as an error detail describing the reason for the error.

This method requires thehealthcare.fhirStores.searchResources and healthcare.fhirResources.update permissions on the parent FHIR store.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateResource

rpc CreateResource(CreateResourceRequest) returns (ContainedResource)

Creates a FHIR resource.

Implements a gRPC adaptation of the FHIR standard create interaction, which creates a new resource with a server-assigned resource ID.

Also supports the FHIR standard conditional create interaction, specified by supplying an If-None-Exist key with a value containing a FHIR search query in the gRPC metadata. If no resources match this search query, the server processes the create operation as normal.

On success, the response is a ContainedResource representation of the resource as it was created on the server, including the server-assigned resource ID and version ID. Errors generated by the FHIR store contain an OperationOutcome resource as an error detail describing the reason for the error.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteResource

rpc DeleteResource(DeleteResourceRequest) returns (Empty)

Deletes a FHIR resource.

Implements a gRPC adaptation of the FHIR standard delete interaction.

Note: Unless resource versioning is disabled by setting the disable_resource_versioning flag on the FHIR store, the deleted resources are moved to a history repository that can still be retrieved through GetResourceVersion and related methods, unless they are removed by the DeleteResourceVersions method.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ExecuteBundle

rpc ExecuteBundle(ExecuteBundleRequest) returns (ContainedResource)

Executes all the requests in the given Bundle.

Implements a gRPC adaptation of the FHIR standard batch/transaction interaction.

Supports all interactions within a bundle, except search. This method accepts Bundles of type batch and transaction, processing them according to the batch processing rules and transaction processing rules.

For a batch bundle or a successful transaction the response is a ContainedResource representation of a Bundle resource of type batch-response or transaction-response containing one entry for each entry in the request, with the outcome of processing the entry. Errors for a transaction bundle contain an OperationOutcome resource as an error detail describing the reason for the error.

This method checks permissions for each request in the bundle. The executeBundle permission is required to call this method, but you must also grant sufficient permissions to execute the individual requests in the bundle. For example, if the bundle contains a request to create a FHIR resource, the caller must also have been granted the healthcare.fhirResources.create permission.

You can use audit logs to view the permissions for executeBundle and each request in the bundle. For more information, see Viewing Cloud Audit logs.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetLastNObservations

rpc GetLastNObservations(GetLastNObservationsRequest) returns (ContainedResource)

Retrieves the N most recent Observation resources for a subject matching search criteria specified in the request, grouped by Observation.code, sorted from most recent to oldest.

Implements a gRPC adaptation of the FHIR extended operation Observation-lastn.

Search terms are provided as query parameters following the same pattern as the search method. The following search parameters must be provided:

- `subject` or `patient` to specify a subject for the Observation.
- `code`, `category` or any of the composite parameters that include
  `code`.

Any other valid Observation search parameters can also be provided. This operation accepts an additional query parameter max, which specifies N, the maximum number of Observations to return from each group, with a default of 1.

Searches with over 1000 results are rejected. Results are counted before grouping and limiting the results with max. To stay within the limit, constrain these searches using Observation search parameters such as _lastUpdated or date.

On success, the response body contains a ContainedResource representation of a Bundle resource of type searchset, containing the results of the operation. Errors generated by the FHIR store contain an OperationOutcome resource as an error detail describing the reason for the error.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetPatientEverything

rpc GetPatientEverything(GetPatientEverythingRequest) returns (ContainedResource)

Retrieves a Patient resource and resources related to that patient.

Implements a gRPC adaptation of the FHIR extended operation Patient-everything (STU3).

On success, the response body contains a ContainedResource representation of a Bundle resource of type searchset, containing the results of the operation. Errors generated by the FHIR store contain an OperationOutcome resource as an error detail describing the reason for the error.

The resources in scope for the response are:

  • The patient resource itself.
  • All the resources directly referenced by the patient resource.
  • Resources directly referencing the patient resource that meet the inclusion criteria. The inclusion criteria are based on the membership rules in the patient compartment definition (DSTU2, STU3, R4), which details the eligible resource types and referencing search parameters.
Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetResource

rpc GetResource(GetResourceRequest) returns (ContainedResource)

Gets the contents of a FHIR resource.

Implements a gRPC adaptation of the FHIR standard read interaction.

Also supports the FHIR standard conditional read interaction specified by supplying an If-Modified-Since key with a date/time value or an If-None-Match key with an ETag value in the gRPC metadata.

On success, the response is a ContainedResource representation of the resource. Errors generated by the FHIR store contain an OperationOutcome resource as an error detail describing the reason for the error.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetResourceVersion

rpc GetResourceVersion(GetResourceVersionRequest) returns (ContainedResource)

Gets the contents of a version (current or historical) of a FHIR resource by version ID.

Implements a gRPC adaptation of the FHIR standard vread interaction.

On success, the response is a ContainedResource representation of the resource. Errors generated by the FHIR store contain an OperationOutcome resource as an error detail describing the reason for the error.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

SearchResources

rpc SearchResources(SearchResourcesRequest) returns (ContainedResource)

Searches for resources in the given FHIR store according to criteria specified in the request.

Implements a gRPC adaptation of the FHIR standard search interaction using the search semantics described in the FHIR Search specification.

On success, the response body contains a ContainedResource representation of a Bundle resource of type searchset, containing the results of the search. Errors generated by the FHIR store contain an OperationOutcome resource as an error detail describing the reason for the error.

The server's capability statement, retrieved through GetCapabilityStatement, indicates the search parameters that are supported on each FHIR resource. For the list of search parameters for STU3, see the STU3 FHIR Search Parameter Registry.

Supported search modifiers: :missing, :exact, :contains, :text, :in, :not-in, :above, :below, :[type], :not, and :recurse.

Supported search result parameters: _sort, _count, _include, _revinclude, _summary=text, _summary=data, and _elements.

The maximum number of search results returned defaults to 100, which can be overridden by the _count parameter up to a maximum limit of 1000. The server might return fewer resources than requested to prevent excessively large responses. If there are additional results, the returned Bundle contains a link of relation "next", which has a _page_token parameter for an opaque pagination token that can be used to retrieve the next page.

Resources with a total size larger than 5MB or a field count larger than 50,000 might not be fully searchable as the server might trim its generated search index in those cases.

Note: FHIR resources are indexed asynchronously, so there might be a slight delay between the time a resource is created or changed, and the time when the change reflects in search results. The only exception is resource identifier data, which is indexed synchronously as a special index. As a result, searching using resource identifier is not subject to indexing delay. To use the special synchronous index, the search term for identifier should be in the pattern identifier=[system]|[value] or identifier=[value], and any of the following search result parameters can be used:

  • _count
  • _include
  • _revinclude
  • _summary
  • _elements

If your query contains any other search parameters, the standard asynchronous index will be used instead. Note that searching against the special index is optimized for resolving a small number of matches. The search isn't optimized if your identifier search criteria matches a large number (i.e. more than 2,000) of resources. For a search query that will match a large number of resources, you can avoiding using the special synchronous index by including an additional _sort parameter in your query. Use _sort=-_lastUpdated if you want to keep the default sorting order. Note: The special synchronous identifier index are currently disabled for DocumentReference and DocumentManifest searches.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateResource

rpc UpdateResource(UpdateResourceRequest) returns (ContainedResource)

Updates the entire contents of a resource.

Implements a gRPC adaptation ofthe FHIR standard update interaction.

If the specified resource does not exist and the FHIR store has enable_update_create set, creates the resource with the client-specified ID. It is strongly advised not to include or encode any sensitive data such as patient identifiers in client-specified resource IDs. Those IDs are part of the FHIR resource path recorded in Cloud Audit Logs and Pub/Sub notifications. Those IDs can also be contained in reference fields within other resources.

On success, the response is a ContainedResource representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store contain an OperationOutcome resource as an error detail describing the reason for the error.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ValidateResource

rpc ValidateResource(ValidateResourceRequest) returns (ContainedResource)

Validates a FHIR resource's conformance to its profiles and the profiles configured on the FHIR store.

Implements the FHIR extended operation $validate (DSTU2, STU3, or R4).

The request body must contain a JSON-encoded FHIR resource, and the request headers must contain Content-Type: application/fhir+json. The Parameters input syntax is not supported.

The profile query parameter can be used to request that the resource only be validated against a specific profile. If a profile with the given URL cannot be found in the FHIR store then an error will be returned.

Errors generated by validation contain a JSON-encoded OperationOutcome resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ConditionalDeleteResourceRequest

Deletes a resource from the specified FHIR store that matches the conditions.

Fields
parent

string

The name of the FHIR store, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.fhirResources.delete
type

string

The FHIR resource type to delete, such as Patient or Observation. For a complete list, see the FHIR Resource Index.

conditions[]

SearchParameter

The search conditions identifying the resource to delete, in the form of a list of key-value pairs.

ConditionalUpdateResourceRequest

Request to update the contents of a resource found by search criteria.

Fields
parent

string

The name of the FHIR store, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.fhirResources.update
type

string

The FHIR resource type to update, such as Patient or Observation. For a complete list, see the FHIR Resource Index. Must match the resource type in the provided content.

resource

ContainedResource

The updated contents of the resource to store.

conditions[]

SearchParameter

The search conditions identifying the resource to update, in the form of a list of key-value pairs.

CreateResourceRequest

Request to create a resource.

Fields
parent

string

The name of the FHIR store, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.fhirResources.create
type

string

The FHIR resource type to create, such as Patient or Observation. For a complete list, see the FHIR Resource Index. Must match the resource type in the provided content.

resource

ContainedResource

Contents of the resource to be created.

DeleteResourceRequest

Deletes a resource from the specified FHIR store.

Fields
name

string

The name of the resource to delete, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}/fhir/{resource_type}/{resource_id}.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.fhirResources.delete

ExecuteBundleRequest

Request to execute all included operations in a Bundle.

Fields
parent

string

The name of the FHIR store in which this bundle will be executed, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.fhirResources.executeBundle
bundle

ContainedResource

The bundle to execute.

GetLastNObservationsRequest

Get N most recent observations for the subject matching the criteria, grouped by code.

Fields
parent

string

The name of the FHIR store, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.fhirResources.search
conditions[]

SearchParameter

The search conditions identifying the subject, in the form of a list of key-value pairs.

GetPatientEverythingRequest

Request all the information related to the patient.

Fields
name

string

The name of the patient for which the information is required, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}/fhir/Patient/{resource_id}.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.fhirResources.get
start

string

The response includes records subsequent to the start date. The date uses the format YYYY-MM-DD. If no start date is provided, all records prior to the end date are in scope.

end

string

The response includes records prior to the end date. The date uses the format YYYY-MM-DD. If no end date is provided, all records subsequent to the start date are in scope.

page_token

string

Used to retrieve the next or previous page of results when using pagination. Value should be set to the value of page_token set in next or previous page links' URLs. Next and previous page are returned in the response bundle's links field, where link.relation is "previous" or "next".

Omit page_token if no previous request has been made.

count

int32

Maximum number of resources in a page. If not specified, 100 is used. May not be larger than 1000.

since

string

If provided, only resources updated after this time are returned. The time uses the format YYYY-MM-DDThh:mm:ss.sss+zz:zz. For example, 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z. The time must be specified to the second and include a time zone.

type

string

String of comma-delimited FHIR resource types. If provided, only resources of the specified resource type(s) are returned. Specifying multiple _type parameters isn't supported. For example, the result of _type=Observation&_type=Encounter is undefined. Use _type=Observation,Encounter instead.

GetResourceRequest

Gets a resource from the specified FHIR store.

Fields
name

string

The name of the resource to retrieve, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}/fhir/{resource_type}/{resource_id}.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.fhirResources.get

GetResourceVersionRequest

Gets a specific version of a resource from the specified FHIR store.

Fields
name

string

The name of the resource version to retrieve, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}/fhir/{resource_type}/{resource_id}/_history/{version_id}.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.fhirResources.get

SearchParameter

Represents a search parameter or condition that would normally be passed as a query parameter in the REST API.

Fields
key

string

Name of the parameter. It should be unique. If multiple values are required for the same name, they can be passed using a Value array within a single SearchParameter.

value[]

string

Array of values for the given key.

SearchResourcesRequest

Request to search the resources in the specified FHIR store.

Fields
parent

string

The name of the FHIR store, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.fhirStores.searchResources
resource_type

string

The FHIR resource type to search, such as Patient or Observation. For a complete list, see the FHIR Resource Index. Can be empty, which is equivalent to issuing a REST search against the FHIR store base URL.

params[]

SearchParameter

The search parameters in the form of a list of key-value pairs.

UpdateResourceRequest

Request to update the contents of a resource.

Fields
name

string

The name of the resource to update, in the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}/fhir/{resource_type}/{resource_id}.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.fhirResources.update
resource

ContainedResource

The updated contents of the resource to store. The resource type and ID must match those provided in the name.

ValidateResourceRequest

The request to validate a resource against the profiles in a FHIR store.

Fields
parent

string

The name of the FHIR store that holds the profiles being used for validation.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.fhirResources.get
type

string

The FHIR resource type of the resource being validated. For a complete list, see the FHIR Resource Index. Must match the resource type in the provided content.

profile

string

A profile that this resource should be validated against.

resource

ContainedResource

Raw body of the request.