References
NHS Digital Profile: NRL-DocumentReference-1 |
HL7 FHIR STU3 Resource(s): DocumentReference |
User Stories: - |
Create
Provider interaction to support the creation of NRL pointers. The create interaction is a FHIR RESTful create interaction.
Prerequisites
In addition to the requirements on this page, the general guidance and requirements detailed on the Development Overview page MUST be followed when using this interaction.
Create Request Headers
Provider API create requests support the following HTTP request headers:
Header | Value | Conformance |
---|---|---|
Accept |
The Accept header indicates the format of the response the client is able to understand, if set, this must be either application/fhir+json or application/fhir+xml . |
OPTIONAL |
Authorization |
The Authorization header will carry the base64url encoded JSON web token required for audit on the spine - see the JSON Web Token Guidance page for details. |
REQUIRED |
fromASID |
Client System ASID. | REQUIRED |
toASID |
The Spine ASID. | REQUIRED |
Create Operation
POST [baseUrl]/STU3/DocumentReference
Provider systems MUST:
- construct and send a new pointer (DocumentReference) resource that conforms to the
NRL-DocumentReference-1
profile and submit this to the NRL using the FHIR RESTful create interaction. - include all of the mandatory data-elements contained in the
NRL-DocumentReference-1
profile when constructing aDocumentReference
. The mandatory data-elements are detailed on the Developer FHIR Resource page. - follow all population guidance as outlined on the Developer FHIR Resource page when constructing a
DocumentReference
. - only create pointers for records where they are the pointer owner (custodian).
For all create requests the custodian
ODS code in the DocumentReference
MUST be affiliated with the Client System ASID
value in the fromASID
HTTP request header sent to the NRL.
XML Example of a New DocumentReference Resource (Pointer)
JSON Example of a New DocumentReference Resource (Pointer)
Create Response
Success
A successful execution of the create
interaction will return:
- a
201
CREATED HTTP status code confirming the entry has been successfully created in the NRL. - a response body containing an
OperationOutcome
resource (see below for full details). - an HTTP
Location
response header containing the full resolvable URL to the newly created ‘single’DocumentReference
:- The URL will contain the ‘server’ assigned
logical id
of the newDocumentReference
resource. - The URL format will be:
https://[host]/[path]/[id]
. - An example
Location
response header:https://psis-sync.national.ncrs.nhs.uk/DocumentReference/297c3492-3b78-11e8-b333-6c3be5a609f5-54477876544511209789
- The URL will contain the ‘server’ assigned
When a resource has been created it will have a versionId
of 1.
The NRL server will ignore any versionId value sent by a client in a create interaction. Instead, the server will ensure that the newly assigned versionId adheres to the rules laid out above.
OperationOutcome
The OperationOutcome
resource in the response body will conform to the ‘Spine-OperationOutcome-1’ FHIR resource:
Element | Content |
---|---|
id |
A UUID for this OperationOutcome . |
meta.profile |
Fixed value: https://fhir.nhs.uk/STU3/StructureDefinition/Spine-OperationOutcome-1 |
issue.severity |
Fixed value: information |
issue.code |
Fixed value: informational |
issue.details.coding.system |
Fixed value: https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 |
issue.details.coding.code |
Fixed value: RESOURCE_CREATED |
issue.details.coding.display |
Fixed value: New resource created |
issue.details.text |
A Spine internal message UUID which can be used to identify the client’s create transaction within Spine. A client system SHOULD reference this UUID in any related incidents raised with the National Service Desk. The UUID will be used to retrieve log entries that relate to a specific client transaction. |
issue.diagnostics |
Fixed value: Successfully created resource DocumentReference |
Example success response body (XML)
Example success response body (JSON)
Failure
The following errors can be triggered when performing this operation:
- Invalid Request Message
- Invalid Resource
- Organisation not found
- Invalid NHS Number
- Invalid Parameter
- Duplicate Resource
- Missing or Invalid Headers
Explore the NRL
You can explore and test the create interaction using Swagger in the NRL API Reference Implementation.