DocumentReference POST call - 403 Forbidden Response

91 views
Skip to first unread message
Assigned to esmeralda...@gmail.com by me

Sharon Dang

unread,
Nov 11, 2021, 12:06:05 PM11/11/21
to Cerner FHIR Developers
Hi,

I'm trying to make a POST call to the DocumentReference resource, but am getting a 403 Forbidden Resource response. I've already declared DocumentReference.write in my scope and it is listed in our app's configuration in Code Console.

The body of the request is from the Cerner documentation
{
"resourceType": "DocumentReference",
"status": "current",
"docStatus": "final",
"type": {
"coding": [
{
"code": "20732501",
"display": "Height Weight Allergy Rule - Text",
"userSelected": true
}
],
"text": "Height Weight Allergy Rule - Text"
},
"subject": {
"reference": "Patient/53663272"
},
"author": [
{
"reference": "Practitioner/21500981"
}
],
"authenticator": {
"reference": "Practitioner/21500981"
},
"content": [
{
"attachment": {
"contentType": "application/xml;charset=utf-8",
"data": "PGh0bWw+Cjx0aXRsZT4gVGVzdCBEb2N1bWVudCA8L3RpdGxlPgoKRG9jdW1lbnQgY29udGVudCEKCjwvaHRtbD4=",
"title": "Height Weight Allergy Rule",
"creation": "2020-07-29T21:02:04.000Z"
}
}
],
"context": {
"encounter": [
{
"reference": "Encounter/4208059"
}
],
"period": {
"start": "2020-01-01T00:00:00.000Z",
"end": "2020-01-01T01:00:00.000Z"
}
}
}

The X-Request-Id from the response header is 1941dcb2-4d0c-4eb4-95d8-598037858e3b

Any idea why this is happening?

Thanks

Sharon Dang

unread,
Nov 16, 2021, 11:03:00 AM11/16/21
to Cerner FHIR Developers
Following up on this?

Esmeralda Bolanos (Cerner)

unread,
Nov 16, 2021, 11:28:13 AM11/16/21
to Cerner FHIR Developers
Greetings,

The Encounter provided in the request does not have a person/patient associated with it. Investigating further I found that Encounter/4208059 does not exist in the database.

To resolve this issue please use a valid Encounter.

Thank you,
Esme (Cerner)

Sharon Dang

unread,
Nov 18, 2021, 12:39:31 PM11/18/21
to Cerner FHIR Developers
Thanks so much Esme! I got the response to pass, but now getting a 422 unprocessable entity error.

The X-Request-Id is cca68778-c187-4518-959d-df203ee3e7d4. Are there any logs on your side indicating why the file can't be processed?

Thanks,
Sharon

Esmeralda Bolanos (Cerner)

unread,
Nov 18, 2021, 12:51:16 PM11/18/21
to Cerner FHIR Developers
Hello Sharon,

It seems that the issue is similar to that of the Encounter, the Practitioner/21500981 and the Patient/53663272 used in the request do not exist in the Database. You would have to replace those with valid ones.

Best,
   Esme (Cerner)

Sharon Dang

unread,
Nov 18, 2021, 1:55:59 PM11/18/21
to Cerner FHIR Developers
I'm actually using Patient/12724066, which was returning a valid patient and encounters within the Code Console environment.

I can try changing the practitioner.

Would you also be able to send me valid patient, encounter, and practitioner IDs I can try with instead?

Thanks,
Sharon

Sharon Dang

unread,
Nov 18, 2021, 2:50:10 PM11/18/21
to Cerner FHIR Developers
Never mind, changing the practitioner worked. Thanks so much!
Reply all
Reply to author
Forward
0 new messages