Package google.cloud.healthcare.v1beta1.fhir

Index

FhirStoreService

A service for handling FHIR stores inside a healthcare dataset.

ApplyAdminConsents

rpc ApplyAdminConsents(ApplyAdminConsentsRequest) returns (Operation)

Applies the admin Consent resources for the FHIR store and reindexes the underlying resources in the FHIR store according to the aggregate consents. This method also updates the consent_config.enforced_admin_consents field of the FhirStore unless validate_only=true in ApplyAdminConsentsRequest. Any admin Consent resource change after this operation execution (including deletion) requires you to call ApplyAdminConsents again for the change to take effect.

This method returns an Operation that can be used to track the progress of the resources that were reindexed, by calling GetOperation. Upon completion, the ApplyAdminConsentsResponse additionally contains the number of resources that were reindexed.

If at least one Consent resource contains an error or fails be be enforced for any reason, the method returns an error instead of an Operation. No resources will be reindexed and the consent_config.enforced_admin_consents field will be unchanged.

To enforce a consent check for data access, consent_config.access_enforced must be set to true for the FhirStore.

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.

ApplyConsents

rpc ApplyConsents(ApplyConsentsRequest) returns (Operation)

Apply the Consent resources for the FHIR store and reindex the underlying resources in the FHIR store according to the aggregate consent. The aggregate consent of the patient in scope in this request replaces any previous call of this method. Any Consent resource change after this operation execution (including deletion) requires you to call ApplyConsents again to have effect.

This method returns an Operation that can be used to track the progress of the consent resources that were processed by calling GetOperation. Upon completion, the ApplyConsentsResponse additionally contains the number of resources that was reindexed.

Errors are logged to Cloud Logging (see Viewing error logs in Cloud Logging).

To enforce consent check for data access, consent_config.access_enforced must be set to true for the FhirStore.

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.

ConfigureSearch

rpc ConfigureSearch(ConfigureSearchRequest) returns (Operation)

Configure the search parameters for the FHIR store and reindex resources in the FHIR store according to the defined search parameters. The search parameters provided in this request will replace any previous search configuration.

The target SearchParameter resources need to exist in the store before calling ConfigureSearch, otherwise an error will occur.

This method returns an Operation that can be used to track the progress of the reindexing by calling GetOperation.

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.

CreateFhirStore

rpc CreateFhirStore(CreateFhirStoreRequest) returns (FhirStore)

Creates a new FHIR store within the parent dataset.

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.

DeleteFhirStore

rpc DeleteFhirStore(DeleteFhirStoreRequest) returns (Empty)

Deletes the specified FHIR store and removes all resources within it.

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.

ExportResources

rpc ExportResources(ExportResourcesRequest) returns (Operation)

Export resources from the FHIR store to the specified destination.

This method returns an Operation that can be used to track the status of the export by calling GetOperation.

Immediate fatal errors appear in the error field, errors are also logged to Cloud Logging (see Viewing error logs in Cloud Logging). Otherwise, when the operation finishes, a detailed response of type ExportResourcesResponse is returned in the response field. The metadata field type for this operation is OperationMetadata.

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.

GetFhirStore

rpc GetFhirStore(GetFhirStoreRequest) returns (FhirStore)

Gets the configuration of the specified 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.

GetFhirStoreMetrics

rpc GetFhirStoreMetrics(GetFhirStoreMetricsRequest) returns (FhirStoreMetrics)

Gets metrics associated with the 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.

ImportResources

rpc ImportResources(ImportResourcesRequest) returns (Operation)

Import resources to the FHIR store by loading data from the specified sources. This method is optimized to load large quantities of data using import semantics that ignore some FHIR store configuration options and are not suitable for all use cases. It is primarily intended to load data into an empty FHIR store that is not being used by other clients. In cases where this method is not appropriate, consider using ExecuteBundle to load data.

