You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/healthcare-apis/includes/fhir-bulk-delete-operation.md
+51-2Lines changed: 51 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,5 +144,54 @@ Note: This feature is available in Azure Health Data Services FHIR Server only,
144
144
145
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
146
147
-
The following example will bulk delete all Patient resources that are not referenced by any other resources:
<!--- check with Paola: confirm gen 2 only or both Note: This feature is available in Azure Health Data Services FHIR Server only, and is not available in Azure API for FHIR. --->
155
+
156
+
157
+
158
+
159
+
<!--- Check with Paola: Can it be multiple, or just one resource type? --->
160
+
161
+
162
+
The `$bulk-delete` operation supports configuring excluded resource types. When you perform a bulk delete operation, these resource types are excluded from deletion. This means that if you include this parameter and specify a resource type in your bulk delete request, those resource types will not be deleted, and the operation will complete successfully deleting everything else in the request, without deleting the specified excluded resource type.
163
+
164
+
The following example will delete all resources in your FHIR server, except for the `Patient` resource type:
The `$bulk-delete` operation supports removing references to resources that are being deleted. This means that if you delete a resource that is referenced by another resource, the reference will be removed from the referencing resource. The reference that has been removed with be replaced with the following value:
172
+
173
+
`"display": "Referenced resource deleted"`
174
+
175
+
Note: This feature only works with hard delete, so you must also set the `_hardDelete` query parameter to `true`.
176
+
177
+
This is useful for maintaining data integrity and ensuring that resources that are no longer needed are properly cleaned up.
178
+
179
+
The following example will bulk hard delete all Patient resources, and remove references to those patients from other resources.
In the example above, if a Patient resource is referenced by a DiagnosticReport resource and an Observation resource, the reference to that Patient will be removed from the DiagnosticReport and Observation resources.
0 commit comments