NHS Digital Profile:
HL7 FHIR STU3 Resource:
Provider interaction to support the creation of NRL pointers.
In addition to the requirements on this page the general guidance and requirements detailed on the Development Guidance page MUST be followed when using this interaction.
Create Request Headers
Provider API create requests support the following HTTP request headers:
||Client System ASID||REQUIRED|
||The Spine ASID||REQUIRED|
- MUST construct and send a new Pointer (DocumentReference) resource that conforms to the NRL-DocumentReference-1 profile and submit this to NRL using the FHIR RESTful create interaction.
- MUST include the URI of the NRL-DocumentReference-1 profile StructureDefinition in the DocumentReference.meta.profile element of the DocumentReference resource.
- MUST include all of the mandatory data-elements contained in the
NRL-DocumentReference-1profile when constructing a DocumentReference. The mandatory data-elements are detailed on the Developer FHIR Resource page.
- MUST supply
authorattributes as absolute literal references, the formats of which can be found on the Developer FHIR Resource page.
- MUST only create pointers for records where they are the pointer owner (custodian).
For all create requests the
custodian ODS code in the DocumentReference resource 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)
- MUST return a
201CREATED HTTP status code on successful execution of the interaction and the entry has been successfully created in the NRL.
- MUST return a response body containing a payload with an
OperationOutcomeresource that conforms to the ‘Operation Outcome’ core FHIR resource (see the table below).
- MUST return an HTTP
Locationresponse header containing the full resolvable URL to the newly created ‘single’ DocumentReference.
- The URL will contain the ‘server’ assigned
logical Idof the new DocumentReference resource.
- The URL format MUST be:
- An example
- The URL will contain the ‘server’ assigned
- When a resource has been created it will have a
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.
The table summarises the
create interaction HTTP response code and the values expected to be conveyed in the successful response body
|201||information||informational||RESOURCE_CREATED||New resource created||Spine message UUID||Successfully created resource DocumentReference|
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
masterIdentifier Is Unique
The masterIdentifier should be unique within the NRL. For more information see the discussion on Pointer identifiers. The masterIdentifer is a FHIR identifier and for NRL the system and value properties are mandatory.
The system defines how the value is made unique. As the FHIR specification says this might be a recognised standard that describes how this uniqueness is generated.
The NRL recommends the use of either an OID or a UUID as an Identifier in keeping with the need for the masterIdentifier value to be unique. In this case then the system MUST be “urn:ietf:rfc:3986” (see the FHIR identifier registry for details) and the value is of the form –
• OID - urn:oid:[oidValue]
• UUID - urn:uuid:[uuidValue]
See the example OID and UUID based Identifiers from the FHIR specification.
POST a Pointer with C
The following code samples are taken from the NRL Demonstrator application which has both Consumer and Provider client implementations built in. More information about the design solution can be found on the NRL Demonstrator Wiki
First we generate a base pointer request model that includes the custodian and author details, and the specific care plan attachment details that are later used to build our pointer (DocumentReference). These pointer values are taken from the demo crisis plan that is created for the Demonstrator Provider system.
Then we call our DocumentReference service GenerateAndCreatePointer method which will generate our pointer (DocumentReference) using the values stored in the model, build a POST command request and then start the call to the NRL API.
Within the DocumentReference service GenerateAndCreatePointer method we generate our pointer model and then serialise this generated model ready for posting:
Calling the NRL
Using our POST command request model we create a connection to the NRL using HttpClient.
You can view the common connection code example here.
Explore the NRL
You can explore and test the NRL POST command using Swagger in the NRL API Reference Implementation.