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/fhir/fhir-versioning-policy-and-history-management.md
+30-4Lines changed: 30 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ Changing the versioning policy, either at a system level or resource level, won'
71
71
> The query parameter _summary=count and _count=0 can be added to _history endpoint to get a count of all versioned resources. This count includes soft deleted resources.
72
72
73
73
## Metadata-only updates and versioning
74
-
If the versioning policy is set to either `versioned` or `version-update`, metadata-only updates (changes to FHIR resources that only affect the metadata) increment the resource version, create a new version, and save the old version as a historical record. If you are making metadata-only changes using PUT or PATCH updates, you can use the query parameter _meta-history for PUT and PATCH updates to configure whether or not the old version is saved as a historical record.
74
+
If the versioning policy is set to either `versioned` or `version-update`, metadata-only updates (changes to FHIR resources that only affect the metadata) increment the resource version, create a new version, and save the old version as a historical record. If you are making metadata-only changes using PUT, PATCH, or `$bulk-update`, you can use the query parameter _meta-history for PUT, PATCH, and `$bulk-update` to configure whether or not the old version is saved as a historical record.
75
75
-`_meta-history=true` is set by default. By default, the resource version is incremented, a new version is created, and the old version is saved as a historical record. The lastUpdated timestamp is updated to reflect the change.
76
76
-`_meta-history=false` The `_meta-history` parameter can be configured to `false`. This means that the resource version is incremented, a new version is created, but the old version is not saved as a historical record. The lastUpdated timestamp is also still updated to reflect the change. This configuration can be used to help reduce data storage when making metadata-only updates.
77
77
@@ -130,8 +130,8 @@ To demonstrate the use of the `_meta-history` parameter with PUT, follow this ex
130
130
5. This will increment resource version and create a new version 3, but the old version 2 will not be saved as a historical record. To see this, run: `GET <fhir server>/Patient/test-patient/_history`. Two versions should be returned, versions 1 and 3. Please note that `_meta-history=false` query parameter only affects metadata-only changes made using PUT or PATCH. Using the query parameter to make metadata updates along with other non-metadata field value changes will increment the resource version and save the old version as a historical record.
131
131
132
132
133
-
### Example of `_meta-history=false` with PATCH
134
-
To demonstrate the use of the `_meta-history` parameter with PATCH, follow this example:
133
+
### Example of `_meta-history=false` with PATCH or `$bulk-update`
134
+
To demonstrate the use of the `_meta-history` parameter with PATCH or `$bulk-update`, follow this example:
135
135
136
136
1. Create a resource:
137
137
`PUT <fhir server>/Patient/test-patient`
@@ -169,7 +169,7 @@ To demonstrate the use of the `_meta-history` parameter with PATCH, follow this
169
169
}
170
170
```
171
171
3. Run: `GET <fhir server>/Patient/test-patient/_history`. Two versions should be returned, versions 1 and 2.
172
-
4. Use PATCH to make a metadata-only update with `_meta-history=false` query parameter. The example uses PATCH to update only the Patient.meta.tag.system value. More information about PATCH [here](rest-api-capabilities.md#patch-and-conditional-patch).
172
+
4. Use PATCH or `$bulk-update`to make a metadata-only update with `_meta-history=false` query parameter. The example demonstrates using PATCH or `$bulk-update`to update only the Patient.meta.tag.system value. More information about PATCH [here](rest-api-capabilities.md#patch-and-conditional-patch) and `$bulk-update`[here](fhir-bulk-update.md).
@@ -192,6 +192,30 @@ Using PATCH with FHIRPath patch:
192
192
]
193
193
}
194
194
```
195
+
If you wanted to bulk update multiple resources, you could use `$bulk-update`. The following example shows how to use `$bulk-update` to update the same metadata field for all Patient resources with `_meta-history=false`:
5. This will increment resource version and create a new version 3, but the old version 2 will not be saved as a historical record. To see this, run: `GET <fhir server>/Patient/test-patient/_history`. Two versions should be returned, versions 1 and 3. Please note that `_meta-history=false` query parameter only affects metadata-only changes made using PUT or PATCH. Using the query parameter to make metadata updates along with other non-metadata field value changes will increment the resource version and save the old version as a historical record.
209
233
234
+
235
+
210
236
## Next steps
211
237
212
238
In this article, you learned how to purge the history for resources in the FHIR service. For more information about how to disable history and some concepts about history management, see
0 commit comments