On the integration environment, I have submitted a referral and can see it in the e-RS UI.
The status of the referral is NOT_BOOKED.
I am trying to get the status of this referral via the API, using application-restricted access. Calling https://int.api.service.nhs.uk/referrals/FHIR/STU3/ReferralRequest/:ubrn (A005) I get this response:
{
"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 (000049838878)."
}
]
}
The user I used to create the referral is for C82660, and can see that this organisation is the referring organisation in the UI. The application I’m using for application-restricted access (app id 00b67abe-1fb0-4c3d-85e1-4a3d36f04487) has these custom attributes set:
app-restricted-ods-code: C82660
app-restricted-user-id: 555395063103
asid: [same as my user-restricted application]
On my latest request to get the status, my x-correlation-id is 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA. And the UBRN I’m using is 000049838878.
I was under the impression that since both my user-restricted user and my application-restricted application are both using the same ODS code, then they both should have access to the referral that’s been created.
Is there something I’ve configured incorrectly for this, or am I misunderstanding who can call this endpoint?