conditionalDelete method

Future<Empty> conditionalDelete(
  1. String parent,
  2. String type, {
  3. String? $fields,
})

Deletes a FHIR resource that match an identifier search query.

Implements the FHIR standard conditional delete interaction, limited to searching by resource identifier. If multiple resources match, 412 Precondition Failed error will be returned. Search term for identifier should be in the pattern identifier=system|value or identifier=value - similar to the search method on resources with a specific identifier. Note: Unless resource versioning is disabled by setting the disable_resource_versioning flag on the FHIR store, the deleted resource is moved to a history repository that can still be retrieved through vread and related methods, unless they are removed by the purge method. For samples that show how to call conditionalDelete, see Conditionally deleting a FHIR resource.

Request parameters:

parent - Required. The name of the FHIR store this resource belongs to. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/datasets/\[^/\]+/fhirStores/\[^/\]+$.

type - Required. The FHIR resource type to delete, such as Patient or Observation. For a complete list, see the FHIR Resource Index (DSTU2, STU3, R4). Value must have pattern ^\[^/\]+$.

$fields - Selector specifying which fields to include in a partial response.

Completes with a Empty.

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<Empty> conditionalDelete(
  core.String parent,
  core.String type, {
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' +
      core.Uri.encodeFull('$parent') +
      '/fhir/' +
      core.Uri.encodeFull('$type');

  final response_ = await _requester.request(
    url_,
    'DELETE',
    queryParams: queryParams_,
  );
  return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}