Patch
Description of how to patch part of a resource using our FHIR API.
PATCH
{base}/fhir/{type}
The patch operation allows you to update specific parts of a resource by sending a declarative description of the changes to be made. This method enables targeted updates without modifying the entire resource.
You can specify a PATCH
method by the content-type
header with either:
If the payload is an array -
application/json-patch+json
If the payload is an object
application/merge-patch+json
Below is an example of how to use a PATCH
request to update specific data in a resource. A complete list of resources can be found by visiting the resource specifications here.
Request
PATCH
{base}/fhir/Patient/{id}
Headers
Content-Type
application/json-patch+json
Authorization
Bearer <token>
Body
[
{
"op": "replace",
"path": "/name/0/family",
"value": "Bernard"
}
]
Response
{
"name": [
{
"family": "Bernard"
}
],
"id": "20304050",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2024-07-16T12:10:47.885463Z",
"versionId": "540524",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2024-07-16T10:08:33.753699Z"
}
]
}
"active": false
}
Last updated