Updating an Observation
To update an existing resource with a new value, use the PUT or PATCH endpoints.
You can identify the resource by using the id returned during creation or by locating it via the search endpoint.
Search example
Here is an example utilizing the ACCESSION, MRN and CODE to search for an existing resource.
curl --request GET \
--url '${BASE_URL}/fhir/R4/Observation?part-of%3Aidentifier=ACCESSION&subject%3Aidentifier=MRN&code=US_CAROTID_RT_INT_DISTAL_PSV' \
--header 'Authorization: Bearer ${access_token}' \
PUT example
curl --request PUT \
--url ${BASE_URL}/fhir/R4/Observation/111-1111-1111-1111-111111111111 \
--header 'Authorization: Bearer ${access_token}' \
--header 'Content-Type: application/fhir+json' \
--data '{
"resourceType": "Observation",
"status": "final",
"subject": {
"type": "Patient",
"id": "111-1111-1111-1111-111111111111",
"identifier": {
"system": "http://example.org/patient-ids",
"value": "123456",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR"
}
]
}
}
},
"partOf": [
{
"type": "ImagingStudy",
"identifier": {
"system": "http://example.org/filler-order-number",
"value": "1234",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "ACSN"
}
]
}
}
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "10231-9",
"display": "Right ventricular Ejection fraction"
}
]
},
"valueQuantity": {
"value": 29,
"unit": "%",
"system": "http://unitsofmeasure.org",
"code": "%"
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Right ventricular Ejection fraction: 29%</div>"
}
}'
PATCH example
curl --request PATCH \
--url ${BASE_URL}/fhir/R4/Observation/111-1111-1111-1111-111111111111 \
--header 'Authorization: Bearer ${access_token}' \
--header 'Content-Type: application/fhir+json' \
--data '[
{
"op": "replace",
"path": "/valueQuantity/value",
"value": 13.5
},
{
"op": "replace",
"path": "/text/div",
"value": "<div xmlns=\"http://www.w3.org/1999/xhtml\">13.5</div>"
}
]'
info
The server expects a JSON Patch (RFC 6902)