Every resource in the input must contain a client-supplied ID. Each resource is stored using the supplied ID regardless of the enable_update_create setting on the FHIR store. 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 Cloud Pub/Sub notifications. Those IDs can also be contained in reference fields within other resources.

The import process does not enforce referential integrity, regardless of the disable_referential_integrity setting on the FHIR store. This allows the import of resources with arbitrary interdependencies without considering grouping or ordering, but if the input data contains invalid references or if some resources fail to be imported, the FHIR store might be left in a state that violates referential integrity.

The import process does not trigger Pub/Sub notification or BigQuery streaming update, regardless of how those are configured on the FHIR store.

If a resource with the specified ID already exists, the most recent version of the resource is overwritten without creating a new historical version, regardless of the disable_resource_versioning setting on the FHIR store. If transient failures occur during the import, it is possible that successfully imported resources will be overwritten more than once.

The import operation is idempotent unless the input data contains multiple valid resources with the same ID but different contents. In that case, after the import completes, the store contains exactly one resource with that ID but there is no ordering guarantee on which version of the contents it will have. The operation result counters do not count duplicate IDs as an error and count one success for each resource in the input, which might result in a success count larger than the number of resources in the FHIR store. This often occurs when importing data organized in bundles produced by Patient-everything where each bundle contains its own copy of a resource such as Practitioner that might be referred to by many patients.

If some resources fail to import, for example due to parsing errors, successfully imported resources are not rolled back.

The location and format of the input data are specified by the parameters in ImportResourcesRequest. Note that if no format is specified, this method assumes the BUNDLE format. When using the BUNDLE format this method ignores the Bundle.type field, except that history bundles are rejected, and does not apply any of the bundle processing semantics for batch or transaction bundles. Unlike in ExecuteBundle, transaction bundles are not executed as a single transaction and bundle-internal references are not rewritten. The bundle is treated as a collection of resources to be written as provided in Bundle.entry.resource, ignoring Bundle.entry.request. As an example, this allows the import of searchset bundles produced by a FHIR search or Patient-everything operation.

This method returns an Operation that can be used to track the status of the import by calling GetOperation.

Immediate fatal errors appear in the error field, errors are also logged to Cloud Logging (see Viewing error logs in Cloud Logging). Otherwise, when the operation finishes, a detailed response of type ImportResourcesResponse is returned in the response field. The metadata field type for this operation is OperationMetadata.

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.

ListFhirStores

rpc ListFhirStores(ListFhirStoresRequest) returns (ListFhirStoresResponse)

Lists the FHIR stores in the given dataset.

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.

UpdateFhirStore

rpc UpdateFhirStore(UpdateFhirStoreRequest) returns (FhirStore)

Updates the configuration of the specified 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.

ApplyAdminConsentsErrorDetail

Contains the error details of the unsupported admin Consent resources for when the [ApplyAdminConsents][] method fails to apply one or more Consent resources.

Fields
consent_errors[]

ConsentErrors

The list of Consent resources that are unsupported or cannot be applied and the error associated with each of them.

ConsentErrors

The Consent resource name and error.

Fields
name

string

The versioned name of the admin Consent resource, in the format projects/{project_id}/locations/{location}/datasets/{dataset_id}/fhirStores/{fhir_store_id}/fhir/Consent/{resource_id}/_history/{version_id}. For FHIR stores with disable_resource_versioning=true, the format is projects/{project_id}/locations/{location}/datasets/{dataset_id}/fhirStores/{fhir_store_id}/fhir/Consent/{resource_id}.

error

Status

The error code and message.

ApplyAdminConsentsRequest

Request to apply the admin Consent resources for the specified FHIR store.

Fields
name

string

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

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

  • healthcare.fhirStores.applyConsents
validate_only

bool

If true, the method only validates Consent resources to make sure they are supported. Otherwise, the method applies the aggregate consent information to update the enforcement model and reindex the FHIR resources. If all Consent resources can be applied successfully, the ApplyAdminConsentsResponse is returned containing the following fields: * consent_apply_success to indicate the number of Consent resources applied. * affected_resources to indicate the number of resources that might have had their consent access changed. If, however, one or more Consent resources are unsupported or cannot be applied, the method fails and ApplyAdminConsentsErrorDetail is is returned with details about the unsupported Consent resources.

Union field payload.

payload can be only one of the following:

new_consents_list

AdminConsents

A new list of admin Consent resources to be applied. Any existing enforced Consents, which are specified in consent_config.enforced_admin_consents of the FhirStore, that are not part of this list will be disabled. An empty list is equivalent to clearing or disabling all Consents enforced on the FHIR store. When a FHIR store has disable_resource_versioning=true and this list contains a Consent resource that exists in consent_config.enforced_admin_consents, the method enforces any updates to the existing resource since the last enforcement. If the existing resource hasn't been updated since the last enforcement, the resource is unaffected. After the method finishes, the resulting consent enforcement model is determined by the contents of the Consent resource(s) when the method was called: * When disable_resource_versioning=true, the result is identical to the current resource(s) in the FHIR store. * When disable_resource_versioning=false, the result is based on the historical version(s) of the Consent resource(s) at the point in time when the method was called. At most 200 Consents can be specified.

AdminConsents

List of admin Consent resources to be applied.

Fields
names[]

string

The versioned names of the admin Consent resource(s), in the format projects/{project_id}/locations/{location}/datasets/{dataset_id}/fhirStores/{fhir_store_id}/fhir/Consent/{resource_id}/_history/{version_id}. For FHIR stores with disable_resource_versioning=true, the format is projects/{project_id}/locations/{location}/datasets/{dataset_id}/fhirStores/{fhir_store_id}/fhir/Consent/{resource_id}.

ApplyAdminConsentsResponse

Response when all admin Consent resources in scope were processed and all affected resources were reindexed successfully. This structure will be included in the response when the operation finishes successfully.

Fields
consent_apply_success

int64

If validate_only=false in ApplyAdminConsentsRequest, this counter contains the number of Consent resources that were successfully applied. Otherwise, it is the number of Consent resources that are supported.

affected_resources

int64

The number of resources (including the Consent resources) that may have consent access change.

failed_resources

int64

The number of resources (including the Consent resources) that [ApplyAdminConsents][] failed to re-index.

ApplyConsentsRequest

Request to apply the Consent resources for the specified FHIR store.

Fields
name

string

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

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

  • healthcare.fhirStores.applyConsents
validate_only

bool

Optional. If true, the method only validates Consent resources to make sure they are supported. When the operation completes, ApplyConsentsResponse is returned where consent_apply_success and consent_apply_failure indicate supported and unsupported (or invalid) Consent resources, respectively. Otherwise, the method propagates the aggregate consensual information to the patient's resources. Upon success, affected_resources in the ApplyConsentsResponse indicates the number of resources that may have consensual access changed.

Union field scope.

scope can be only one of the following:

patient_scope

PatientScope

Optional. Scope down to a list of patients.

time_range

TimeRange

Optional. Scope down to patients whose most recent consent changes are in the time range. Can only be used with a versioning store (i.e. when disable_resource_versioning is set to false).

PatientScope

Apply consents given by a list of patients.

Fields
patient_ids[]

string

Optional. The list of patient IDs whose Consent resources will be enforced. At most 10,000 patients can be specified. An empty list is equivalent to all patients (meaning the entire FHIR store).

TimeRange

Apply consents given by patients whose most recent consent changes are in the time range. Note that after identifying these patients, the server applies all Consent resources given by those patients, not just the Consent resources within the timestamp in the range.

Fields
start

string

Optional. The earliest consent change time, in format YYYY-MM-DDThh:mm:ss.sss+zz:zz If not specified, the system uses the FHIR store creation time.

end

string

Optional. The latest consent change time, in format YYYY-MM-DDThh:mm:ss.sss+zz:zz If not specified, the system uses the time when [ApplyConsents][] was called.

