applyConsents method
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.
request
- The metadata request object.
Request parameters:
name
- 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}
.
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/datasets/\[^/\]+/fhirStores/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Operation.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<Operation> applyConsents(
ApplyConsentsRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':applyConsents';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}