Method: fhirStores.applyConsents

Full name: projects.locations.datasets.fhirStores.applyConsents

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 fhirStores.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 operations.get. 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, consentConfig.access_enforced must be set to true for the FhirStore.

HTTP request

POST https://healthcare.googleapis.com/v1/{name=projects/*/locations/*/datasets/*/fhirStores/*}:applyConsents

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The name of the FHIR store to enforce, in the format projects/{projectId}/locations/{locationId}/datasets/{datasetId}/fhirStores/{fhirStoreId}.

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

  • healthcare.fhirStores.applyConsents

Request body

The request body contains data with the following structure:

JSON representation
{
  "validateOnly": boolean,

  // Union field scope can be only one of the following:
  "patientScope": {
    object(PatientScope)
  },
  "timeRange": {
    object(TimeRange)
  }
  // End of list of possible types for union field scope.
}
Fields
validateOnly

boolean

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

Union field scope. Scope down to one of the following: a list of patients, a time range, or a consent enforcement version. scope can be only one of the following:
patientScope

object(PatientScope)

Optional. Scope down to a list of patients.

timeRange

object(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 disableResourceVersioning is set to false).

Response body

If successful, the response body contains an instance of Operation.

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.

PatientScope

Apply consents given by a list of patients.

JSON representation
{
  "patientIds": [
    string
  ]
}
Fields
patientIds[]

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.

JSON representation
{
  "start": string,
  "end": string
}
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 [fhirStores.applyConsents][] was called.