ApplyConsentsResponse

Response when all Consent resources in scope were processed and all affected resources were reindexed successfully. This structure is included in the response when the operation finishes successfully.

Fields
consent_apply_success

int64

If validate_only = false in ApplyConsentsRequest, this counter is the number of Consent resources that were successfully applied. Otherwise, it is the number of Consent resources that are supported.

consent_apply_failure

int64

If validate_only = false in ApplyConsentsRequest, this counter is the number of Consent resources that were failed to apply. Otherwise, it is the number of Consent resources that are not supported or invalid.

affected_resources

int64

The number of resources (including the Consent resources) that may have consensual access change.

failed_resources

int64

The number of resources (including the Consent resources) that [ApplyConsents][] failed to re-index.

BigQueryDestination

The configuration for exporting to BigQuery.

Fields
dataset_uri

string

BigQuery URI to an existing dataset, up to 2000 characters long, in the format bq://projectId.bqDatasetId.

schema_config

SchemaConfig

The configuration for the exported BigQuery schema.

force

bool

Use write_disposition instead. If write_disposition is specified, this parameter is ignored. force=false is equivalent to write_disposition=WRITE_EMPTY and force=true is equivalent to write_disposition=WRITE_TRUNCATE.

write_disposition

WriteDisposition

Determines if existing data in the destination dataset is overwritten, appended to, or not written if the tables contain data. If a write_disposition is specified, the force parameter is ignored.

WriteDisposition

The BigQuery WriteDisposition used by the export operation.

Enums
WRITE_DISPOSITION_UNSPECIFIED Default behavior is the same as WRITE_EMPTY.
WRITE_EMPTY Only export data if the destination tables are empty.
WRITE_TRUNCATE Erase all existing data in the destination tables before writing the FHIR resources.
WRITE_APPEND Append data to the destination tables.

ComplexDataTypeReferenceParsing

ComplexDataTypeReferenceParsing defines the parsing behavior of complex FHIR data types.

Enums
COMPLEX_DATA_TYPE_REFERENCE_PARSING_UNSPECIFIED No parsing behavior specified. This is the same as DISABLED for backwards compatibility.
DISABLED References in complex data types are ignored.
ENABLED References in complex data types are parsed.

ConfigureSearchRequest

Request to configure the search parameters for the specified FHIR store.

Fields
name

string

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

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

  • healthcare.fhirStores.configureSearch
canonical_urls[]

string

The canonical URLs of the search parameters that are intended to be used for the FHIR store. See https://www.hl7.org/fhir/references.html#canonical for explanation on FHIR canonical urls

validate_only

bool

If validate_only is set to true, the method will compile all the search parameters without actually setting the search config for the store and triggering the reindex.

ConsentEnforcementVersion

List of consent enforcement versions supported.

Enums
CONSENT_ENFORCEMENT_VERSION_UNSPECIFIED Users must specify an enforcement version or an error is returned.
V1 Enforcement version 1. See the FHIR Consent resources in the Cloud Healthcare API guide for more details.

CreateFhirStoreRequest

Creates a new FHIR store.

Fields
parent

string

The name of the dataset this FHIR store belongs to.

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

  • healthcare.fhirStores.create
fhir_store_id

string

The ID of the FHIR store that is being created. The string must match the following regex: [\p{L}\p{N}_\-\.]{1,256}.

fhir_store

FhirStore

Configuration info for this FHIR store.

DeleteFhirStoreRequest

Deletes the specified FHIR store.

Fields
name

string

The resource name of the FHIR store to delete.

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

  • healthcare.fhirStores.delete

ExportResourcesRequest

Request to export resources.

Fields
name

string

The name of the FHIR store to export resource from, in the format of projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}.

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

  • healthcare.fhirStores.export
since

string

If provided, only resources updated after this time are exported. 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 exported.

Union field destination. The output destination of the export.

To enable the Cloud Healthcare API to write to resources in your project such as Cloud Storage buckets, you must grant the Healthcare Service Agent account the required permissions. For steps to assign the permissions, see Importing data from Cloud Storage. destination can be only one of the following:

gcs_destination

GcsDestination

The Cloud Storage output destination.

The Cloud Healthcare Service Agent requires the roles/storage.objectAdmin Cloud IAM roles on the Cloud Storage location.

The exported outputs are organized by FHIR resource types. The server creates one object per resource type. Each object contains newline delimited JSON, and each line is a FHIR resource.

bigquery_destination

BigQueryDestination

The BigQuery output destination.

The Cloud Healthcare Service Agent requires two IAM roles on the BigQuery location: roles/bigquery.dataEditor and roles/bigquery.jobUser.

The output is one BigQuery table per resource type.

Unlike when setting BigQueryDestination for StreamConfig, ExportResources does not create BigQuery views.

ExportResourcesResponse

This type has no fields.

Response when all resources export successfully. This structure is included in the response to describe the detailed outcome after the operation finishes successfully.

FhirStore

Represents a FHIR store.

Fields
name

string

Output only. Resource name of the FHIR store, of the form projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}.

enable_update_create

bool

Whether this FHIR store has the updateCreate capability. This determines if the client can use an Update operation to create a new resource with a client-specified ID. If false, all IDs are server-assigned through the Create operation and attempts to update a non-existent resource return errors. 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.

notification_config
(deprecated)

NotificationConfig

Deprecated. Use notification_configs instead. If non-empty, publish all resource modifications of this FHIR store to this destination. The Pub/Sub message attributes contain a map with a string describing the action that has triggered the notification. For example, "action":"CreateResource".

disable_referential_integrity

bool

Immutable. Whether to disable referential integrity in this FHIR store. This field is immutable after FHIR store creation. The default value is false, meaning that the API enforces referential integrity and fails the requests that result in inconsistent state in the FHIR store. When this field is set to true, the API skips referential integrity checks. Consequently, operations that rely on references, such as GetPatientEverything, do not return all the results if broken references exist.

disable_resource_versioning

bool

Immutable. Whether to disable resource versioning for this FHIR store. This field can not be changed after the creation of FHIR store. If set to false, which is the default behavior, all write operations cause historical versions to be recorded automatically. The historical versions can be fetched through the history APIs, but cannot be updated. If set to true, no historical versions are kept. The server sends errors for attempts to read the historical versions.

labels

map<string, string>

User-supplied key-value pairs used to organize FHIR stores.

Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}

Label values are optional, must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}

No more than 64 labels can be associated with a given store.

version

Version

Immutable. The FHIR specification version that this FHIR store supports natively. This field is immutable after store creation. Requests are rejected if they contain FHIR resources of a different version. Version is required for every FHIR store.

stream_configs[]

StreamConfig

A list of streaming configs that configure the destinations of streaming export for every resource mutation in this FHIR store. Each store is allowed to have up to 10 streaming configs. After a new config is added, the next resource mutation is streamed to the new location in addition to the existing ones. When a location is removed from the list, the server stops streaming to that location. Before adding a new config, you must add the required bigquery.dataEditor role to your project's Cloud Healthcare Service Agent service account. Some lag (typically on the order of dozens of seconds) is expected before the results show up in the streaming destination.

validation_config

ValidationConfig

Configuration for how to validate incoming FHIR resources against configured profiles.

default_search_handling_strict

bool

If true, overrides the default search behavior for this FHIR store to handling=strict which returns an error for unrecognized search parameters. If false, uses the FHIR specification default handling=lenient which ignores unrecognized search parameters. The handling can always be changed from the default on an individual API call by setting the HTTP header Prefer: handling=strict or Prefer: handling=lenient.

search_config

SearchConfig

Configuration for how FHIR resources can be searched.

notification_configs[]

FhirNotificationConfig

Specifies where and whether to send notifications upon changes to a Fhir store.