Unable to retrieve PDS FHIR test records with Application-restricted and Healthcare Worker tokens

Hello,

I am integrating with the PDS FHIR API (Integration environment) and testing against the official test data packs published here:
PDS FHIR API Test Data

I’ve hit several issues:
Search queries (Application-restricted)

GET ``https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient?family=HEA**&gender=female&birthdate=eq2010-10-22

Result:

{“resourceType”: “Bundle”,“timestamp”: “…”,“total”: 0,“type”: “searchset”}```

I expected to match at least one record from the published test data packs, but I consistently get no results.

I am presuming that all the endpoints as postman collection Patient Demographics Sandbox.postman_collection.json should work after replacing sandbox with INT.

Secondly, Direct NHS number lookup (Healthcare Worker) or PDS Lookup as Healthcare worker.
Primarily, my aim to demonstrate PDS looks for Secondary Care Health Worker (999 responder, etc…)
GET https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9449305919

Result:
{
“issue”: [
{
“code”: “forbidden”,
“details”: {
“coding”: [
{
“code”: “ACCESS_DENIED”,
“display”: “Access Denied - Unauthorised”,
“system”: “https://fhir.nhs.uk/R4/CodeSystem/Spine-ErrorOrWarningCode”
}
]
},
“severity”: “error”
}
],
“resourceType”: “OperationOutcome”
}

I understand that: Searches work with application-restricted tokens. Direct NHS-number reads require a Healthcare Worker (CIS2) token.

My question

It seems data If I do normal query none of those data on site is matched with my query.

Are the published test packs expected to return results in Integration with application-restricted queries, or are they just illustrative examples?

For NHS-number lookups, once I get my CIS2 Mock client paired, should the test NHS numbers from the Excel pack (e.g. 9449305919) resolve successfully in Integration? In separate topic CIS2 issue I am trying to solve: CIS2 Mock INT: mock-jwks returning generic pytest-nhsd-apim client instead of app-specific credentials

Thank you

Hi Shariq,

For the first search ?family=HEA**&gender=female&birthdate=eq2010-10-22, is there someone in the test pack to which you linked that you expected be returned in the bundle? From what I can see no male has a surname starting HEA, and no person has a date of birth of 20101022.

I am presuming that all the endpoints as postman collection Patient Demographics Sandbox.postman_collection.json should work after replacing sandbox with INT.

No. The sandbox environment is distinct in many ways, including the test PDS records available. The sandbox is a starting point for understanding how request and response format, and useful for using as a stub locally.

And with regards retrieving a patient’s record using their NHS number: The request for /Patient/9449305919 should return a patient, and does for me, when used against INT. If you’re receiving an ACCESS_DENIED response, it will be due to some aspect of the auth journey. Given you have an ongoing discussion in another topic which sounds related, it would be best to resolve that first.

The access modes are described here, including what each access mode can and cannot do, and their auth journeys. But in short, all access modes can retrieve a patient’s record using their NHS number and all access modes can search (the maximum number of results will vary according to the access modes).

Hopefully this answers you question.