https://github.com/evanodell/cqcr
Access 'Care Quality Commission' Data
https://github.com/evanodell/cqcr
care-quality-commission cqc cqc-data data-retrieval healthcare hospital hospitals r social-care
Last synced: 3 months ago
JSON representation
Access 'Care Quality Commission' Data
- Host: GitHub
- URL: https://github.com/evanodell/cqcr
- Owner: evanodell
- License: gpl-3.0
- Created: 2019-08-23T14:02:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-21T08:09:28.000Z (over 1 year ago)
- Last Synced: 2025-10-22T04:59:53.175Z (3 months ago)
- Topics: care-quality-commission, cqc, cqc-data, data-retrieval, healthcare, hospital, hospitals, r, social-care
- Language: R
- Homepage: https://docs.evanodell.com/cqcr/
- Size: 646 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r options, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# cqcr
[](https://www.gnu.org/licenses/gpl-3.0)
[](https://cran.r-project.org/package=cqcr)
[](https://github.com/evanodell/cqcr)
[](https://dgrtwo.shinyapps.io/cranview/)
[](https://github.com/evanodell/cqcr/actions)
[](https://ci.appveyor.com/project/evanodell/cqcr)
[](https://codecov.io/gh/evanodell/cqcr?branch=master)
[](https://zenodo.org/badge/latestdoi/204009825)
Get data from the Care Quality Commission [API](https://anypoint.mulesoft.com/exchange/portals/care-quality-commission-5/4d36bd23-127d-4acf-8903-ba292ea615d4/cqc-syndication-1/)
Access data from the 'Care Quality Commission', the health and adult social care regulator for England. The 'Care Quality Commission' operates an [API](https://www.cqc.org.uk/about-us/transparency/using-cqc-data#api), with data available under the Open Government License. Data includes information on service providers, locations such as hospitals, care homes and medical clinics, and ratings and inspection reports.
## Installation
The package is available on [CRAN](https://cran.r-project.org/package=cqcr), and can be installed with:
```
install.packages("cqcr")
```
To install the development version from GitHub use:
```
#install.packages("devtools")
devtools::install_github("evanodell/cqcr")
```
```{r packages}
library(cqcr)
library(purrr)
library(dplyr)
library(ggplot2)
library(forcats)
```
```{r eval=FALSE}
loc1 <- cqc_locations_search(care_home = TRUE,
local_authority = c("Waltham Forest",
"Hackney", "Tower Hamlets"))
care_home_details <- cqc_location_details(loc1)
care_home_df <- map_dfr(care_home_details, `[`,
c("location_id", "name", "number_of_beds",
"onspd_longitude", "onspd_latitude"))
care_home_df <- care_home_df %>%
mutate(rating = care_home_details %>%
map(c("current_ratings", "overall", "rating")) %>%
as.character(),
rating = recode(rating, "NULL" = "No published rating"),
rating = factor(rating, levels = c("Outstanding", "Good",
"Requires improvement",
"Inadequate",
"No published rating")),
report_date = care_home_details %>%
map(c("current_ratings", "reportDate")) %>%
as.character(),
report_date = ifelse(report_date == "NULL", NA, report_date),
specialisms = care_home_details %>% map(c("specialisms", "name")))
```
```{r readin, include=FALSE}
care_home_df <- readr::read_rds("vignettes/care_home_df.rds")
```
```{r plot}
care_home_df_unnest <- tidyr::unnest(care_home_df, cols = c(specialisms)) %>%
mutate(specialisms = fct_infreq(specialisms))
theme_set(theme_bw())
ggplot(care_home_df_unnest,
aes(x = specialisms, fill = rating)) +
geom_bar() +
scale_x_discrete(labels = scales::wrap_format(33)) +
scale_fill_viridis_d(name="", option = "A", end = 0.95) +
labs(x = "Specialism(s)", y = "Number of Care Homes") +
theme(legend.position = "bottom",
axis.text.x = element_text(size = 8, angle = 60, hjust = 1))
```
# Citing cqcr
Odell E (2019). _cqcr: Access 'Care Quality Commission' Data_. doi: 10.5281/zenodo.3452020, R package version `r packageVersion("cqcr")`, URL:
.
A BibTeX entry for LaTeX users is
```
@Manual{,
title = {{cqcr}: Access 'Care Quality Commission' Data},
author = {Evan Odell},
doi = {10.5281/zenodo.3452020},
year = {2019},
note = {R package version `r packageVersion("cqcr")`},
url = {https://github.com/evanodell/cqcr},
}
```
# Notes
This package is not affiliated with or supported by the Care Quality Commission.
Please note that the 'cqcr' project is released with a
[Contributor Code of Conduct](https://github.com/evanodell/cqcr/blob/master/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.