Getting "500 Internal Server " error while creating DocumentReference

146 views
Skip to first unread message

Supresh Bhujbal

unread,
Sep 6, 2018, 6:03:09 PM9/6/18
to Cerner FHIR Developers
If this is a question about an error or issue you are seeing, please fill out the following fields:

  • Issue Summary: I am trying to POST a DocumentReference to cerner fhir server but I keep getting "500 Internal Server Error" , I also went through most of the related topics to it and verified details such as Patient Id, Encounter Id and data. everything seems to be valid for me. Can someone please help me with this in identifying the exact issue? 
  • X-Request-Id : 612cb422eddff8ede876e9d56c7a2a3d
  • Request : https://fhir-ehr.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference (POST)
  • Request body :
    • {
    •   "resourceType": "DocumentReference",
    •   "subject": {
    •     "reference": "Patient/4342010"
    •   },
    •   "type": {
    •     "coding": [
    •       {
    •         "system": "http://loinc.org",
    •         "code": "34840-9"
    •       }
    •     ]
    •   },
    •   "author": [
    •     {
    •       "reference": "Practitioner/4464007"
    •     }
    •   ],
    •   "indexed": "2015-11-18T18:00:00Z",
    •   "status": "current",
    •   "docStatus": {
    •     "coding": [
    •       {
    •         "system": "http://hl7.org/fhir/composition-status",
    •         "code": "final"
    •       }
    •     ]
    •   },
    •   "description": "Rheumatology Note",
    •   "content": [
    •     {
    •       "attachment": {
    •         "contentType": "application/xhtml+xml;charset=utf-8",
    •         "data": "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'/><title>Document</title></head><body><div><p>Testing document api on cerner</p></div></body></html>"
    •       }
    •     }
    •   ],
    •   "context": {
    •     "encounter": {
    •       "reference": "Encounter/4027918"
    •     },
    •     "period": {
    •       "end": "2015-08-20T09:10:14Z"
    •     }
    •   }
    • }

Madhur Rajendran (Cerner)

unread,
Sep 6, 2018, 6:25:33 PM9/6/18
to Cerner FHIR Developers
Hi Supresh,

The data that is passed in on the content.attachment.data field has to be base64 encoded.

Thanks,
Madhur

Supresh Bhujbal

unread,
Sep 6, 2018, 8:15:24 PM9/6/18
to Cerner FHIR Developers
Thank you so much Madhur, It worked. 
Reply all
Reply to author
Forward
0 new messages