Author

Martine Wauben

Published

September 29, 2024

The following was submitted to the NHSRdatasets package in 2020 but was too big as data to be accepted by the package (CRAN has size limits). However, the vignette that accompanied the data may be of interest and so is copied here as a blog. The data is also pulled from the GitHub Pull Request.

CQC Directory

This vignette explains how to use the cqc_load dataset in R, and also details where it comes from and how it is generated.

The data is sourced from the Care Quality Commission and its archive is available on Google Drive.

The data contains care provider locations and ratings as published monthly in 2019.

The dataset contains data on locations and providers:

  • location: location ID, name, ODS code, telephone number, web address, sector, inspection directorate, region, local authority, CCG, street address, parliamentary constituency, and coordinates.
  • provider: provider ID, name, company/charity registration, telephone number, web address, sector, inspection directorate, region, local authority, street address, and parliamentary constituency. code for the organisation that this activity relates to
  • pub_date: The date that particular data point was published

First let’s load some packages and the dataset and show the first 10 rows of data.

Data location

The following code has had all references to the NHSRdatasets package removed as the data wasn’t added to it.

library(dplyr)
library(knitr)
library(tidyr)
library(ggplot2)
library(lubridate)
library(magrittr)

# Although the data isn't in NHSRdatasets it can be downloaded from the Pull Request using this code

load(url("https://github.com/MHWauben/NHSRdatasets/raw/274688bc727e800d5c40f06f86be38f866167818/data/cqc_directory.rda"))

# format for display
cqc_load %>%
  # show the first 10 rows
  head(10) %>%
  # format as a table
  kable()
location_id location_hsca_start_date care_home location_name location_ods_code location_telephone_number registered_manager_note_where_there_is_more_than_one_manager_at_a_location_only_one_is_included_here_for_ease_of_presentation_the_full_list_is_available_if_required location_web_address care_homes_beds location_type_sector location_inspection_directorate location_primary_inspection_category location_latest_overall_rating publication_date location_region location_local_authority location_onspd_ccg_code location_onspd_ccg location_commissioning_ccg_code location_commissioning_ccg location_street_address location_address_line_2 location_city location_county location_postal_code location_latitude location_longitude location_parliamentary_constituency brand_id brand_name provider_companies_house_number provider_charity_number provider_id provider_name provider_hsca_start_date provider_type_sector provider_inspection_directorate provider_primary_inspection_category provider_ownership_type provider_telephone_number provider_web_address provider_street_address provider_address_line_2 provider_city provider_county provider_postal_code provider_local_authority provider_region provider_latitude provider_longitude provider_parliamentary_constituency provider_nominated_individual_name pub_date
1-1000210669 2013-12-12 Y Kingswood House Nursing Home VM4G6 01424716303 * NA 22 Social Care Org Adult social care Residential social care Requires improvement 2018-08-04 South East East Sussex E38000076 NHS Hastings and Rother CCG NA NA 21-23 Chapel Park Road NA St Leonards On Sea East Sussex TN37 6HR 50.857239 0.561998 Hastings and Rye BD398 BRAND Innomary 08558638 NA 1-877912132 Innowood Limited 2013-12-12 Social Care Org Adult social care Residential social care Organisation 02089079713 NA 62 Northwick Avenue NA Harrow Middlesex HA3 0AB Brent London 51.579057 -0.320762 Brent North Saluguti, Vikas 2019-01-01
1-1000312641 2013-10-18 N Human Support Group Limited - Sale VN30H 01619429490 Buckley, Michelle www.humansupportgroup.co.uk 0 Social Care Org Adult social care Community based adult social care services Good 2018-11-17 North West Trafford E38000187 NHS Trafford CCG NA NA 59 Cross Street NA Sale Cheshire M33 7HF 53.427726 -2.323301 Altrincham and Sale West BD409 BRAND Human Support Group 03513906 NA 1-101693918 The Human Support Group Limited 2010-10-01 Social Care Org Adult social care Community based adult social care services Organisation 01619429487 www.humansupportgroup.co.uk Craig House, 33 Ballbrook Avenue Didsbury Manchester Lancashire M20 3JG Manchester North West 53.425083 -2.235246 Manchester, Withington Mason, Glen 2019-01-01
1-1000401911 2013-11-04 Y Little Haven VL05L 02086974246 Muriuki, Martin NA 15 Social Care Org Adult social care Residential social care Good 2018-04-11 London Lewisham E38000098 NHS Lewisham CCG NA NA 133 Wellmeadow Road NA London NA SE6 1HP 51.441104 0.002335 Lewisham East - - 04174819 NA 1-101666779 Elizabeth Peters Care Homes Limited 2010-10-01 Social Care Org Adult social care Residential social care Organisation 02086985296 NA 14 Canadian Avenue NA London NA SE6 3AS Lewisham London 51.440913 -0.02297 Lewisham East Muriuki, Martin 2019-01-01
1-1000587219 2013-11-04 Y Highlands Borders Care Home VM44K 01392491261 Martin, Fiona NA 18 Social Care Org Adult social care Residential social care Good 2017-07-20 South West Devon E38000129 NHS Northern, Eastern and Western Devon CCG NA NA 22 Salutary Mount Heavitree Exeter Devon EX1 2QE 50.721541 -3.508053 Exeter - - 06612312 NA 1-101693962 Highlands Care Home Limited 2010-10-01 Social Care Org Adult social care Residential social care Organisation 01392431122 www.highlandscarehome.co.uk 56 St Leonards Road NA Exeter Devon EX2 4LS Devon South West 50.718254 -3.521576 Exeter Zhang, Danadanqi 2019-01-01
1-1000711804 2013-12-12 Y Belmont Grange Nursing and Residential Home VM4GQ 01913849853 Urwin, Kelly-Ann NA 30 Social Care Org Adult social care Residential social care Good 2017-03-01 North East County Durham E38000116 NHS North Durham CCG NA NA Broomside Lane NA Durham County Durham DH1 2QW 54.786148 -1.52816 City of Durham - - 07470626 NA 1-241243645 Perfect Care Limited 2011-10-05 Social Care Org Adult social care Residential social care Organisation 01388420145 www.perfectcare.co.uk 10-12 High Street NA Spennymoor County Durham DL16 6DB County Durham North East 54.69881 -1.601821 Bishop Auckland Moran, Barbara 2019-01-01
1-1001764404 2013-10-11 N Everycare Midsussex VNA9N 01444244770 Parsons, Katie www.everycare.co.uk/midsussex 0 Social Care Org Adult social care Community based adult social care services Good 2018-10-20 South East West Sussex E38000083 NHS Horsham and Mid Sussex CCG NA NA 191-193 London Road NA Burgess Hill NA RH15 9RN 50.956288 -0.139426 Mid Sussex - - 08547200 NA 1-962890981 Cura Muneris Limited 2013-10-11 Social Care Org Adult social care Community based adult social care services Organisation 01444244770 NA 191-193 London Road NA Burgess Hill NA RH15 9RN West Sussex South East 50.956288 -0.139426 Mid Sussex Dimelow, David 2019-01-01
1-1001764472 2013-10-28 N Cherish UK Ltd VN2E0 01253766888 Stockell, Sam www.cherishuk.co.uk 0 Social Care Org Adult social care Community based adult social care services Good 2017-10-12 North West Blackpool E38000015 NHS Blackpool CCG NA NA 8 Skyways Commercial Centre Blackpool Business Park, Amy Johnson Way Blackpool Lancashire FY4 3RS 53.777788 -3.025486 Blackpool South - - 05435700 NA 1-101680050 Cherish UK Limited 2011-01-25 Social Care Org Adult social care Community based adult social care services Organisation 01253766888 www.cherishuk.co.uk 8 Skyways Commercial Centre Blackpool Business Park, Amy Johnson Way Blackpool Lancashire FY4 3RS Blackpool North West 53.777788 -3.025486 Blackpool South Watson, Wendy 2019-01-01
1-1001764512 2013-10-14 N Optical Express - Bluewater Clinic NA 08000232020 Leadley, Robert www.opticalexpress.co.uk/store/kent-bluewater-shopping-centre.html 0 Independent Healthcare Org Hospitals Acute hospital - Independent specialist NA NA South East Kent E38000043 NHS Dartford, Gravesham and Swanley CCG NA NA Unit L40, Lower Thames Walk Bluewater Greenhithe Kent DA9 9SJ 51.438086 0.271001 Dartford BD142 BRAND Optical Express SC161469 NA 1-983441221 Optical Express Limited 2013-10-14 Independent Healthcare Org Hospitals Acute hospital - Independent specialist Organisation 01236723300 www.opticalexpress.com The Avenue Cliftonville Northampton Nothamptonshire NN1 5BT Northamptonshire East Midlands 52.236378 -0.877334 Northampton South Spellman, Mary 2019-01-01
1-1001765343 2013-10-14 N Optical Express - Cambridge Clinic NA 08000232020 Leadley, Robert www.opticalexpress.co.uk/store/cambridge-petty-cury.html 0 Independent Healthcare Org Hospitals Acute hospital - Independent specialist NA NA East of England Cambridgeshire E38000026 NHS Cambridgeshire and Peterborough CCG NA NA 39-41 Petty Cury NA Cambridge Cambridgeshire CB2 3NB 52.205264 0.1203 Cambridge BD142 BRAND Optical Express SC161469 NA 1-983441221 Optical Express Limited 2013-10-14 Independent Healthcare Org Hospitals Acute hospital - Independent specialist Organisation 01236723300 www.opticalexpress.com The Avenue Cliftonville Northampton Nothamptonshire NN1 5BT Northamptonshire East Midlands 52.236378 -0.877334 Northampton South Spellman, Mary 2019-01-01
1-1001875873 2013-10-14 N Optical Express - Leeds (Albion Street) Clinic NA 08702202020 Saward, Louise www.opticalexpress.co.uk/store/leeds-airedale-house.html 0 Independent Healthcare Org Hospitals Acute hospital - Independent specialist NA NA Yorkshire and The Humber Leeds E38000225 NHS Leeds CCG NA NA 6th Floor, Airedale House 77-85 Albion Street Leeds West Yorkshire LS1 5AW 53.798527 -1.545292 Leeds Central BD142 BRAND Optical Express SC161469 NA 1-983441221 Optical Express Limited 2013-10-14 Independent Healthcare Org Hospitals Acute hospital - Independent specialist Organisation 01236723300 www.opticalexpress.com The Avenue Cliftonville Northampton Nothamptonshire NN1 5BT Northamptonshire East Midlands 52.236378 -0.877334 Northampton South Spellman, Mary 2019-01-01

We can calculate the total number of each type of rating at each datapoint like this:

rat_overtime <- cqc_load %>%
  group_by(pub_date, location_latest_overall_rating) %>%
  summarise(number = dplyr::n()) %>%
  filter(!is.na(location_latest_overall_rating)) %>%
  ungroup() %>%
  mutate(pub_date = as.Date(pub_date))

rat_overtime %>%
  pivot_wider(
    id_cols = location_latest_overall_rating,
    names_from = pub_date,
    values_from = number
  ) %>%
  kable()
location_latest_overall_rating 2019-01-01 2019-02-01 2019-03-01 2019-04-01 2019-05-01 2019-06-01 2019-07-01 2019-08-01 2019-09-01 2019-10-01 2019-11-01 2019-12-01
Good 25000 25015 25059 25176 25192 25395 25549 25676 25816 25923 25937 26083
Inadequate 366 363 378 384 395 394 399 410 419 425 436 434
Outstanding 1163 1181 1205 1251 1282 1302 1322 1358 1391 1410 1442 1464
Requires improvement 4013 4027 4036 4017 3975 3940 3944 3969 3972 3997 4047 4086

We can now plot, for each month, the proportion of locations that received each rating:

ggplot(rat_overtime, aes(pub_date, number, fill = location_latest_overall_rating)) +
  geom_bar(stat = "identity", position = "fill") +
  theme_minimal() +
  labs(
    x = "Data publication date",
    y = "Proportion",
    fill = "CQC rating",
    title = "CQC ratings as published",
    caption = "Source: Care Quality Commission"
  )

Although the raw numbers show increases in each rating, this is primarily driven by more and more locations becoming available: proportionally, performance has remained fairly stable at a national level.

We can further break this down by region to better understand what is happening:

region_ratings_overtime <- cqc_load %>%
  group_by(pub_date, location_region, location_latest_overall_rating) %>%
  summarise(number = dplyr::n()) %>%
  filter(!is.na(location_latest_overall_rating) & !(location_region %in% c("Unspecified", "(pseudo) Wales"))) %>%
  ungroup() %>%
  mutate(pub_date = as.Date(pub_date))

ggplot(region_ratings_overtime, aes(pub_date, number, fill = location_latest_overall_rating)) +
  geom_bar(stat = "identity", position = "fill") +
  theme_minimal() +
  facet_wrap(~location_region) +
  labs(
    x = "Data publication date",
    y = "Proportion",
    fill = "CQC rating",
    title = "CQC ratings as published",
    caption = "Source: Care Quality Commission"
  )

More interesting patterns emerge now: some regions have growing proportions of ‘Good’ or ‘Outstanding’ locations, whereas others are seeing increases in locations requiring improvement.

How many new care homes are being opened?

With an ageing population, there is increasing demand for care home beds. Is supply keeping up?

carehome_openings <- cqc_load %>%
  mutate(location_hsca_start_date = as.Date(location_hsca_start_date)) %>%
  filter(care_home == "Y" & location_hsca_start_date >= "2014-01-01" &
    !(location_region %in% c("Unspecified", "(pseudo) Wales")) &
    pub_date == max(as.Date(pub_date))) %>%
  mutate(location_month = floor_date(location_hsca_start_date, unit = "month")) %>%
  group_by(location_month) %>%
  summarise(
    number = n(),
    beds = sum(as.integer(care_homes_beds))
  ) %>%
  mutate(
    location_year = as.factor(format(floor_date(location_month, unit = "year"), "%Y")),
    month = format(location_month, "%m")
  )

ggplot(carehome_openings, aes(x = month, y = number, colour = location_year, group = location_year)) +
  geom_line() +
  theme_minimal()

It is likely that the 2019 timeseries drops off due to a delay between provision starting and CQC reporting data. However, overall the number of new care homes opening is not increasing! Perhaps each care home is getting bigger; how many new beds are becoming available?

ggplot(carehome_openings, aes(x = month, y = beds, colour = location_year, group = location_year)) +
  geom_line() +
  theme_minimal()

This is a bit more encouraging: in 2016 and 2017, there was a good uptick in new care home beds. However, 2018 did not perform quite as well. Still, 2019 appears to be going in the right direction!

Back to top

Reuse

CC0

Citation

For attribution, please cite this work as:
Wauben, Martine. 2024. “CQC Directory Data Vignette.” September 29, 2024. https://nhs-r-community.github.io/nhs-r-community/blog/cqc-data.html.