1. Quick Start guide - nhsconnect/nrls-reference-implementation GitHub Wiki

This guide is aimed at helping developers get up and running using the NRL Reference Implementation tool, located on the NHS Digital Developer network, with their own solutions quickly.

In this section:

1.1 Connecting and Requirements

1.1.1 Swagger

The NRL Reference Implementation can be found at https://data.developer.nhs.uk/nrls-ri/index.html.

The default page takes you to a swagger page that allows you to explore the API with ease and test out the various functions available, default data to use and examples of how to structure requests and their responses.

1.1.2 API EndPoint

The EndPoint at which you will need to send requests to is:

https://data.developer.nhs.uk/nrls-ri/DocumentReference

1.1.3 Mutual Authentication

Although the EndPoint is accessed via a HTTPS URL, the Mutual Authentication requirement for connecting has been disabled on this tool for ease.

1.1.4 Specification

More information on the API interactions and full requirements can be found at https://developer.nhs.uk/apis/nrl/.

1.1.5 Demo Apps

There are number of Consumer Demo Apps available to view and test out. These are fictitious applications designed to mimic some of the applications health care workers may use and how the NRL would look when integrated into these applications.

You can see the available list of Demo Apps at https://nrls.digital.nhs.uk/system-select.

1.1.6 Supporting APIs

There are three supporting APIs that can aid in a full end-to-end test of a systems integration using the reference implementation, these include:

  1. Stub PDS
  2. Stub ODS
  3. Stub SSP

Details of how to interact with these APIs is detailed in the postman testing section of this wiki.

1.2 Testing Locally

1.2.1 GitHub

This tool can be downloaded and ran locally. The main benefit would allow you to adjust the test data used.

The source code and wiki can be found at https://github.com/nhsconnect/nrls-reference-implementation.

1.2.2 Docker

If you are familiar with Docker you can launch this tool locally using Docker enabling quicker access to local testing.

1.3 Example Data

1.3.1 NHS Numbers

There is a limited list of fictitious NHS Numbers that can be used with this tool, which are as follows:

NHS Number
1020103620
3656987882
0766140741
5456049767
2686033207

When running locally or hosting your own version you can alter the default data requirements. See the Testing Locally section for more details.

1.3.2 Consumer Test Data

The default headers required to send request to this tool as a Consumer are:

Header Value
Authorization {
    "iss": "https://demonstrator.com",
    "sub": "https://fhir.nhs.uk/Id/sds-role-profile-id|fakeRoleId",
    "aud": "https://nrls.com/fhir/documentreference",
    "exp": 1528978926,
    "iat": 1528978626,
    "reason_for_request": "directcare",
    "scope": "patient/DocumentReference.read",
    "requesting_system": "https://fhir.nhs.uk/Id/accredited-system|200000000117",
    "requesting_organization": "https://fhir.nhs.uk/Id/ods-organization-code|AMS01",
    "requesting_user": "https://fhir.nhs.uk/Id/sds-role-profile-id|fakeRoleId"
}


Please adjust the JWT property values to match those required.
JWT validation is based up on the expectation that the connecting system implements JWTs as per the SPINE Core specification
fromASID 200000000117
toASID 999999999999

Example Search URL

GET https://data.developer.nhs.uk/nrls-ri/DocumentReference?subject=https%3A%2F%2Fdemographics.spineservices.nhs.uk%2FSTU3%2FPatient%2F2686033207

Consumer ODS Codes

There are a number of fictitious ODS codes available. The default one that can be used for consumer interactions with the above fromASID is as follows:

ODS Code
AMS01

1.3.3 Provider Test Data

The default headers required to send request to this tool as a Provider are:

Header Value Notes
Authorization {
    "iss": "https://demonstrator.com",
    "sub": "https://fhir.nhs.uk/Id/accredited-system|200000000118",
    "aud": "https://nrls.com/fhir/documentreference",
    "exp": 1528978926,
    "iat": 1528978626,
    "reason_for_request": "directcare",
    "scope": "patient/DocumentReference.write",
    "requesting_system": "https://fhir.nhs.uk/Id/accredited-system|200000000118",
    "requesting_organization": "https://fhir.nhs.uk/Id/ods-organization-code|MHT01"
}


Please adjust the JWT property values to match those required.
JWT validation is based up on the expectation that the connecting system implements JWTs as per the SPINE Core specification
fromASID 200000000118
toASID 999999999999

Example Create URL

POST https://data.developer.nhs.uk/nrls-ri/DocumentReference

Provider ODS Codes

There are a number of fictitious ODS codes available. The default one that can be used for provider interactions with the above fromASID is as follows:

ODS Code
MHT01

Master Identifiers

Please note that the use of MasterIdentifer values is within your control. You can choose to use any values that you require for testing.

MasterIdentifer’s are not required and can be omitted from the DocumentReference data sent as part of a CREATE. If you choose to use these values please generate your own values. Those that already exist on this tool are example values to help illustrate their usage.

RelatesTo element

Connected to the MasterIdentifier values is the relatesTo element. This is an optional element that when you use it you will need to ensure that the related DocumentReference already exists on this tool and is “owned” by the same ODS code (custodian) that you are using in your CREATE request.

Populating this element triggers an internal function. See Superseding Pointers in the technical specification for more details.

1.3.4 Data Refresh

Please note that the data stored in this online tool is refreshed every night. The time at which this runs is usually around 1am but will run at the quietest time (for the server) anywhere between 00:00am and 05:00am.

1.4 Bypassing Valueset Rules

Normally when you create or supersede a pointer (FHIR DocumentReference) you must include the meta.profile property with a value of https://fhir.nhs.uk/STU3/StructureDefinition/NRL-DocumentReference-1.

Within this Reference Implementation we have added the option to use additional values for codeable concepts to aid in future use case development. This is activated on a per request basis and is done so by changing the value of the meta.profile property. This property is an array but to use this feature is should be an array with one item of https://fhir.nhs.uk/STU3/StructureDefinition/NRL-DocumentReference-Pref-1.

Example

{
  ...,
  resourceType: "DocumentReference",
  meta: {
    profile: [ "https://fhir.nhs.uk/STU3/StructureDefinition/NRL-DocumentReference-Pref-1" ]
  },
  type: {
    "coding": [
      {
        "system": "http://other.terminology.system",
        "code": "1237890",
        "display": "6 month fitness planner"
      }
    ]
  },
  ...
}

When active this feature will allow you to use any values for the following attributes instead of those defined in the NRL ValueSets:

  • Type.coding[x].system
  • Type.coding[x].code
  • Type.coding[x].display
  • Class.coding[x].system
  • Class.coding[x].code
  • Class.coding[x].display
  • Content[x].format.system
  • Content[x].format.code
  • Content[x].format.display
  • Context.practiceSetting.coding[x].system
  • Context.practiceSetting.coding[x].code
  • Context.practiceSetting.coding[x].display

1.5 Postman examples

There are some postman examples that have been created using these default values that will give you an insight into what requests to and from the NRL will look like. You can see these over in the testing section.

⚠️ **GitHub.com Fallback** ⚠️