422 NO_RELATIONSHIP on A005

We are receiving the following 422 response when calling A005 to retrieve a referral request.

{'meta': {'profile': ['https://fhir.nhs.uk/STU3/StructureDefinition/eRS-OperationOutcome-1']}, 'resourceType': 'OperationOutcome', 'issue': [{'severity': 'error', 'code': 'business-rule', 'details': {'coding': [{'code': 'NO_RELATIONSHIP', 'system': 'https://fhir.nhs.uk/STU3/CodeSystem/eRS-APIErrorCode-1', 'display': 'No relationship'}]}, 'diagnostics': 'No legitimate relationship with referral (REDACTED).'}]}

On production environment we call A008 to retrieve worklist of type REFERRALS_FOR_REVIEW, the error occurred for a worklist that had Triage Deferrals. Attempting to retrieve any of them (A005) results in the 422 NO_RELATIONSHIP error.

This issue does not occur for us in the int environment.

May I please have some assistance with this?

Hi @gareth.perkins,

Without providing an Application ID or X-Correlation-ID/X-Request-ID I’ve had to do my best infer these. So before reading on please confirm the Application ID this relates to is 2582fedd-0842-4870-bb91-4c5dc46fa120.

I then took a look at the last HTTP 422 error of this type. I looked at a request from around 22/05/2025 14:36:39.346.

You didn’t provide an X-Correlation-ID on the request, but the X-Request-ID we returned will have been 78eb9ed7-b30a-464d-9427-27cdd646f5ea. To aid future diagnostics/tracing please provide an X-Correlation-ID on every request - this should be a unique string (e.g. a UUID).

For this example I can see it was a request to A005. This request was made by a Referring Clinician business function from Org Y08706.

For a referring clinician to have a Legitimate Relationship with the request the request must have been created by the users logged in Org (i.e. Y08706). Or the logged in Org must be the patients registered GP.

From what I can easily see (from the data I have immediate access to) from that request it was initiated by Y04965. The e-RS determined the calling user did not have LR, so I can only assume Y08706 is not the user’s registered GP practice.

You mention the use of A008 to retrieve the Referrals for Review worklist. Note that this worklist is only available to Service Provider business functions. If the UBRN was returned by A008 then the same user in the context of a Service Provider business function would be able to retrieve it via A005.

Given I have had to infer the request you are referring to, it is possible this is all out of context. Please do provide details of a specific request to investigate if the above doesn’t help.

@Daniel_McAdam FYI

Regards,

Adam.

Hi Adam,

Thanks that’s really helpful, I think you are correct based on the logs we have available.

We are going to review the handling of business functions and have added a correlation id to all our requests.

Thanks

Gareth

1 Like