![Logo](/renalreg/radar-patient-check/raw/master/images/UKKA Kidney Blue.png)
An API for checking if a patient is present in the UKRDC.
Report Bug
·
Request Feature
This API was originally created to allow other applications to verify if a patient is present in RADAR using memberships found in the UKRDC database. It has now expanded in scope to cover checking a patient's general presence in the UKRDC.
To get a local copy up and running follow these simple example steps.
-
Clone the repo
git clone https://github.com/renalreg/radar-patient-check.git
-
Create a virtual enviroment
python -m venv .venv
-
Activate enviroment
CMD.venv/scripts/activate
Bash
source .venv/bin/activate
-
Install requirements packages
python -m pip install -r requirements.txt
4.1. Install requirements packages for development
python -m pip install -r requirements-dev.txt
-
Create a .env file with the following variables and populate
SQLALCHEMY_DATABASE_URL = "" RADAR_APIKEYS = ["", ""] UKRDC_APIKEYS = ["", ""]
-
Start the server. Only use reload for development
uvicorn radar_patient_check.main:app --reload
To deploy for production follow the following steps.
-
Clone the repo
git clone https://github.com/renalreg/radar-patient-check.git
-
Create a .env file with the following variables and populate
SQLALCHEMY_DATABASE_URL = "" RADAR_APIKEYS = ["", ""] UKRDC_APIKEYS = ["", ""]
-
Start the docker container
docker compose up -d
git pull
the latest changesdocker compose build
to rebuild the imagedocker compose down && docker compose up -d
to restart the container with the new image
The headers need to include and authorization key value pair.
"Authorization" : "Bearer XXXXXXXXXXXXX"
POST: /radar_check/
Checks if a patient is present in the UKRDC, and has a RADAR.COHORT.INS
program membership.
POST: /ukrdc_check/
Checks if a patient is present in the UKRDC.
Requests should be sent with a body containing the following
{
"nhsNumber": "XXXXXXXXXX",
"dateOfBirth": "YYYY-MM-DD"
}
where nhsNumber
is a NHS, CHI or HSC number and dateOfBirth
is the patient's date of birth.
The API will then respond in the following format
{
"nhsNumber": true,
"dateOfBirth": true,
}
Where nhsNumber
is a boolean value indicating if the NHS number is present and matches the required conditions (e.g. RADAR membership), and dateOfBirth
is a boolean value indicating if the date of birth matches.
Note, if the NHS number does not match the required conditions (e.g. UKRDC presence or RADAR membership), the dateOfBirth
response will always be false
.
Distributed under the APGL License. See LICENSE
for more information.
Renal Registry - @RenalRadar - [email protected]
Project Link: https://github.com/renalreg/radar-patient-check