Description:
I’m trying to create a DocumentReference resource using the Cerner R4 FHIR endpoint:
POST https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/DocumentReference
However, I keep receiving a 422 Unprocessable Entity error, and I’m not sure what is causing it.
Request Body:
{
"resourceType": "DocumentReference",
"status": "current",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "11488-4",
"display": "Consult Note Generic"
}
]
},
"subject": {
"reference": "Patient/12742399"
},
"author": [
{
"reference": "Practitioner/12769364"
}
],
"date": "2025-10-30T00:00:00Z",
"context": {
"encounter": [
{
"reference": "Encounter/97955594"
}
],
"period": {
"start": "2025-10-30T00:00:00Z",
"end": "2025-10-30T01:00:00Z"
}
},
"content": [
{
"attachment": {
"contentType": "text/plain;charset=UTF-8",
"data": "SGVsbG8gV29ybGQh",
"title": "Test Note"
}
}
]
}
Response:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"details": {
"text": "Unprocessable entity"
}
}
]
}
What I’ve Checked So Far:
- The Patient, Practitioner, and Encounter IDs are valid and retrievable using the FHIR read APIs.
 
- The DocumentReference resource type supports create and update interactions as per the /metadata response.
 
- The access token includes the required system/DocumentReference.write scope
 
- The attachment includes a valid Base64 encoded string (SGVsbG8gV29ybGQh) and a contentType with a charset specified.
 
Question:
Can someone help me understand what could be causing the 422 Unprocessable Entity error? Is there a specific field or value in the payload that Cerner’s FHIR API rejects when creating a DocumentReference?