Skip to content

renalreg/radar-patient-check

Repository files navigation

Contributors Issues MIT License


Logo

"Radar" (UKRDC) Patient Check

An API for checking if a patient is present in the UKRDC.
Report Bug · Request Feature

About The Project

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.

Built With

Python Fastapi

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

Install python

Installation

  1. Clone the repo

    git clone https://github.com/renalreg/radar-patient-check.git
  2. Create a virtual enviroment

    python -m venv .venv
  3. Activate enviroment
    CMD

    .venv/scripts/activate

    Bash

    source .venv/bin/activate
  4. 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
  5. Create a .env file with the following variables and populate

    SQLALCHEMY_DATABASE_URL = ""
    RADAR_APIKEYS = ["", ""]
    UKRDC_APIKEYS = ["", ""]
  6. Start the server. Only use reload for development

    uvicorn radar_patient_check.main:app --reload

Deployment

To deploy for production follow the following steps.

Prerequisites

Docker

Installation

  1. Clone the repo

    git clone https://github.com/renalreg/radar-patient-check.git
  2. Create a .env file with the following variables and populate

    SQLALCHEMY_DATABASE_URL = ""
    RADAR_APIKEYS = ["", ""]
    UKRDC_APIKEYS = ["", ""]
  3. Start the docker container

    docker compose up -d

Updating

  1. git pull the latest changes
  2. docker compose build to rebuild the image
  3. docker compose down && docker compose up -d to restart the container with the new image

Using the API

Headers

The headers need to include and authorization key value pair.

"Authorization" : "Bearer XXXXXXXXXXXXX"

API routes

RADAR Membership

POST: /radar_check/

Checks if a patient is present in the UKRDC, and has a RADAR.COHORT.INS program membership.

UKRDC Presence

POST: /ukrdc_check/

Checks if a patient is present in the UKRDC.

Request Body

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.

Response

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.


License

Distributed under the APGL License. See LICENSE for more information.

Contact

Renal Registry - @RenalRadar - [email protected]

Project Link: https://github.com/renalreg/radar-patient-check


Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published