---
title: "Search for service requests (A041, FHIR R4)"
method: GET
path: "/R4/ServiceRequest"
tags: ["Retrieve clinical information"]
---

# Search for service requests (A041, FHIR R4)

`GET /R4/ServiceRequest`

## Overview

<p style="color:red;font-weight:bold">
Warning: This endpoint is part of a new suite of APIs currently in development. We currently advise against integrating with this endpoint as its definition may be subject to change. If you would still like to use this endpoint please contact us before you start integration.
</p>

The e-RS FHIR API represents an advice and guidance request and a referral in FHIR R4 as a ServiceRequest. This endpoint allows you to search for attributes about a ServiceRequest.

At present the following is the only permitted use case for using this endpoint, but it is expected that additional use cases will be added as future needs are identified and prioritised.
- For FHIR R4 endpoints, the e-RS FHIR API requires a unique identifier for the ServiceRequest, instead of the UBRN, to identify an advice and guidance request or referral request. To support partners to transition from previous FHIR versions, and utilise the newer FHIR endpoints, this endpoint can be used as a bridging mechanism so that you can search for the required unique identifiers using a UBRN. 

## Supported security patterns

- Healthcare worker, user-restricted access

## Pre-requisites
To use this endpoint, you must be an authenticated e-RS user and use one of the following e-RS roles:

- `REFERRING_CLINICIAN`
- `REFERRING_CLINICIAN_ADMIN`
- `SERVICE_PROVIDER_CLINICIAN`
- `SERVICE_PROVIDER_CLINICIAN_ADMIN`

You need to use the Unique Booking Reference Number (UBRN) of an advice and guidance request or referral request.


## Important notes

When searching for a unique identifier for a ServiceRequest, it's important to note that one UBRN can relate to both an advice and guidance request and a referral. In this case, the response could contain two unique identifiers: one relating to the advice and guidance request and one relating to the referral.

## Use case

As an authenticated user

I need the unique identifier for a given advice and guidance request or referral request

So that I can view or action an advice and guidance request or referral

## Related endpoints

Once the ServiceRequest's unique identifier has been retrieved it can then be used to call the following endpoints to manage its clinical attachments:
- [[HYPERLINK_A012]]

## Sandbox test scenarios
You can test the following scenarios in our sandbox environment

| Scenario                                                                                | UBRN           |
| --------------------------------------------------------------------------------------- | -------------- |
| A response containing a single Request ID for a `ServiceRequest` of category `referral` | `000000070000` |
| A response containing a single Request ID for a `ServiceRequest` of category `request`  | `000000070001` |
| A response containing two Request IDs                                                   | `000000070002` |
| A response containing an empty bundle                                                   | `000000070003` |

## Query parameters

- `identifier` string, token, required

## Headers

- `NHSD-eRS-On-Behalf-Of-User-ID` string

## Parameters

- `#/paths/~1R4~1Practitioner/get/parameters/0` — unresolved $ref
- `#/paths/~1R4~1Practitioner/get/parameters/3` — unresolved $ref
- `#/paths/~1R4~1Practitioner/get/parameters/1` — unresolved $ref
- `#/paths/~1R4~1Practitioner/get/parameters/2` — unresolved $ref

## Response `200`

Bundle resource containing the `ServiceRequest` resources associated to the supplied UBRN. 
The canonical URL: https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle

## Other responses

- `400` — Where status code 400 (Bad Request) is returned then an [NHSDigital-OperationOutcome](https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome) will be included in the body, as detailed below. Check diagnostics property for specific information regarding the error. | issue.details.coding.code | issue.code | Coding System | Description | | ------------------------- | ---------- | ------------------------------------------------------------------ | ------------------------------------------------------------ | | REC_BAD_REQUEST | required | [BaRS Error Code](https://fhir.nhs.uk/CodeSystem/http-error-codes) | Incorrect or missing expected value. |
- `401` — unresolved $ref
- `403` — unresolved $ref
- `406` — unresolved $ref
- `429` — unresolved $ref
- `500` — unresolved $ref
- `503` — unresolved $ref

---

[API](https://skmtc.dev/nhs/apis/e-referrals-service-api.md) · [All operations](https://skmtc.dev/nhs/apis/e-referrals-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nhs/e-referrals-service-api/revisions/916969ea472f/schema)
