Query regarding eRS API A005 ( Retrieve referral request )

We have query regarding eRS API A005. We are not able to hit the API (A005 - Retrieve referral request : GET /STU3/ReferralRequest/{ubrn}), getting error 403.

We are sending the following parameters in the request header as below -

Authorization : Bearer O03kXI38iT3WkbpO4F9IW6PYPG44

nhsd-end-user-organisation-ods : E82665

nhsd-ers-business-function : SERVICE_PROVIDER_CLINICIAN_ADMIN

nhsd-ers-on-behalf-of-user-id : 555294209105

Also, please guide us what we need to pass the value for the request parameter" nhsd-ers-on-behalf-of-user-id ", currently we are passing user UUID.

403 indicates an authorisation issue with access forbidden, therefore look at the authentication process you’re using if you are certain you have authorisation to use the method.

Hi @mkumar,

Can you please provide an X-Correlation-ID or X-Request-ID for the request so we are able to trace the request on our side?

Please ensure you have validated the Org/Business Function combination is available to the user using A030 - Retrieve e-RS business functions and that the user is able to work on-behalf-of the selected user using A040 - Retrieve e-RS-specific practitioner information.

Thanks.

@adam.oldfield

I hit the get referral by ubrn number API by below Correlation ID -

X-Correlation-ID - 689072ea-d22d-11ee-a506-0242ac120002

For this - [A040 - Retrieve e-RS-specific practitioner information]

Getting this response -

{
“id”: “976103d3-d241-410a-8e07-c14741b4f5f1”,
“resourceType”: “Bundle”,
“meta”: {
“lastUpdated”: “2024-02-23T09:21:04.025Z”,
“profile”: [
“_base/StructureDefinition/UKCore-Bundle”
]
},
“type”: “searchset”,
“total”: 0,
“timestamp”: “2024-02-23T09:21:04.025Z”,
“link”: [
{
“relation”: “self”,
“url”: “_base/referrals/FHIR/R4/Practitioner?_query=onBehalfOf”
}
]
}

For this API [A030 - Retrieve e-RS business functions] -

Getting this response -

{
“fullUrl”: “_base/referrals/FHIR/R4/PractitionerRole/PractitionerRole-E82665-555294209105”,
“resource”: {
“id”: “PractitionerRole-E82665-555294209105”,
“resourceType”: “PractitionerRole”,
“meta”: {
“lastUpdated”: “2024-02-23T07:12:00.788Z”,
“profile”: [
“_base/StructureDefinition/UKCore-PractitionerRole”
]
},
“practitioner”: {
“identifier”: {
“system”: “_base/Id/sds-user-id”,
“value”: “555294209105”
}
},
“organization”: {
“identifier”: {
“system”: “_base/ods-organization-code”,
“value”: “E82665”
}
},
“code”: [
{
“coding”: [
{
“system”: “_base/CodeSystem/eRS-BusinessFunction-1”,
“code”: “SERVICE_PROVIDER_CLINICIAN”
}
]
},
{
“coding”: [
{
“system”: “_base/CodeSystem/eRS-BusinessFunction-1”,
“code”: “REFERRING_CLINICIAN_ADMIN”
}
]
},
{
“coding”: [
{
“system”: “_base/CodeSystem/eRS-BusinessFunction-1”,
“code”: “REFERRING_CLINICIAN”
}
]
},
{
“coding”: [
{
“system”: “_base/CodeSystem/eRS-BusinessFunction-1”,
“code”: “REFERRING_ADMIN”
}
]
},
{
“coding”: [
{
“system”: “_base/CodeSystem/eRS-BusinessFunction-1”,
“code”: “SERVICE_PROVIDER_CLINICIAN_ADMIN”
}
]
},
{
“coding”: [
{
“system”: “https://fhir.nhs.uk/CodeSystem/eRS-BusinessFunction-1”,
“code”: “SERVICE_PROVIDER_ADMIN”
}
]
}
]
}

Hi @mkumar,

The call to retrieve the referral is failing as the on-behalf-of user provided is not valid. The on-behalf-of user ID cannot be the same as the SPCA user ID.

As you can see from your response to A040 user 555294209105 does not have any valid on-behalf-of users to use.

Note: If you don’t want to use on-behalf-of then use the SERVICE_PROVIDER_CLINICIAN business function and do not provide the NHSD-eRS-On-Behalf-Of-User-ID header.

@zubeir.tai @nhserspartners Are you able to assist with the data setup/usage for on-behalf-of?

Thanks,

Adam.

Hi @adam.oldfield,

Thanks, It is helpful

I have passed the REFERRING_CLINICIAN business function and do not provide the NHSD-eRS-On-Behalf-Of-User-ID header, then I can retrieve the referral by UBRN.

@zubeir.tai Please setup for on-behalf-of user Id.

Hi @mkumar - Are you intending to use the SPCA role, why?

As a referring use case I would have expected use of RC or RCA.

Please clarify.

Hi @zubeir.tai,

Yes, if we are using REFERRING_CLINICIAN business function, so we don’t need to pass the ‘on-behalf-of’ user-id, It is only required for the SPCA business function. Right now, we can continue with RC role instead of SPCA.

Thanks for the update…