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
+76-2Lines changed: 76 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ If the versioning policy is set to either `versioned` or `version-update`, metad
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
78
78
79
-
### Example with`_meta-history=false` with PUT
79
+
### Example of`_meta-history=false` with PUT
80
80
To demonstrate the use of the `_meta-history` parameter with PUT, follow this example:
81
81
1. Create a resource:
82
82
`PUT <fhir server>/Patient/test-patient`
@@ -127,11 +127,85 @@ To demonstrate the use of the `_meta-history` parameter with PUT, follow this ex
127
127
]
128
128
}
129
129
```
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. 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.
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:
135
+
136
+
1. Create a resource:
137
+
`PUT <fhir server>/Patient/test-patient`
138
+
```
139
+
{
140
+
"id": "test-patient",
141
+
"resourceType": "Patient",
142
+
"name": [
143
+
{
144
+
"family": "Doe",
145
+
"given": [ "John" ]
146
+
}
147
+
]
148
+
}
149
+
```
150
+
2. Create a new version of the resource with `PUT <fhir server>/Patient/test-patient`. This will have version 2.
151
+
```
152
+
{
153
+
"id": "test-patient",
154
+
"resourceType": "Patient",
155
+
"meta": {
156
+
"tag": [
157
+
{
158
+
"system": "test",
159
+
"code": "test"
160
+
}
161
+
]
162
+
},
163
+
"name": [
164
+
{
165
+
"family": "Doe",
166
+
"given": [ "Jane" ]
167
+
}
168
+
]
169
+
}
170
+
```
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).
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.
Copy file name to clipboardExpand all lines: articles/healthcare-apis/fhir/rest-api-capabilities.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,8 @@ For more information on history and version management visit [FHIR versioning po
91
91
Patch is a valuable RESTful operation when you need to update only a portion of the FHIR resource. Using patch allows you to specify the element that you want to update in the resource without having to update the entire record. FHIR defines three ways to patch resources: JSON Patch, XML Patch, and FHIRPath Patch. The FHIR service supports JSON Patch and FHIRPath Patch, along with Conditional JSON Patch and Conditional FHIRPath Patch (which allows you to patch a resource based on a search criteria instead of a resource ID).
92
92
For examples, refer to the [FHIRPath Patch REST file](https://github.com/microsoft/fhir-server/blob/main/docs/rest/FhirPatchRequests.http) and the [JSON Patch REST file](https://github.com/microsoft/fhir-server/blob/main/docs/rest/JsonPatchRequests.http). For more information, see [HL7 documentation for patch operations with FHIR](https://www.hl7.org/fhir/http.html#patch).
93
93
94
+
95
+
94
96
> [!NOTE]
95
97
> When using `PATCH` against STU3, and if you are requesting a History bundle, the patched resource's `Bundle.entry.request.method` is mapped to `PUT`. This is because STU3 doesn't contain a definition for the `PATCH` verb in the [HTTPVerb value set](http://hl7.org/fhir/STU3/valueset-http-verb.html).
The FHIR service supports the `_meta-history` query parameter with both `PUT` and `PATCH` operations. This parameter allows you to control whether metadata-only changes to a resource create a new historical version of the resource or not. By default, any change to a resource, including metadata-only changes, creates a new version and saves the previous version as a historical record. When you set the `_meta-history` parameter to `false`, metadata-only changes do not create a new version, and the previous version is not saved as a historical record. This feature is useful for scenarios where frequent metadata updates are made, and you want to avoid cluttering the resource history with numerous versions that only differ in metadata. For more information and examples, see [FHIR versioning policy and history management](fhir-versioning-policy-and-history-management.md#metadata-only-updates-and-versioning).
0 commit comments