Search for Patient by Identifier (NHS Number and Local PAS/CRN)
To search for a Patient by NHS number, use the standard FHIR identifier search parameter against Patient.identifier. The identifier parameter is a token search, so the recommended pattern is to search using both the identifier system and the identifier value.
Format
GET [base]/Patient?identifier=[system]|[value]
NHS Number Example
GET [base]/Patient?identifier=https://fhir.nhs.uk/Id/nhs-number|9876543210
Local PAS/CRN Example
GET [base]/Patient?identifier=https://fhir.cavuhb.nhs.wales/Id/pas-identifier|123456
Supported Identifier Systems
As well as NHS number, you can also search using local PAS/CRN identifiers. The following identifier systems are supported:
https://fhir.abuhb.nhs.wales/Id/pas-identifierhttps://fhir.bcuhb.nhs.wales/Id/pas-identifierhttps://fhir.cavuhb.nhs.wales/Id/pas-identifierhttps://fhir.ctmuhb.nhs.wales/Id/pas-identifierhttps://fhir.hduhb.nhs.wales/Id/pas-identifierhttps://fhir.pthb.nhs.wales/Id/pas-identifierhttps://fhir.sbuhb.nhs.wales/Id/pas-identifierhttps://fhir.vunhst.nhs.wales/Id/pas-identifier
Notes
Search using Patient.identifier, not Patient.id.
Including both the system and the value helps make sure you get the right match.
Search for Patient by Name
You can search for a Patient using their name with the standard FHIR name parameter. This searches against Patient.name.
Format
GET [base]/Patient?name=[name]
Example
GET [base]/Patient?name=Jones
You can also search using given name or family name separately:
GET [base]/Patient?given=Jane&family=Jones
Notes
Name searches are not exact and may return multiple matches. Results may include similar or partial matches (e.g. “Jon” may match “Jones”).
Search for Patient by Name, Address, Date of Birth and Gender
You can combine multiple search parameters to narrow down results when searching for a Patient. Adding more parameters will generally reduce the number of matches returned.
You can start with a simple name search:
Example
GET [base]/Patient?name=Jones
You can make this more specific by splitting given and family name:
GET [base]/Patient?given=Jane&family=Jones`
Additional parameters can then be added to refine the search further:
GET [base]/Patient?given=Jane&family=Jones&birthdate=1990-01-01
GET [base]/Patient?given=Jane&family=Jones&birthdate=1990-01-01&gender=female
GET [base]/Patient?given=Jane&family=Jones&birthdate=1990-01-01&gender=female&address=Cardiff
You can also search using more specific address details, such as address line and postcode:
GET [base]/Patient?given=Jane&family=Jones&birthdate=1990-01-01&gender=female&address=10 High Street&address-postalcode=CF10 1AA
Notes
- Each additional parameter acts as an “AND”, helping to narrow the results.
birthdateshould be inYYYY-MM-DD format.genderuses standard FHIR values (e.g.male,female,other,unknown).- The
addressparameter searches across address fields (e.g. city, line, postcode). - Even with multiple parameters, more than one match may still be returned.
Supported Search Parameters
The CDR supports the standard search parameters defined in the FHIR R4 specification.
This includes commonly used parameters such as identifier, name, given, family, birthdate, gender, and address, as well as others defined for each resource.
The CDR also supports standard FHIR search modifiers. These can be used to refine searches, for example:
- Prefixes for date and number searches (e.g. before, after, or between dates using
lt,gt,le,ge,eq,ne) - Text-based matching such as “contains” for partial string searches
- Searching for missing values using
:missing=trueor:missing=false - Chained searches to follow references (e.g. searching Patients via related resources)
- Including related resources in results using
_includeand_revinclude
Further details on available search parameters and modifiers for each resource can be found in the FHIR specification.