Error 500 updating condition

76 views
Skip to first unread message
Assigned to Fenil....@cerner.com by me

Francis Devereux

unread,
Oct 11, 2021, 10:37:54 AM10/11/21
to Cerner FHIR Developers
Hi,

I'm getting a 500 Internal Server Error response when attempting to update a condition with PUT. The request body is based on a GET of the same condition but with the following changes:
- clinicalStatus changed from active to inactive
- all categories except the one with coding system http://terminology.hl7.org/CodeSystem/condition-category removed (otherwise PUT of the category complains about there being more than 1 category).

Here's the request I'm making and the response. BEARER_TOKEN is set to a bearer token for a system application.
$ curl -i -H "Authorization: Bearer $BEARER_TOKEN" -X 'PUT' -d '{"category":[{"coding":[{"code":"problem-list-item","display":"Problem List Item","system":"http://terminology.hl7.org/CodeSystem/condition-category"}],"text":"Problem List Item"}],"clinicalStatus":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/condition-clinical","code":"inactive","display":"Inactive","userSelected":true}],"text":"Inactive"},"code":{"coding":[{"code":"233819005","display":"Stable angina (disorder)","system":"http://snomed.info/sct","userSelected":true}],"text":"Concussion with loss of consciousness"},"id":"p73215783","meta":{"lastUpdated":"2021-10-05T11:24:09.000Z","versionId":"73215783"},"recordedDate":"2021-10-05T11:24:09.000Z","recorder":{"display":"SYSTEM, SYSTEM Cerner","reference":"Practitioner/1"},"resourceType":"Condition","subject":{"display":"McTest, Francis","reference":"Patient/12765742"},"text":{"div":"\u003cdiv xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\u003cp\u003e\u003cb\u003eCondition\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003ePatient\u003c/b\u003e: McTest, Francis\u003c/p\u003e\u003cp\u003e\u003cb\u003eProblem\u003c/b\u003e: Concussion with loss of consciousness, Stable angina (disorder)\u003c/p\u003e\u003cp\u003e\u003cb\u003eCategory Classification\u003c/b\u003e: Medical\u003c/p\u003e\u003cp\u003e\u003cb\u003eClinical Status\u003c/b\u003e: Active\u003c/p\u003e\u003cp\u003e\u003cb\u003eVerification Status\u003c/b\u003e: Confirmed\u003c/p\u003e\u003c/div\u003e","status":"generated"},"verificationStatus":{"coding":[{"code":"confirmed","display":"Confirmed","system":"http://terminology.hl7.org/CodeSystem/condition-ver-status","userSelected":false}],"text":"Confirmed"}}' -H 'Accept: application/fhir+json' -H 'Content-Type: application/fhir+json' -H 'If-Match: W/"fad44220346ae735562cb4a759cbdd6c"' 'https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/Condition/p73215783'
HTTP/1.1 100 Continue

HTTP/1.1 500 Internal Server Error
Content-Type: application/fhir+json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Date: Mon, 11 Oct 2021 14:24:46 GMT
Cache-Control: no-cache
Server-Response-Time: 434.434459
Vary: Origin
X-Request-Id: dcaac535-ef53-4d18-8068-306c09a9f364
X-Runtime: 0.434368
X-Edge-Origin-Shield-Skipped: 0
X-Cache: Error from cloudfront
Via: 1.1 27ec80ebfc4012ddc636b69078fff05a.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: LHR62-C1
X-Amz-Cf-Id: exf6YmBZZnMUs-4zlO5sNUuPHPUAd4hdBYOMNypl2coAZUzj6Ilgrw==

{"resourceType":"OperationOutcome","issue":[{"severity":"fatal","code":"exception","details":{"text":"Internal service error from resource store"}}]}



Francis

Fenil Desani (Cerner)

unread,
Oct 11, 2021, 10:52:03 AM10/11/21
to Cerner FHIR Developers
Hello,

Your If-Match header seems to be incorrect. It should be
If-Match: W/"<Current version of the Condition resource>" 

Thanks,
Fenil

Francis Devereux

unread,
Oct 11, 2021, 11:12:49 AM10/11/21
to Cerner FHIR Developers
Thanks, changing the If-Match header to 'If-Match: W/"73215783"' results in a 200 OK.
I arrived at the problematic value, 'If-Match: W/"fad44220346ae735562cb4a759cbdd6c"' by trying to follow the documentation at https://fhir.cerner.com/millennium/r4/clinical/summary/condition/, which says "The ETag response header indicates the current If-Match version to use on subsequent update.". It seems the ETag response header is not the right value to use though. Perhaps I have misinterpreted that documentation or it is incorrect?

Thanks,

Francis

Fenil Desani (Cerner)

unread,
Oct 11, 2021, 11:33:38 AM10/11/21
to Cerner FHIR Developers
So it seems to be correct in a way that, when you create a new Condition or update an existing one, then the ETag response header corresponds to the current version of Condition, which can be used for subsequent update. However, if you try to read a Condition, then you need to use versionId returned in the meta tag rather than Etag.

Francis Devereux

unread,
Oct 12, 2021, 10:53:49 AM10/12/21
to Cerner FHIR Developers
Yes I agree. I can use the ETag returned by a PUT in a subsequent PUT and it works, just not the etag returned by a GET.

I would expect to get a 400 error rather than a 500 if I supply a bad If-Match header though.

In any case I know how to proceed - use the version from the body of the GET instead of the ETag header.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages