Skip to content

Scrape and combine A&E attendance and admission data from NHSE into CSV files.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
MIT-LICENSE
Notifications You must be signed in to change notification settings

ncl-icb-analytics/Scrape-NHSE-AE-Data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scrape NHSE A&E Data

This project contains a Python script to scrape publicly available A&E attendance and emergency admission data from the NHS England website. The script downloads CSV files for specified years, combines them into a single dataset, and saves the output.

Prerequisites

Before running the script, ensure you have the following Python packages installed:

  • requests
  • beautifulsoup4
  • pandas

Usage

Clone the repository:

git clone https://github.com/ncl-icb-analytics/Scrape-NHSE-AE-Data
cd Scrape-NHSE-AE-Data

Set up a virtual environment:

python -m venv venv
venv\Scripts\activate

Install the dependencies:

pip install -r requirements.txt

Run the script:

main.py

The script will:

  • Scrape the NHS England website for A&E attendance and emergency admission data.
  • Downloads all available CSV files into data
  • Combines the downloaded CSV files into output as two files:
    • national_ae_data.csv: Contains all the combined data.
    • ncl_ae_data.csv: Contains filtered data for NCL trusts.

Column Headers

The combined CSV files will have the following columns:

  • Period
  • Org Code
  • Parent Org
  • Org name
  • A&E attendances Type 1
  • A&E attendances Type 2
  • A&E attendances Other A&E Department
  • A&E attendances Booked Appointments Type 1
  • A&E attendances Booked Appointments Type 2
  • A&E attendances Booked Appointments Other Department
  • Attendances over 4hrs Type 1
  • Attendances over 4hrs Type 2
  • Attendances over 4hrs Other Department
  • Attendances over 4hrs Booked Appointments Type 1
  • Attendances over 4hrs Booked Appointments Type 2
  • Attendances over 4hrs Booked Appointments Other Department
  • Patients who have waited 4-12 hs from DTA to admission
  • Patients who have waited 12+ hrs from DTA to admission
  • Emergency admissions via A&E - Type 1
  • Emergency admissions via A&E - Type 2
  • Emergency admissions via A&E - Other A&E department
  • Other emergency admissions

License

This repository is dual licensed under the Open Government v3 & MIT. All code and outputs are subject to Crown Copyright.

About

Scrape and combine A&E attendance and admission data from NHSE into CSV files.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
MIT-LICENSE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages