Update a Resource
Concurrency
To avoid overwriting data, an application must always indicate which version of a Resource the update is based on. This is done using the If-Match header. If this header is missing, the Koppeltaal server will reject the request. If the update is not based on the latest version, the server will respond with a 409 Conflict or a 412 Precondition Failed.
The If-Match value must match the latest ETag value. The ETag value is provided via a response header sent by the Koppeltaal server after a Create, Update or Get.
Update a complete resource
PUT https://fhir-server.koppeltaal.headease.nl/fhir/DEFAULT/<Resource>/<:id>
Note: the
id
property has to be set in the body as well
Path Parameters
id*
string
The "logical id" of the
Resource
Headers
Request Body
*
string
The
Resource
Resource is modified. The resource with resource-origin extension and logical id is returned
The resource cannot be parsed or does not conform to the basic FHIR validation rules
Unauthenticated
Unauthorized
Resource type not supported, or not a FHIR end-point
The Resource did not exist prior to the update, and the server does not allow client defined ids
Version conflict, update is based on an old version
Precondition Failed Version conflict, update is based on an old version
Does not meet FHIR profiles or Koppeltaal business rules
Delen van een Resource Updaten
PATCH requests are optional. See the Conformance to find out if the server supports this.
To update a Resource via a small payload, the Koppeltaal server may support PATCH requests. The payload of the PATCH must be one of the following:
A JSON Patch (Content-Type application/json-patch+json).
An XML Patch (Content-Type application/xml-patch+xml)
A FHIRPath Patch parameters Resource (Content-Type FHIR Content Type).
This is what the payload looks like from a JSON Patch to update the status of a Task
[{
"op": "replace",
"path": "/status",
"value": "completed"
}]More examples of patches can be downloaded here.
Patch a Resource
PATCH https://hapi-fhir-server.koppeltaal.headease.nl/fhir/<Resource>/<:id>
As an alternative to updating an entire resource, clients can perform a patch operation. This can be useful when a client is seeking to minimize its bandwidth utilization.
Path Parameters
*
String
The "logical id" of the
Resource
Headers
Request Body
*
object
The Patch
Patch is applied. The complete Resource will be returned
Unauthenticated
Unauthorized
Not Found Resource type not supported, or not a FHIR end-pointMethod Not Allowed Precondition Failed Version conflict, update is based on an old versionTopics
TOP-KT-002a - FHIR Resource Service interacties
Last updated
Was this helpful?