Patient Identifier and Demographic Retrieval
What
Enables you to pull back a patient’s PKB public ID and / or a patient’s demographic details, including national identifiers held in PKB.
Prerequisites
How to
Using a valid Patient scoped access token, the partner application pulls the patient’s details. There are a few options, two of which are outlined below, and the best option depends on what the partner use case is.
PKB public id using the FHIR Purview operation on PKB’s Facade FHIR API. Example request is here, and an example response is below.
{
"resourceType": "Parameters",
"parameter": [
{
"name": "purview",
"valueReference": {
"reference": "Patient/1d4a8b2d-f885-499f-ba51-50600312f316"
}
}
]
}
Demographic details, including any identifiers (national/local) in the PKB record, using PKB’s REST API. Example response is here (/users/self). Example request / response below.
curl --location 'https://sandbox.patientsknowbest.com/json/users/self' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer LtftuUgRkYTl3QC9-DpQ3rDvZN09i3s0'
Response:
{
"id": "7329844",
"userType": null,
"heightCm": "2",
"heightFeet": "0",
"heightInches": "1",
"heightInchesTotal": "1",
"weightKg": "87",
"weightLbs": "191.8",
"title": "Dr.",
"firstName": "Bobby",
"lastName": "Barton",
"dob": "2000-01-01",
"dateDeceased": null,
"genderMF": "m",
"gender": "M",
"email": "bobbybarton@pkbtest.com",
"phone": "",
"address1": "Michael Springs",
"address2": "",
"city": "Lake Mary",
"state": "COUNTY",
"postalCode": "BS10 5NB",
"country": "GB-ENG",
"jobTitle": null,
"organizationName": null,
"teamName": null,
"nationalIds": [
{
"value": "9991566171",
"name": "NHS number",
"countryCodes": [
"GB-ENG",
"GB-WLS"
]
}
],
"orgLevelIds": null,
"teamLevelIds": null,
"contacts": [
{
"id": "10728020",
"contactType": "EMAIL",
"contactValue": "bobbybarton@pkbtest.com",
"phoneUseType": null,
"primary": true,
"confirmed": true
}
],
"patient": true
}
For the patient’s gender, use the "gender" field (not the “genderMF” field).
The “gender” field is the "Sex assigned at birth". The options will be: I, F, U, or M. To create the patient using the FHIR API, use the following case sensitive mappings.
REST FHIR PKB UI:
U unknown Unknown
M male Male
F female Female
I other Indeterminate