Search loading...

API Hub

Explore and Make use of Nationally Defined Messaging APIs

 

A010: Patient Service Search

Status: Beta
Notice: This Beta endpoint is expected to be available in E-RS/DEV3 from the end of February 2019

API URL

Base URL (Dev3): ‘https://api.dev3.ers.ncrs.nhs.uk/ers-api’

Method URL Authentication
POST /STU3/v1/HealthcareService/$ers.searchHealthcareServicesForPatient Session Token (Details)

Description

As a Referring Clinician (/Administrator) needing to refer a patient
I want to search for services that are appropriate for my patient
So that I can create a shortlist of services where my patient can be referred to.

This endpoint is to be used as part of the Create Referral workflow.

Prerequisite Operations

If using the filter on specialty, the value provided must be a valid code obtained via the Get Reference Data (A004) endpoint.

Request Operation

Request Header

Field Name Value
XAPI_ASID The “Accredited System ID” issued to the third party
HTTP_X_SESSION_KEY The session key generated by the Create Session endpoint (A001)
Accept ‘application/fhir+json`
Content-Type ‘application/fhir+json`

Request Body

The Operation Definition for this endpoint is available on the FHIR server: ers.patientServiceSearch

Parameter Name Cardinality Type Notes
patient 1..1 Identifier The master NHS Number for the patient
referringClinician 0..1 If the logged in user is an RCA (and only in this case) they need to specify the referring clinician on whose behalf they are operating, in the context of the current referral  
requestType 1..1 Code  
SearchCriteria 1..1 Resource The StructureDefintion of this Resource is: eRS-ServiceSearchCriteria-Parameters-1
sortBy 1..1 Code  
Example Request Header
    EXAMPLE COMING SOON
  
Example Request Body
    EXAMPLE COMING SOON
  


Response

Success

HTTP Status code 200 (OK) is returned. The response body contains the list of services (if any) that match the search criteria provided in the format of an eRS-FetchServices-List-1

Example Response Body
    EXAMPLE COMING SOON
  


Failure

If an error occurs, the relating HTTP status code will be returned in the header. Where status code 422 (Unprocessable Entity) is returned then an eRS-OperationOutcome-1 will be included in the body, as detailed below.

issue.details.code Description
FIELD_NOT_PERMITTED A referring clinician is provided when the logged in user is not an RCA
INAPPROPRIATE_VALUE The value of commissioning provisioning is ALL_SERVICES (this value is not supported)
NO_REG_GP_PRACTICE The patient provided was found not to have a registered GP practice. The patient is not eligible to be referred via e-RS while this problem persists
ORGANISATION_IS_CLOSED The organisation identifier supplied corresponds to an organisation that is closed
ORGANISATION_NOT_APPROPRIATE The organisation identifier supplied corresponds to an organisation of a type other than ‘Service location’ and ‘Service providing organisation’
PATIENT_ERROR There was a problem with the patient’s record in SDS. The patient is not eligible to be referred via e-RS while this problem persists
REFERENCE_NOT_FOUND An entity referenced (e.g. the patient, the postcode, the organisation or a clinician) is not found
REFERENCED_USER_IS_NOT_ACTIVE The SDS user provided as the referring clinician or the named clinician is found to be not active in SDS
REFERENCED_USER_IS_NOT_RC The SDS user provided as the referring clinician does not actually have the Referring Clinician business function in e-RS
REFERENCED_USER_IS_NOT_SPC The SDS user provided as the named clinician does not actually have the Service Provider Clinician business function in e-RS
REFERENCED_USER_NOT_IN_ORG The referring clinician provided does not belong to the same organisation as the logged in user
UNEXPECTED_FIELD One of the following occurs: the distance limit is specified when the postcode is not provided, the IWT limit is specified when the priority is TWO_WEEK_WAIT or the clinic type is specified when the specialty is not provided
VALUE_IS_REQUIRED A referring clinician is not provided when the logged in user is an RCA

All content is available under the Open Government Licence v3.0, except where otherwise stated