Create a document reference
post
/DocumentReference
Creates new documents.
Note:
- Currently, only XHTML-formatted documents are supported. For example, a document with display formatting or styling can be written, but a CCD cannot.
- You can validate your document using any available strict XHTML 1.0 validator. For example, W3C Markup Validation Service or Nu Html Checker.
Authorization Types
This operation supports the following authorization types:
- Provider
- System
Request
Header Parameters
-
Authorization(required): string
Contains the credentials to authenticate a consumer to the service. This should be the OAuth2 Bearer token.
-
accept(required): string
The media type to be requested. See what the resource's operation produces for what is supported.
The Body of the Create operation
Root Schema : DocumentReferenceCreate
Type:
object
A summary representation of the Create (POST) operation for DocumentReference.
Show Source
-
author:
string
Who or what authored the document.
- At most, one practitioner can be populated.
- If the author is not provided, the author is determined based on the access token.
Example:{ "author": [ { "reference": "Practitioner/2150097" } ] }
-
content(required):
object content
The referenced or attached document.
-
context(required):
object context
The clinical context in which the document was prepared.
-
description:
string
The human-readable description (title).Example:
{ "description": "Rheumatology Note" }
-
docStatus:
string
The status of underlying document. This value represents a CodeableConcept. This operation only supports
final
.Example:{ "docStatus": { "coding": [ { "system": "http://hl7.org/fhir/composition-status", "code": "final" } ] } }
-
indexed(required):
string
When this document reference was created.Example:
{ "indexed": "2015-05-16T091014Z" }
-
resourceType(required):
string
The type of the FHIR resource.
resourceType
must be DocumentReference.Example:DocumentReference
-
status(required):
string
The status of this document reference. This operation only supports
current
.Example:{ "status": "current" }
-
subject(required):
string
Who or what is the subject of the document.
subject
must be a Patient reference.Example:{ "reference": "Patient/1234" }
-
type(required):
The type of document.
Note:- The type represents a CodeableConcept.
- The type must include a LOINC or a proprietary coding.
- Multiple LOINC codings or a single proprietary coding can be provided.
- When providing a proprietary code system, use the following format where the code set is Millennium Code Set 72:
https://fhir.cerner.com/<your EHR source id>/codeSet/<code set>
. - Example:
https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/72
. - The terminology bindings list is not the complete list mapped for the sandbox. The sandbox has many codes, but only a few are documented to provide examples. The list does not represent what would be mapped for a customer environment. This informartion is evaluated and implemented as needed when applications are made available at customer sites.
Example:{ "coding": [ { "system": "http://loinc.org", "code": "34840-9" } ] } --- OR --- { "coding": [ { "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/72", "code": "2820583" } ] }
Nested Schema : context
Type:
object
The clinical context in which the document was prepared.
Show Source
-
encounter:
string
Encounter-related context of the document content.Example:
{ "context": { "encounter": { "reference": "Encounter/4208053" } } }
-
period:
string
When the documented service was performed.
- If provided, the service time must be set to
context.period.end
. - If not provided, the document is stored with the indexed dateTime.
Example:{ "context": { "period" : { "end": "2015-08-20T09:10:14Z" } } }
- If provided, the service time must be set to
Nested Schema : items
Type:
Show Source
object
-
contentType:
string
The MIME type of the content with charset and so on. The contentType must be
application/xhtml+xml;charset=utf-8
.Example:{ "content": [ { "attachment": { "contentType": "application/xhtml+xml;charset=utf-8" } } ] }
-
data:
string
Data inline, base64 encoded XHTML. See the Common Issues section for more information.Example:
{ "content": [ { "attachment": { "data": "PCFET0NUWVBFIGh0bWwNCiAgU1lTVEVNI...<snipped for brevity>" } } ] }
Response
Supported Media Types
- application/json+fhir
- application/json
Default Response
Example Request:
POST https://fhir-ehr-code.cerner.com/dstu2/ec2458f2-1e24-41c8-b71b-0e701af7583d/DocumentReference
Example Request Body:
{
'resourceType': 'DocumentReference',
'subject': {
'reference': 'Patient/53663272'
},
'type': {
'coding': [
{
'system': 'http://loinc.org',
'code': '34840-9'
}
]
},
'author': [
{
'reference': 'Practitioner/21500981'
}
],
'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': ''
}
}
],
'context': {
'encounter': {
'reference': 'Encounter/4208059'
},
'period': {
'end': '2015-08-20T09:10:14Z'
}
}
}
Example Response:
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 20
Content-Type: text/html; charset=UTF-8
Date: Wed, 06 Jan 2016 18:09:18 GMT
Keep-Alive: timeout=15, max=100
access-control-allow-methods: DELETE, GET, POST, PUT, OPTIONS, HEAD
access-control-allow-origin: *
access-control-expose-headers: ETag, Content-Location, Location, X-Request-Id, WWW-Authenticate, Date
access-control-max-age: 0
cache-control: no-cache
location: https://fhir-ehr-code.cerner.com/dstu2/ec2458f2-1e24-41c8-b71b-0e701af7583d/DocumentReference/5789254
strict-transport-security: max-age=631152000
vary: Origin,User-Agent,Accept-Encoding
opc-request-id: /11111111111111111111111111111111/11111111111111111111111111111111
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-request-id: 11111111-1111-1111-1111-111111111111
x-xss-protection: 1; mode=block
Headers
-
Etag: string
For Update or Patch versioning controls. Related to
If-Match
. When a resource performs an operation that creates or updates a record, anEtag
value is returned as a header. This same value should be included in request headers as anIf-Match
for any subsequent update to that record. -
X-Request-Id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, provide the
X-Request-Id
, if present. -
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, provide the
opc-Request-Id
, if present.