Skip to content

Commit f6b29df

Browse files
Merge pull request #300455 from evachen96/evach-bulkdeletedocs
Evach bulkdeletedocs
2 parents 29a7209 + ae9c690 commit f6b29df

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

articles/healthcare-apis/fhir/overview-of-search.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ FHIR specifies a set of search result parameters to help manage the information
137137
| `_contained` | No | No | |
138138
| `_containedType` | No | No | |
139139
| `_score` | No | No | |
140-
140+
| `_not-referenced` | Yes | No | `_not-referenced=*:*` to search for resources that are not referenced by any other resources. For example, `/Patient?_not-referenced=*:*` is used to search for Patient resources that are not referenced by any other resources.|
141141
Note:
142142
1. By default, `_sort` arranges records in ascending order. You can also use the prefix `-` to sort in descending order. The FHIR service only allows you to sort on a single field at a time.
143143
1. FHIR service supports wild card searches with revinclude. Adding a "*.*" query parameter in a revinclude query directs the FHIR service to reference all the resources mapped to the source resource.

articles/healthcare-apis/includes/fhir-bulk-delete-operation.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ To perform bulk delete capability header parameters needed are:
2121
## Role requirements
2222

2323
- A user or application needs to be assigned to the `FHIR Data Writer` role, to perform the bulk delete capability.
24-
- a user or application needs to be assigned to the `FHIR Data Contributor` role, to perform
25-
-- bulk delete capability with a hard delete query parameter.
26-
-- bulk delete on soft deleted resources.
24+
- a user or application needs to be assigned to the `FHIR Data Contributor` role, to perform bulk delete capability with a hard delete query parameter and bulk delete on soft deleted resources.
2725

2826
## Bulk delete operation details
2927
### `$bulk-delete` operation
@@ -42,7 +40,7 @@ You can execute the `$bulk-delete` operation at the system level or for individu
4240
```
4341
4442
> [!NOTE]
45-
> Use the `$bulk-delete` operation with caution. Deleted resources can't be restored.
43+
> Use the `$bulk-delete` operation with caution. Deleted resources can't be restored. We recommend that you first run a FHIR search with the same parameters as the bulk delete job to verify the data that you want to delete.
4644
4745
4846
#### Query parameters
@@ -52,7 +50,7 @@ Query parameters allow you to filter the raw resources you plan to delete. To su
5250
|Query parameter | Default Value | Description|
5351
|------------------------|---|------------|
5452
|_hardDelete|False|Allows you to hard delete a resource. If you don't pass this parameter or set hardDelete to false, the historic versions of the resource are still available.|
55-
|_purgeHistory|False|Allows you to delete history versions associated with resource. It will not delete current version of the resource and soft deleted resources. Note: When _purgeHistory used with the _hardDelete parameter set to true, it permanently deletes all versions associated with the resource.|
53+
|_purgeHistory|False|Allows you to delete history versions associated with resource. It doesn't delete the current version of the resource and soft deleted resources. Note: When _purgeHistory used with the _hardDelete parameter set to true, it permanently deletes all versions associated with the resource.|
5654
|FHIR service supported search parameters||Allows you to specify search criteria and resources matching the search criteria are deleted. For example: `address:contains=Meadow subject:Patient.birthdate=1987-02-20`|
5755
5856
All the query parameters are optional.
@@ -115,21 +113,21 @@ Here's a list of error messages that might occur if the bulk delete operation fa
115113
116114
|HTTP Status Code | Details | Recommended action |
117115
|-----------------|---------|--------------------|
118-
|500 |Connection to database failed | Create a gitsupport ticket to resolve the issue.|
116+
|500 |Connection to database failed | To resolve the issue, create a Get Support ticket.|
119117
|429 |Throttling errors | For Azure API for FHIR, you can increase RUs and retry the job. For Azure Health Data Services FHIR Server, you can try to delete a smaller amount of data at a time. |
120118
121119
## FAQ
122120
123-
- My bulk delete job seems to be stuck. What are the steps for resolution?<br/><br/> To check if a bulk delete job is stuck, run a FHIR search with the same parameters as the bulk delete job and _summary=count. If the count of resources is going down, the job is working. You can also cancel the bulk delete job and try again.
121+
- What are the steps for resolution if my bulk delete job seems to be stuck?<br/><br/> To check if a bulk delete job is stuck, run a FHIR search with the same parameters as the bulk delete job and _summary=count. If the count of resources is going down, the job is working. You can also cancel the bulk delete job and try again.
124122
125-
- Do API interactions see any latency impact when a bulk delete operation job is executed concurrently?<br/><br/>When you run a bulk delete operation, you might see increased latency on concurrent calls to the service. To avoid a latency increase, we recommend that you cancel the bulk delete job, and then rerun it during a period of lower traffic.
123+
- Will API interactions see any latency when a bulk delete operation job is executed concurrently?<br/><br/>When you run a bulk delete operation, you might see increased latency on concurrent calls to the service. To avoid a latency increase, we recommend that you cancel the bulk delete job, and then rerun it during a period of lower traffic.
126124
127125
> [!NOTE]
128126
> If you cancel and then restart a bulk delete job, the deletion process resumes from where it was stopped.
129127
130128
## Preview capabilities for the bulk delete operation
131129
### `$bulk-delete` with `_include` and `_revinclude`
132-
Note: When using FHIR service-supported search parameters with `$bulk-delete`, the `$bulk-delete` operation now supports using `_include` and `_revinclude` in the search criteria for conditional and bulk delete. Please note that this does not affect current behavior of singular deletes, which does not support extra parameters. Additionally, when using bulk delete with FHIR search parameters, consider using the same query in a FHIR search first, so that you can verify the data that you want to delete.
130+
Note: The `$bulk-delete` operation now supports using `_include` and `_revinclude` in the search criteria for conditional and bulk delete. This new feature doesn't affect current behavior of singular deletes, which doesn't support extra parameters. Additionally, when using bulk delete with FHIR search parameters, consider using the same query in a FHIR search first, so that you can verify the data that you want to delete.
133131
134132
Some examples of using `$bulk-delete` with `_include` and `_revinclude`:
135133
@@ -140,3 +138,11 @@ The following example using `_revinclude` will bulk delete all Patient resources
140138
The following example using `_include` will bulk delete all DiagnosticReport resources that were last updated before 12/18/2021, as well as all ServiceRequest resources that are referenced by those DiagnosticReport resources (via DiagnosticReport.basedOn relationship), and all Encounter resources that are referenced by those ServiceRequest resources (via ServiceRequest.encounters relationship):
141139
142140
`DELETE [base]/DiagnosticReport/$bulk-delete?_lastUpdated=lt2021-12-12&_include=DiagnosticReport:based-on:ServiceRequest&_include:iterate=ServiceRequest:encounter`
141+
142+
### `$bulk-delete` with `_not-referenced`
143+
Note: This feature is available in Azure Health Data Services FHIR Server only, and is not available in Azure API for FHIR.
144+
145+
As mentioned in the "Query parameters" section above, the `$bulk-delete` operation uses FHIR service supported search parameters. This includes the new `_not-referenced` parameter, which allows you to search for and delete resources that are not referenced by any other resources.
146+
147+
The following example will bulk delete all Patient resources that are not referenced by any other resources:
148+
`DELETE [base]/Patient/$bulk-delete?_not-referenced=*:*`

0 commit comments

Comments
 (0)