I'm facing an issue while posting to DocumentReference.
method: "POST",
headers: {
"Content-Type": "application/json+fhir",
"Authorization": "Bearer " + this.cernerAccessTkn
}
{
resourceType: 'DocumentReference',
subject: {
reference: 'Patient/PATIENTID'
},
type: {
coding: [
{
code: "34840-9"
}
]
},
indexed: (new Date()).toISOString(),
status: 'current',
description: "Episode Note",
docStatus: {
coding: [
{
code: "preliminary"
}
]
},
context: {
encounter: {
reference: "Encounter/ENCOUNTERID"
},
period: {
end: (new Date()).toISOString()
}
},
content: [
{
attachment: {
contentType: "application/xhtml+xml;charset=utf-8",
data: '<html><head><title>Test CCDA</title></head><body>Hi</body></html>'
}
}
]
}