diff --git a/02-geomapping-ICS_22_23.R b/02-geomapping-ICS_22_23.R index d79968b..940a88d 100644 --- a/02-geomapping-ICS_22_23.R +++ b/02-geomapping-ICS_22_23.R @@ -38,10 +38,9 @@ library(st) ## Load 'curated' DSPT file -data <- read.csv("/Users/muhammad-faaiz.shanawas/Documents/GitHub/open-cyber/data/DSPT_CCG_21_22_snapshot09_09_22.csv") -data <- data[-107,] +data <- read.csv("./data/DSPT Snapshots/22_23/ICB_dspt_snapshot_17_10_23.csv") -dsptlevels=c("21/22 Standards Exceeded","21/22 Standards Met","21/22 Approaching Standards","21/22 Standards Not Met","21/22 Not Published") +dsptlevels=c("22/23 Standards Exceeded","22/23 Standards Met","22/23 Approaching Standards","22/23 Standards Not Met","22/23 Not Published") # Make Status a categorical data$Short.Status = factor(data$Status,dsptlevels) @@ -52,7 +51,7 @@ data$Short.Status = factor(data$Status,dsptlevels) ## Load STP shapefile # Source: https://geoportal.statistics.gov.uk/datasets/clinical-commissioning-groups-april-2020-full-clipped-boundaries-en/explore?location=52.950000%2C-2.000000%2C7.02 -stp_spdf <- read_sf("/Users/muhammad-faaiz.shanawas/Documents/GitHub/open-cyber/Inputs/shapefile/STP_APR_2021_EN_BUC_V2.shp") +stp_spdf <- read_sf("./Inputs/shapefiles/22_23/ICB_APR_2023_EN_BSC.shp") #proj4string(stp_spdf) <- CRS("+init=epsg:27700") # BNG projection system @@ -62,23 +61,27 @@ stp_spdf <- stp_spdf %>% st_transform(CRS("+init=epsg:4326")) # reproject to lat stp_data = stp_spdf ############################################# -# CCG shapefile +# CCG shapefile #CCGs will not be submitting for 22/23 ############################################# ## Load CCG shapefile -ccg_spdf <- read_sf("/Users/muhammad-faaiz.shanawas/Documents/GitHub/open-cyber/Inputs/shapefile/CCG_APR_2021_EN_BFC.shp") +#ccg_spdf <- read_sf("/Users/muhammad-faaiz.shanawas/Documents/GitHub/open-cyber/Inputs/shapefile/CCG_APR_2021_EN_BFC.shp") #proj4string(ccg_spdf) <- CRS("+init=epsg:27700") # BNG projection system #ccg_spdf@proj4string # check system -ccg_spdf <- ccg_spdf %>% st_transform(CRS("+init=epsg:4326")) # reproject to latlong system +#ccg_spdf <- ccg_spdf %>% st_transform(CRS("+init=epsg:4326")) # reproject to latlong system # Write to shapefile #writeOGR(ccg_spdf, layer = 'myshp_simplified', 'C:/temp', driver="ESRI Shapefile") -region_spdf = read_sf('/Users/muhammad-faaiz.shanawas/Documents/GitHub/open-cyber/Inputs/shapefile/NHS_England_Regions_(April_2020)_Boundaries_EN_BUC.shp') +############################################# +# Load in Region data +############################################# + +region_spdf = read_sf('./Inputs/shapefiles/22_23/NHSER_JUL_2022_EN_BUC.shp') #proj4string(region_spdf) <- CRS("+init=epsg:27700") # BNG projection system #region_spdf@proj4string # check system @@ -104,13 +107,13 @@ region_full <- region_spdf # Create a points shapefile for Trusts ##########+ ##########+################################### -trusts_data = read.csv("/Users/muhammad-faaiz.shanawas/Documents/GitHub/open-cyber/data/DSPT_trusts_21_22_snapshot09_09_22.csv") -trusts_data <- subset(trusts_data, !(ODS.Code %in% c('RBZ', 'RW6', 'RTV'))) +trusts_data = read.csv("./data/DSPT Snapshots/22_23/dspt_trusts_snapshot_17_10_23.csv") %>% select(-c(Organisation.Name.x)) +#trusts_data <- subset(trusts_data, !(ODS.Code %in% c('RBZ', 'RW6', 'RTV'))) trust_spdf_points <- sp::SpatialPointsDataFrame( - coords = trusts_data %>% select(longitude,latitude), - data = trusts_data %>% select(-c(longitude,latitude)), + coords = trusts_data %>% select(long,lat), + data = trusts_data %>% select(-c(long,lat)), proj4string = CRS("+init=epsg:4326") # indicate it is is longitude latitude ) @@ -121,27 +124,14 @@ trust_spdf_points <- sp::SpatialPointsDataFrame( #Further prep ############################################# # Join DSPT data and ONS code -lookupdata = read.csv('/Users/muhammad-faaiz.shanawas/Documents/Github/open-cyber/data/Clinical_Commissioning_Group_to_STPs_(April_2021)_Lookup_in_England.csv') -data_merged = left_join(data, lookupdata, by = c("ODS.Code" = "CCG21CDH")) -data_merged = data_merged[-107,] - - -#load in ccg-stp-region lookup data -regions_lookup = read.csv('/Users/muhammad-faaiz.shanawas/Documents/GitHub/open-cyber/data/Clinical_Commissioning_Group_to_STP_and_NHS_England_(Region)_(April_2021)_Lookup_in_England.csv') -data_regions = unique(select(regions_lookup, 'STP21CD', 'STP21NM', 'NHSER21NM')) - -# Join the reduced DSPT info with the CCG shapefile -ccg_spdf <- left_join(ccg_spdf,data_merged,by=c("CCG21CD"="CCG21CD")) -data_ccg_spdf <- ccg_spdf +lookupdata = read.csv('./data/aux/22_23/Sub_ICB_Locations_to_Integrated_Care_Boards_to_NHS_England_(Region)_(April_2023)_Lookup_in_England (1).csv') +data_merged = left_join(data, lookupdata %>% select(-c(ICB23CD, ICB23NM)), by = c("ICB23CDH" = "ICB23CDH")) +data_merged = data_merged %>% select(-c(X)) -#merge and assign to stp_spdf data -stp_spdfdata = stp_spdf -stp_spdfdata = merge(stp_spdfdata, select(data_regions, 'STP21CD', 'NHSER21NM'), by = "STP21CD", all = TRUE) -#stp_spdfdata = na.omit(stp_spdfdata) -stp_spdf = stp_spdfdata - +#jon the shapefile data with dspt data for ICBs +stp_spdf = left_join(stp_spdf, data_merged %>% select(-c(ICB23NM, Integrated.Care.Board..where.available..from.ODS.)), by = c('ICB23CD')) # Make Status a categorical #ccg_spdf@data$Short.Status = factor(ccg_spdf@data$Short.Status,dsptlevels) @@ -157,18 +147,17 @@ catpal <- colorFactor(my_palette, dsptlevels,reverse=F,ordered=T) ## Plotting # Prepare the text for tooltips: mytext <- paste( - "SUB-ICB 2022 code (ODS): ", ccg_spdf$ICB22CD, "
", - "SUB-ICB 2022 name: ", ccg_spdf$LOC22NM,"
", - "2021 STP name: ", ccg_spdf$STP21NM,"
", - "Region name: ", ccg_spdf$NHSER22NM,"
", - "DSPT Status: ", ccg_spdf$Short.Status, "
", + "ICB 2023 code (ODS): ", stp_spdf$ICB23CD, "
", + "ICB 2023 name: ", stp_spdf$ICB23NM,"
", + "Region name: ", stp_spdf$NHSER23NM,"
", + "DSPT Status: ", stp_spdf$Short.Status, "
", sep="") %>% lapply(htmltools::HTML) -mytext_ics <- paste( - "ICS/STP 2021 code: ", stp_spdf$STP21CD,"
", - "ICS/STP 2021 name: ", stp_spdf$STP21NM,"
", - "Region name: ", stp_spdf$NHSER21NM,"
", + +mytext_region <- paste( + "Region 2023 code: ", region_spdf$NHSER22CD,"
", + "Region 2023 name: ", region_spdf$NHSER22NM,"
", sep="") %>% lapply(htmltools::HTML) @@ -178,7 +167,7 @@ mytext_ics <- paste( # Final Map -m<-leaflet(ccg_spdf) %>% +m<-leaflet(stp_spdf) %>% addTiles() %>% setView( lat=53, lng=-2 , zoom=6) %>% addPolygons( @@ -194,21 +183,22 @@ m<-leaflet(ccg_spdf) %>% direction = "auto" ) ) %>% - addLegend( pal=catpal, values=~Status, opacity=0.9, title = "21/22 DSPT Status (CCG)", position = "bottomleft" ) + addLegend( pal=catpal, values=~Status, opacity=0.9, title = "22/23 ICB Status", position = "bottomleft" ) m + + ############################################# -# Mapping - CCGS + ICS layer +# Mapping - CCGS + ICS + trust layer ############################################# - # https://gis.stackexchange.com/questions/283658/add-layers-with-leaflet-from-different-spatial-data-frames-in-r m02 <- leaflet() %>% addTiles() %>% setView( lat=53, lng=-2 , zoom=6) %>% addPolygons( - data=ccg_spdf, - group = "CCG", + data=stp_spdf, + group = "ICB", fillColor = ~catpal(Status), stroke=TRUE, fillOpacity = 0.7, @@ -222,35 +212,29 @@ m02 <- leaflet() %>% ) ) %>% addPolygons( - data=stp_spdf, - group="ICS boundary", + data=region_spdf, + group="Region boundary", fillOpacity=0.1, color='black', weight=2, - label=mytext_ics + label=mytext_region ) %>% #addLegend( data=ccg_spdf,pal=catpal, values=~Short.Status, opacity=0.9, title = "21/22 DSPT Status (CCG)", position = "bottomleft" ) %>% leaflet::addLayersControl( - overlayGroups = c("CCG","ICS boundary"), # add these layers + overlayGroups = c("ICB","Region boundary"), # add these layers options = layersControlOptions(collapsed = FALSE) # expand on hover? ) %>% hideGroup(c("ICS boundary")) # turn these off by default -m02_l <- m02 %>% addLegend( data=ccg_spdf,pal=catpal, values=~Short.Status, opacity=0.9, title = "21/22 DSPT Status (CCG)", position = "bottomleft" ) - - - -############################################# -# Mapping - CCGS + ICS + trust layer -############################################# +m02_l <- m02 %>% addLegend( data=stp_spdf,pal=catpal, values=~Short.Status, opacity=0.9, title = "22/23 ICB DSPT Status", position = "bottomleft" ) get_popup_content <- function(my_spdf) { paste0( "Provider ", - "
- Provider code:", my_spdf$ODS.Code, + "
- Provider code:", my_spdf$Code, "
- Provider name: ", my_spdf$ODS.Org.Name, #"
- STP/ICS (HQ postcode-based): ", my_spdf$STP20NM, #"
- Region: ", my_spdf$`NHSER20NM`, @@ -261,7 +245,7 @@ get_popup_content <- function(my_spdf) { -m03 <- m02_l %>% +m03 <- m %>% addCircleMarkers(data=trust_spdf_points, group="Trusts", label = ~ lapply(get_popup_content(trust_spdf_points), htmltools::HTML), @@ -273,7 +257,7 @@ m03 <- m02_l %>% #clusterOptions = markerClusterOptions(), radius= 6) -#m03 +m03 #adding the zoom toggle for trust level (trust layer appears between 9 and 20) #m03 <- m03 %>% @@ -281,9 +265,9 @@ m03 <- m02_l %>% #adding legend and layering CCG trusts and ICG boundary together m03 <- m03 %>% - addLegend( data=trust_spdf_points,pal=catpal, values=~Status, opacity=0.9, title = "21/22 DSPT Status (trust)", position = "bottomright" ) %>% + addLegend( data=trust_spdf_points,pal=catpal, values=~Status, opacity=0.9, title = "22/23 Trusts DSPT Status", position = "bottomright" ) %>% leaflet::addLayersControl( - overlayGroups = c("ICS boundary","CCG","Trusts"), # add these layers + overlayGroups = c("ICS boundary","Trusts"), # add these layers options = layersControlOptions(collapsed = FALSE) # expand on hover? ) %>% hideGroup(c("ICS boundary","Trusts")) # turn these off by default diff --git a/20_21.md b/20_21.md new file mode 100644 index 0000000..c02a807 --- /dev/null +++ b/20_21.md @@ -0,0 +1,128 @@ + + +# Open Statistics - Cyber Security + + +
+

+ Important: +

+

This project is currently in development. An overview of methodology and caveats are given below. For more information please contact analytics-unit@nhsx.nhs.uk.
Opinions expressed in this page are not representative of the views of NHS England and any content here should not be regarded as official output in any form. For more information about the NHS England Transformation Directorate please visit our official website. +

+
+ +The Data Security and Protection Toolkit is an online self-assessment tool that allows organisations to measure their performance against the National Data Guardian’s 10 data security standards. + +All organisations that have access to NHS patient data and systems must use this toolkit to provide assurance that they are practising good data security and that personal information is handled correctly. This includes trusts, commissioners and CSUs. + +The following information displays data taken from a specific snapshot of the DSPT data. The latest status information was downloaded on the 8th February 2022. + +For more information on the Data Security and Protection Toolkit, please visit the DSPT portal. + +
+ +## Notes on Methodology + +Composite Metrics for ICS + +The DSPT status for Clinical Commissioning Groups (CCGs) and Trusts are coded (scored) as follows to create the proxy for Integrated Care System (ICS) summary metrics: + +
  • Status Exceeded = 3
  • +
  • Status Met = 1
  • +
  • Approaching Standards = -1
  • +
  • Not Published/Not Met = -3
  • +
    +CCG scores within an ICS are then weighted based on the resident population. + +Trust scores within an ICS are weighted either a) as simple average or b) based on their EPRR score. + +Finally, for each ICS, the CCG and Trust scores are weighted equally to arrive at the ICS composite score. + +The final scaling for each of the summary metrics displayed will have an upper bound of 3 and a lower bound of -3. + + +## Summary of DSPT Compliance (2020/2021 edition). +
    +Summary statistics from the DSPT 2020/21 toolkit are shown. + +{% include data_DSPTmetric2022-02-08.html %} + + + +
    + + +## CCGs and Trusts - Individual Compliance +
    +The compliance of individual CCGs and Trusts are mapped below, with ICS boundaries. Toggle the boxes on the top right-hand side to add layers. + + + +
    + + + +## CCGs and Proportions of Trusts Compliance - Colour Coded Population +
    +The proportions of trust compliance within each ICS with boundaries (in black) are shown. The ICSs are colored to represent the patient population level. The darker the shade of blue the higher the patient population level. + + + +
    + + +## ICSs Composite Compliance - CCG and Trust Score Average Weighted For Population +
    +The compliance of individual ICSs, made up of a composite score of 50% CCG scores which have been weighted for population and 50% of a simple average of Trust scores. Region boundaries are displayed in blue. + + +
    + +
    + +
    +Template for end-to-end open source analytics: [github.io](https://pages.github.com/), and [github actions](https://github.com/features/actions). + +Analytics leverages open source data and R libraries such as [leaflet](https://cran.r-project.org/web/packages/leaflet/index.html) for interactive maps, [plotly](https://plotly.com/r/) for other interactive visualisations and [summarytools](https://cran.r-project.org/web/packages/summarytools/vignettes/introduction.html) for descriptive statistics. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..26a931f --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# open-analytics-template + [NHS.UK](https://service-manual.nhs.uk/) themed template for open analytics projects. Build your own open source end-to-end analytical tool using python, plotly, github.io, and github actions. + +Example page deployed here: [[GitHub.io](https://nhsx.github.io/open-analytics-template/)] + +Used in the following projects: + - [Open Source Healthcare Statistics](https://nhsx.github.io/open-health-statistics/) [[GitHub](https://github.com/nhsx/open-health-statistics)] + - [NHSX Publications from PubMed API](nhsx.github.io/nhsx-publications) [[GitHub](https://github.com/nhsx/nhsx-publications)] (in development) + - [Digital Health Insights](https://nhsx.github.io/digital-health-insights/) [[GitHub](https://github.com/nhsx/digital-health-insights)] (in development) + - [The Prescribing Cost of Antibiotics](https://mattia-ficarelli.github.io/antibiotic_cost/) [[GitHub](https://github.com/mattia-ficarelli/antibiotic_cost)] + - [Number of Patients Registered at GP Practices in London](https://mattia-ficarelli.github.io/gp_mapping/) [[GitHub](https://github.com/mattia-ficarelli/gp_mapping)] diff --git a/dspt_data_cuts_curation_22_23.ipynb b/dspt_data_cuts_curation_22_23.ipynb new file mode 100644 index 0000000..3a4523c --- /dev/null +++ b/dspt_data_cuts_curation_22_23.ipynb @@ -0,0 +1,2950 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import geopandas\n", + "from geopy.geocoders import Nominatim" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    CodeOrganisation NameStatusDate Of PublicationPrimary SectorIntegrated Care Board (where available, from ODS)
    000LNHS NORTH EAST AND NORTH CUMBRIA ICB - 00L (CCG)21/22 Standards Met30/06/2022CCG / Integrated Care Board (ICB)NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA...
    100NNHS NORTH EAST AND NORTH CUMBRIA ICB - 00N (CCG)21/22 Standards Met30/06/2022CCG / Integrated Care Board (ICB)NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA...
    200PNHS NORTH EAST AND NORTH CUMBRIA ICB - 00P (CCG)21/22 Standards Met28/06/2022CCG / Integrated Care Board (ICB)NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA...
    300QNHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00Q (CCG)21/22 Standards Met22/06/2022CCG / Integrated Care Board (ICB)NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA...
    400RNHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00R (CCG)21/22 Standards Met29/06/2022CCG / Integrated Care Board (ICB)NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA...
    \n", + "
    " + ], + "text/plain": [ + " Code Organisation Name Status \\\n", + "0 00L NHS NORTH EAST AND NORTH CUMBRIA ICB - 00L (CCG) 21/22 Standards Met \n", + "1 00N NHS NORTH EAST AND NORTH CUMBRIA ICB - 00N (CCG) 21/22 Standards Met \n", + "2 00P NHS NORTH EAST AND NORTH CUMBRIA ICB - 00P (CCG) 21/22 Standards Met \n", + "3 00Q NHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00Q (CCG) 21/22 Standards Met \n", + "4 00R NHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00R (CCG) 21/22 Standards Met \n", + "\n", + " Date Of Publication Primary Sector \\\n", + "0 30/06/2022 CCG / Integrated Care Board (ICB) \n", + "1 30/06/2022 CCG / Integrated Care Board (ICB) \n", + "2 28/06/2022 CCG / Integrated Care Board (ICB) \n", + "3 22/06/2022 CCG / Integrated Care Board (ICB) \n", + "4 29/06/2022 CCG / Integrated Care Board (ICB) \n", + "\n", + " Integrated Care Board (where available, from ODS) \n", + "0 NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA... \n", + "1 NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA... \n", + "2 NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA... \n", + "3 NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA... \n", + "4 NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA... " + ] + }, + "execution_count": 68, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#load in latest dspt snapshot\n", + "dspt_snapshot = pd.read_csv('data/DSPT Snapshots/22_23/DSPT search results 17_10_2023 08_55_43.csv')\n", + "dspt_snapshot.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    CodeOrganisation NameNational GroupingHigh Level Health Geography
    000LNHS NORTH EAST AND NORTH CUMBRIA ICB - 00LY63QHM
    100NNHS NORTH EAST AND NORTH CUMBRIA ICB - 00NY63QHM
    200PNHS NORTH EAST AND NORTH CUMBRIA ICB - 00PY63QHM
    300QNHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00QY62QE1
    400RNHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00RY62QE1
    ...............
    117D9Y0VNHS HAMPSHIRE AND ISLE OF WIGHT ICB - D9Y0VY59QRL
    118M1J4YNHS BEDFORDSHIRE, LUTON AND MILTON KEYNES ICB ...Y61QHG
    119M2L0MNHS SHROPSHIRE, TELFORD AND WREKIN ICB - M2L0MY60QOC
    120W2U3ZNHS NORTH WEST LONDON ICB - W2U3ZY56QRV
    121X2C4YNHS WEST YORKSHIRE ICB - X2C4YY63QWO
    \n", + "

    106 rows × 4 columns

    \n", + "
    " + ], + "text/plain": [ + " Code Organisation Name \\\n", + "0 00L NHS NORTH EAST AND NORTH CUMBRIA ICB - 00L \n", + "1 00N NHS NORTH EAST AND NORTH CUMBRIA ICB - 00N \n", + "2 00P NHS NORTH EAST AND NORTH CUMBRIA ICB - 00P \n", + "3 00Q NHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00Q \n", + "4 00R NHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00R \n", + ".. ... ... \n", + "117 D9Y0V NHS HAMPSHIRE AND ISLE OF WIGHT ICB - D9Y0V \n", + "118 M1J4Y NHS BEDFORDSHIRE, LUTON AND MILTON KEYNES ICB ... \n", + "119 M2L0M NHS SHROPSHIRE, TELFORD AND WREKIN ICB - M2L0M \n", + "120 W2U3Z NHS NORTH WEST LONDON ICB - W2U3Z \n", + "121 X2C4Y NHS WEST YORKSHIRE ICB - X2C4Y \n", + "\n", + " National Grouping High Level Health Geography \n", + "0 Y63 QHM \n", + "1 Y63 QHM \n", + "2 Y63 QHM \n", + "3 Y62 QE1 \n", + "4 Y62 QE1 \n", + ".. ... ... \n", + "117 Y59 QRL \n", + "118 Y61 QHG \n", + "119 Y60 QOC \n", + "120 Y56 QRV \n", + "121 Y63 QWO \n", + "\n", + "[106 rows x 4 columns]" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eccg" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "metadata": {}, + "outputs": [], + "source": [ + "#load in auxillary data for left joining and filtering active locations \n", + "#for ccg's (eccg)\n", + "eccg = pd.read_csv('data/aux/22_23/eccg.csv', header = None)\n", + "eccg = eccg.loc[eccg[13] == 'C'][[0, 2, 3]]\n", + "eccg.columns = ['Code', 'National Grouping', 'High Level Health Geography']" + ] + }, + { + "cell_type": "code", + "execution_count": 102, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    CodeOrganisation NameStatusDate Of PublicationPrimary SectorIntegrated Care Board (where available, from ODS)National GroupingHigh Level Health Geography
    000LNHS NORTH EAST AND NORTH CUMBRIA ICB - 00L (CCG)21/22 Standards Met30/06/2022CCG / Integrated Care Board (ICB)NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA...Y63QHM
    100NNHS NORTH EAST AND NORTH CUMBRIA ICB - 00N (CCG)21/22 Standards Met30/06/2022CCG / Integrated Care Board (ICB)NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA...Y63QHM
    200PNHS NORTH EAST AND NORTH CUMBRIA ICB - 00P (CCG)21/22 Standards Met28/06/2022CCG / Integrated Care Board (ICB)NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA...Y63QHM
    300QNHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00Q (CCG)21/22 Standards Met22/06/2022CCG / Integrated Care Board (ICB)NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA...Y62QE1
    400RNHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00R (CCG)21/22 Standards Met29/06/2022CCG / Integrated Care Board (ICB)NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA...Y62QE1
    ...........................
    101D9Y0VNHS HAMPSHIRE AND ISLE OF WIGHT ICB - D9Y0V (CCG)21/22 Standards Exceeded30/06/2022CCG / Integrated Care Board (ICB)NHS HAMPSHIRE AND ISLE OF WIGHT INTEGRATED CAR...Y59QRL
    102M1J4YNHS BEDFORDSHIRE, LUTON AND MILTON KEYNES ICB ...21/22 Standards Met29/06/2022CCG / Integrated Care Board (ICB)NHS BEDFORDSHIRE, LUTON AND MILTON KEYNES INTE...Y61QHG
    103M2L0MNHS SHROPSHIRE, TELFORD AND WREKIN ICB - M2L0M...21/22 Standards Met25/03/2022CCG / Integrated Care Board (ICB)NHS SHROPSHIRE, TELFORD AND WREKIN INTEGRATED ...Y60QOC
    104W2U3ZNHS NORTH WEST LONDON ICB - W2U3Z (CCG)21/22 Standards Exceeded27/06/2022CCG / Integrated Care Board (ICB)NHS NORTH WEST LONDON INTEGRATED CARE BOARDY56QRV
    105X2C4YNHS WEST YORKSHIRE ICB - X2C4Y (CCG)21/22 Standards Met28/06/2022CCG / Integrated Care Board (ICB)NHS WEST YORKSHIRE INTEGRATED CARE BOARDY63QWO
    \n", + "

    106 rows × 8 columns

    \n", + "
    " + ], + "text/plain": [ + " Code Organisation Name \\\n", + "0 00L NHS NORTH EAST AND NORTH CUMBRIA ICB - 00L (CCG) \n", + "1 00N NHS NORTH EAST AND NORTH CUMBRIA ICB - 00N (CCG) \n", + "2 00P NHS NORTH EAST AND NORTH CUMBRIA ICB - 00P (CCG) \n", + "3 00Q NHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00Q (CCG) \n", + "4 00R NHS LANCASHIRE AND SOUTH CUMBRIA ICB - 00R (CCG) \n", + ".. ... ... \n", + "101 D9Y0V NHS HAMPSHIRE AND ISLE OF WIGHT ICB - D9Y0V (CCG) \n", + "102 M1J4Y NHS BEDFORDSHIRE, LUTON AND MILTON KEYNES ICB ... \n", + "103 M2L0M NHS SHROPSHIRE, TELFORD AND WREKIN ICB - M2L0M... \n", + "104 W2U3Z NHS NORTH WEST LONDON ICB - W2U3Z (CCG) \n", + "105 X2C4Y NHS WEST YORKSHIRE ICB - X2C4Y (CCG) \n", + "\n", + " Status Date Of Publication \\\n", + "0 21/22 Standards Met 30/06/2022 \n", + "1 21/22 Standards Met 30/06/2022 \n", + "2 21/22 Standards Met 28/06/2022 \n", + "3 21/22 Standards Met 22/06/2022 \n", + "4 21/22 Standards Met 29/06/2022 \n", + ".. ... ... \n", + "101 21/22 Standards Exceeded 30/06/2022 \n", + "102 21/22 Standards Met 29/06/2022 \n", + "103 21/22 Standards Met 25/03/2022 \n", + "104 21/22 Standards Exceeded 27/06/2022 \n", + "105 21/22 Standards Met 28/06/2022 \n", + "\n", + " Primary Sector \\\n", + "0 CCG / Integrated Care Board (ICB) \n", + "1 CCG / Integrated Care Board (ICB) \n", + "2 CCG / Integrated Care Board (ICB) \n", + "3 CCG / Integrated Care Board (ICB) \n", + "4 CCG / Integrated Care Board (ICB) \n", + ".. ... \n", + "101 CCG / Integrated Care Board (ICB) \n", + "102 CCG / Integrated Care Board (ICB) \n", + "103 CCG / Integrated Care Board (ICB) \n", + "104 CCG / Integrated Care Board (ICB) \n", + "105 CCG / Integrated Care Board (ICB) \n", + "\n", + " Integrated Care Board (where available, from ODS) National Grouping \\\n", + "0 NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA... Y63 \n", + "1 NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA... Y63 \n", + "2 NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA... Y63 \n", + "3 NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA... Y62 \n", + "4 NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA... Y62 \n", + ".. ... ... \n", + "101 NHS HAMPSHIRE AND ISLE OF WIGHT INTEGRATED CAR... Y59 \n", + "102 NHS BEDFORDSHIRE, LUTON AND MILTON KEYNES INTE... Y61 \n", + "103 NHS SHROPSHIRE, TELFORD AND WREKIN INTEGRATED ... Y60 \n", + "104 NHS NORTH WEST LONDON INTEGRATED CARE BOARD Y56 \n", + "105 NHS WEST YORKSHIRE INTEGRATED CARE BOARD Y63 \n", + "\n", + " High Level Health Geography \n", + "0 QHM \n", + "1 QHM \n", + "2 QHM \n", + "3 QE1 \n", + "4 QE1 \n", + ".. ... \n", + "101 QRL \n", + "102 QHG \n", + "103 QOC \n", + "104 QRV \n", + "105 QWO \n", + "\n", + "[106 rows x 8 columns]" + ] + }, + "execution_count": 102, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dspt_ccg = dspt_snapshot.merge(eccg, on = 'Code')\n", + "dspt_ccg" + ] + }, + { + "cell_type": "code", + "execution_count": 104, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    CodeOrganisation NameStatusDate Of PublicationPrimary SectorIntegrated Care Board (where available, from ODS)National GroupingHigh Level Health Geography
    \n", + "
    " + ], + "text/plain": [ + "Empty DataFrame\n", + "Columns: [Code, Organisation Name, Status, Date Of Publication, Primary Sector, Integrated Care Board (where available, from ODS), National Grouping, High Level Health Geography]\n", + "Index: []" + ] + }, + "execution_count": 104, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dspt_ccg.loc[dspt_ccg['Code']== 'C00A']" + ] + }, + { + "cell_type": "code", + "execution_count": 103, + "metadata": {}, + "outputs": [], + "source": [ + "dspt_ccg.to_csv('data/DSPT Snapshots/22_23/ccg_dspt_snapshot_17_10_23.csv')" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    0123456789
    0R0AMANCHESTER UNIVERSITY NHS FOUNDATION TRUSTY62QOPCOBBETT HOUSEOXFORD ROADNaNMANCHESTERNaNM13 9WL
    1R0BSOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T...Y63QHMSUNDERLAND ROYAL HOSPITALKAYLL ROADNaNSUNDERLANDNaNSR4 7TP
    2R0DUNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUSTY58QVVMANAGEMENT OFFICESPOOLE HOSPITALLONGFLEET ROADPOOLENaNBH15 2JB
    3R1AHEREFORDSHIRE AND WORCESTERSHIRE HEALTH AND CA...Y60QGHUNIT 2 KINGS COURTCHARLES HASTINGS WAYNaNWORCESTERNaNWR5 1JR
    4R1CSOLENT NHS TRUSTY59QRLSOLENT NHS TRUST HEADQUARTERSHIGHPOINT VENUEBURSLEDON ROADSOUTHAMPTONNaNSO19 8BR
    .................................
    210RYYKENT COMMUNITY HEALTH NHS FOUNDATION TRUSTY59QKSTRINITY HOUSE110-120 EUREKA PARKEUREKA BUSINESS PARKASHFORDKENTTN25 4AZ
    0TADBRADFORD DISTRICT CARE NHS FOUNDATION TRUSTY63QWONEW MILLVICTORIA ROADSALTAIRESHIPLEYNaNBD18 3LD
    1TAFCAMDEN AND ISLINGTON NHS FOUNDATION TRUSTY56QMJST PANCRAS HOSPITAL4 ST PANCRAS WAYNaNLONDONNaNNW1 0PE
    2TAHSHEFFIELD HEALTH & SOCIAL CARE NHS FOUNDATION ...Y63QF7CENTRE COURTATLAS WAYNaNSHEFFIELDNaNS4 7QQ
    3TAJBLACK COUNTRY HEALTHCARE NHS FOUNDATION TRUSTY60QUATRAFALGAR HOUSE47-49 KING STREETNaNDUDLEYNaNDY2 8PS
    \n", + "

    215 rows × 10 columns

    \n", + "
    " + ], + "text/plain": [ + " 0 1 2 3 \\\n", + "0 R0A MANCHESTER UNIVERSITY NHS FOUNDATION TRUST Y62 QOP \n", + "1 R0B SOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T... Y63 QHM \n", + "2 R0D UNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUST Y58 QVV \n", + "3 R1A HEREFORDSHIRE AND WORCESTERSHIRE HEALTH AND CA... Y60 QGH \n", + "4 R1C SOLENT NHS TRUST Y59 QRL \n", + ".. ... ... ... ... \n", + "210 RYY KENT COMMUNITY HEALTH NHS FOUNDATION TRUST Y59 QKS \n", + "0 TAD BRADFORD DISTRICT CARE NHS FOUNDATION TRUST Y63 QWO \n", + "1 TAF CAMDEN AND ISLINGTON NHS FOUNDATION TRUST Y56 QMJ \n", + "2 TAH SHEFFIELD HEALTH & SOCIAL CARE NHS FOUNDATION ... Y63 QF7 \n", + "3 TAJ BLACK COUNTRY HEALTHCARE NHS FOUNDATION TRUST Y60 QUA \n", + "\n", + " 4 5 \\\n", + "0 COBBETT HOUSE OXFORD ROAD \n", + "1 SUNDERLAND ROYAL HOSPITAL KAYLL ROAD \n", + "2 MANAGEMENT OFFICES POOLE HOSPITAL \n", + "3 UNIT 2 KINGS COURT CHARLES HASTINGS WAY \n", + "4 SOLENT NHS TRUST HEADQUARTERS HIGHPOINT VENUE \n", + ".. ... ... \n", + "210 TRINITY HOUSE 110-120 EUREKA PARK \n", + "0 NEW MILL VICTORIA ROAD \n", + "1 ST PANCRAS HOSPITAL 4 ST PANCRAS WAY \n", + "2 CENTRE COURT ATLAS WAY \n", + "3 TRAFALGAR HOUSE 47-49 KING STREET \n", + "\n", + " 6 7 8 9 \n", + "0 NaN MANCHESTER NaN M13 9WL \n", + "1 NaN SUNDERLAND NaN SR4 7TP \n", + "2 LONGFLEET ROAD POOLE NaN BH15 2JB \n", + "3 NaN WORCESTER NaN WR5 1JR \n", + "4 BURSLEDON ROAD SOUTHAMPTON NaN SO19 8BR \n", + ".. ... ... ... ... \n", + "210 EUREKA BUSINESS PARK ASHFORD KENT TN25 4AZ \n", + "0 SALTAIRE SHIPLEY NaN BD18 3LD \n", + "1 NaN LONDON NaN NW1 0PE \n", + "2 NaN SHEFFIELD NaN S4 7QQ \n", + "3 NaN DUDLEY NaN DY2 8PS \n", + "\n", + "[215 rows x 10 columns]" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#load in auxillary trust data (etr and ect and merge)\n", + "etr = pd.read_csv('data/aux/22_23/etr.csv', header=None)\n", + "ect = pd.read_csv('data/aux/22_23/ect.csv', header=None)\n", + "trusts_combined = pd.concat([etr, ect])[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]\n", + "trusts_combined" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    CodeOrganisation NameNational GroupingHigh Level Health GeographyAddress Line 1Address Line 2Address Line 3Address Line 4Address Line 5Post Code
    0R0AMANCHESTER UNIVERSITY NHS FOUNDATION TRUSTY62QOPCOBBETT HOUSEOXFORD ROADNaNMANCHESTERNaNM13 9WL
    1R0BSOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T...Y63QHMSUNDERLAND ROYAL HOSPITALKAYLL ROADNaNSUNDERLANDNaNSR4 7TP
    2R0DUNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUSTY58QVVMANAGEMENT OFFICESPOOLE HOSPITALLONGFLEET ROADPOOLENaNBH15 2JB
    3R1AHEREFORDSHIRE AND WORCESTERSHIRE HEALTH AND CA...Y60QGHUNIT 2 KINGS COURTCHARLES HASTINGS WAYNaNWORCESTERNaNWR5 1JR
    4R1CSOLENT NHS TRUSTY59QRLSOLENT NHS TRUST HEADQUARTERSHIGHPOINT VENUEBURSLEDON ROADSOUTHAMPTONNaNSO19 8BR
    .................................
    210RYYKENT COMMUNITY HEALTH NHS FOUNDATION TRUSTY59QKSTRINITY HOUSE110-120 EUREKA PARKEUREKA BUSINESS PARKASHFORDKENTTN25 4AZ
    211TADBRADFORD DISTRICT CARE NHS FOUNDATION TRUSTY63QWONEW MILLVICTORIA ROADSALTAIRESHIPLEYNaNBD18 3LD
    212TAFCAMDEN AND ISLINGTON NHS FOUNDATION TRUSTY56QMJST PANCRAS HOSPITAL4 ST PANCRAS WAYNaNLONDONNaNNW1 0PE
    213TAHSHEFFIELD HEALTH & SOCIAL CARE NHS FOUNDATION ...Y63QF7CENTRE COURTATLAS WAYNaNSHEFFIELDNaNS4 7QQ
    214TAJBLACK COUNTRY HEALTHCARE NHS FOUNDATION TRUSTY60QUATRAFALGAR HOUSE47-49 KING STREETNaNDUDLEYNaNDY2 8PS
    \n", + "

    215 rows × 10 columns

    \n", + "
    " + ], + "text/plain": [ + " Code Organisation Name National Grouping \\\n", + "0 R0A MANCHESTER UNIVERSITY NHS FOUNDATION TRUST Y62 \n", + "1 R0B SOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T... Y63 \n", + "2 R0D UNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUST Y58 \n", + "3 R1A HEREFORDSHIRE AND WORCESTERSHIRE HEALTH AND CA... Y60 \n", + "4 R1C SOLENT NHS TRUST Y59 \n", + ".. ... ... ... \n", + "210 RYY KENT COMMUNITY HEALTH NHS FOUNDATION TRUST Y59 \n", + "211 TAD BRADFORD DISTRICT CARE NHS FOUNDATION TRUST Y63 \n", + "212 TAF CAMDEN AND ISLINGTON NHS FOUNDATION TRUST Y56 \n", + "213 TAH SHEFFIELD HEALTH & SOCIAL CARE NHS FOUNDATION ... Y63 \n", + "214 TAJ BLACK COUNTRY HEALTHCARE NHS FOUNDATION TRUST Y60 \n", + "\n", + " High Level Health Geography Address Line 1 \\\n", + "0 QOP COBBETT HOUSE \n", + "1 QHM SUNDERLAND ROYAL HOSPITAL \n", + "2 QVV MANAGEMENT OFFICES \n", + "3 QGH UNIT 2 KINGS COURT \n", + "4 QRL SOLENT NHS TRUST HEADQUARTERS \n", + ".. ... ... \n", + "210 QKS TRINITY HOUSE \n", + "211 QWO NEW MILL \n", + "212 QMJ ST PANCRAS HOSPITAL \n", + "213 QF7 CENTRE COURT \n", + "214 QUA TRAFALGAR HOUSE \n", + "\n", + " Address Line 2 Address Line 3 Address Line 4 Address Line 5 \\\n", + "0 OXFORD ROAD NaN MANCHESTER NaN \n", + "1 KAYLL ROAD NaN SUNDERLAND NaN \n", + "2 POOLE HOSPITAL LONGFLEET ROAD POOLE NaN \n", + "3 CHARLES HASTINGS WAY NaN WORCESTER NaN \n", + "4 HIGHPOINT VENUE BURSLEDON ROAD SOUTHAMPTON NaN \n", + ".. ... ... ... ... \n", + "210 110-120 EUREKA PARK EUREKA BUSINESS PARK ASHFORD KENT \n", + "211 VICTORIA ROAD SALTAIRE SHIPLEY NaN \n", + "212 4 ST PANCRAS WAY NaN LONDON NaN \n", + "213 ATLAS WAY NaN SHEFFIELD NaN \n", + "214 47-49 KING STREET NaN DUDLEY NaN \n", + "\n", + " Post Code \n", + "0 M13 9WL \n", + "1 SR4 7TP \n", + "2 BH15 2JB \n", + "3 WR5 1JR \n", + "4 SO19 8BR \n", + ".. ... \n", + "210 TN25 4AZ \n", + "211 BD18 3LD \n", + "212 NW1 0PE \n", + "213 S4 7QQ \n", + "214 DY2 8PS \n", + "\n", + "[215 rows x 10 columns]" + ] + }, + "execution_count": 62, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trusts_combined.columns = ['Code', 'Organisation Name', 'National Grouping', 'High Level Health Geography', 'Address Line 1', 'Address Line 2', 'Address Line 3', 'Address Line 4', 'Address Line 5', 'Post Code']\n", + "trusts_combined = trusts_combined.reset_index(drop=True)\n", + "trusts_combined" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "51.5261799" + ] + }, + "execution_count": 75, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "locator = Nominatim(user_agent = 'myGeocoder')\n", + "location = locator.geocode('E6 3NR')\n", + "location.latitude" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "lat = []\n", + "long = []\n", + "for i in list(trusts_combined['Post Code']):\n", + " lat.append(locator.geocode(i).latitude)\n", + " long.append(locator.geocode(i).longitude)\n", + "\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/var/folders/kt/92wnzvcj6qq_r6j3j19yp5lw0000gp/T/ipykernel_16494/1499399131.py:2: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + " trusts_combined['lat'] = lat\n", + "/var/folders/kt/92wnzvcj6qq_r6j3j19yp5lw0000gp/T/ipykernel_16494/1499399131.py:3: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + " trusts_combined['long'] = long\n" + ] + } + ], + "source": [ + "trusts_combined = trusts_combined[['Code', 'Organisation Name', 'National Grouping', 'High Level Health Geography']]\n", + "trusts_combined['lat'] = lat\n", + "trusts_combined['long'] = long" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    CodeOrganisation NameNational GroupingHigh Level Health Geographylatlong
    0R0AMANCHESTER UNIVERSITY NHS FOUNDATION TRUSTY62QOP53.462440-2.227710
    1R0BSOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T...Y63QHM54.902770-1.408705
    2R0DUNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUSTY58QVV50.721389-1.972792
    3R1AHEREFORDSHIRE AND WORCESTERSHIRE HEALTH AND CA...Y60QGH52.192162-2.179038
    4R1CSOLENT NHS TRUSTY59QRL50.901607-1.329799
    .....................
    210RYYKENT COMMUNITY HEALTH NHS FOUNDATION TRUSTY59QKS51.1716530.870975
    211TADBRADFORD DISTRICT CARE NHS FOUNDATION TRUSTY63QWO53.839670-1.788610
    212TAFCAMDEN AND ISLINGTON NHS FOUNDATION TRUSTY56QMJ51.535866-0.131679
    213TAHSHEFFIELD HEALTH & SOCIAL CARE NHS FOUNDATION ...Y63QF753.399947-1.440936
    214TAJBLACK COUNTRY HEALTHCARE NHS FOUNDATION TRUSTY60QUA52.508420-2.084500
    \n", + "

    215 rows × 6 columns

    \n", + "
    " + ], + "text/plain": [ + " Code Organisation Name National Grouping \\\n", + "0 R0A MANCHESTER UNIVERSITY NHS FOUNDATION TRUST Y62 \n", + "1 R0B SOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T... Y63 \n", + "2 R0D UNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUST Y58 \n", + "3 R1A HEREFORDSHIRE AND WORCESTERSHIRE HEALTH AND CA... Y60 \n", + "4 R1C SOLENT NHS TRUST Y59 \n", + ".. ... ... ... \n", + "210 RYY KENT COMMUNITY HEALTH NHS FOUNDATION TRUST Y59 \n", + "211 TAD BRADFORD DISTRICT CARE NHS FOUNDATION TRUST Y63 \n", + "212 TAF CAMDEN AND ISLINGTON NHS FOUNDATION TRUST Y56 \n", + "213 TAH SHEFFIELD HEALTH & SOCIAL CARE NHS FOUNDATION ... Y63 \n", + "214 TAJ BLACK COUNTRY HEALTHCARE NHS FOUNDATION TRUST Y60 \n", + "\n", + " High Level Health Geography lat long \n", + "0 QOP 53.462440 -2.227710 \n", + "1 QHM 54.902770 -1.408705 \n", + "2 QVV 50.721389 -1.972792 \n", + "3 QGH 52.192162 -2.179038 \n", + "4 QRL 50.901607 -1.329799 \n", + ".. ... ... ... \n", + "210 QKS 51.171653 0.870975 \n", + "211 QWO 53.839670 -1.788610 \n", + "212 QMJ 51.535866 -0.131679 \n", + "213 QF7 53.399947 -1.440936 \n", + "214 QUA 52.508420 -2.084500 \n", + "\n", + "[215 rows x 6 columns]" + ] + }, + "execution_count": 80, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trusts_combined" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    CodeOrganisation Name_xNational GroupingHigh Level Health GeographylatlongOrganisation Name_yStatusDate Of PublicationPrimary SectorIntegrated Care Board (where available, from ODS)
    0R0AMANCHESTER UNIVERSITY NHS FOUNDATION TRUSTY62QOP53.462440-2.227710MANCHESTER UNIVERSITY NHS FOUNDATION TRUST22/23 Standards Met30/06/2023NHS TrustNHS GREATER MANCHESTER INTEGRATED CARE BOARD
    1R0BSOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T...Y63QHM54.902770-1.408705SOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T...22/23 Standards Exceeded15/06/2023NHS TrustNHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA...
    2R0DUNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUSTY58QVV50.721389-1.972792UNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUST22/23 Approaching Standards30/06/2023NHS TrustNHS DORSET INTEGRATED CARE BOARD
    3R1AHEREFORDSHIRE AND WORCESTERSHIRE HEALTH AND CA...Y60QGH52.192162-2.179038Herefordshire and Worcestershire Health and Ca...22/23 Standards Exceeded05/06/2023NHS TrustNHS HEREFORDSHIRE AND WORCESTERSHIRE INTEGRATE...
    4R1CSOLENT NHS TRUSTY59QRL50.901607-1.329799Solent NHS Trust22/23 Standards Met30/06/2023NHS TrustNHS HAMPSHIRE AND ISLE OF WIGHT INTEGRATED CAR...
    ....................................
    208RYYKENT COMMUNITY HEALTH NHS FOUNDATION TRUSTY59QKS51.1716530.870975Kent Community Health NHS Foundation Trust22/23 Standards Met27/06/2023NHS TrustNHS KENT AND MEDWAY INTEGRATED CARE BOARD
    209TADBRADFORD DISTRICT CARE NHS FOUNDATION TRUSTY63QWO53.839670-1.788610BRADFORD DISTRICT CARE NHS FOUNDATION TRUST22/23 Standards Met29/06/2023NHS TrustNHS WEST YORKSHIRE INTEGRATED CARE BOARD
    210TAFCAMDEN AND ISLINGTON NHS FOUNDATION TRUSTY56QMJ51.535866-0.131679CAMDEN AND ISLINGTON NHS FOUNDATION TRUST22/23 Approaching Standards29/06/2023NHS TrustNHS NORTH CENTRAL LONDON INTEGRATED CARE BOARD
    211TAHSHEFFIELD HEALTH & SOCIAL CARE NHS FOUNDATION ...Y63QF753.399947-1.440936Sheffield Health & Social Care NHS Foundation ...22/23 Approaching Standards30/06/2023NHS TrustNHS SOUTH YORKSHIRE INTEGRATED CARE BOARD
    212TAJBLACK COUNTRY HEALTHCARE NHS FOUNDATION TRUSTY60QUA52.508420-2.084500Black Country Healthcare NHS Foundation Trust22/23 Approaching Standards30/06/2023NHS TrustNHS BLACK COUNTRY INTEGRATED CARE BOARD
    \n", + "

    213 rows × 11 columns

    \n", + "
    " + ], + "text/plain": [ + " Code Organisation Name_x National Grouping \\\n", + "0 R0A MANCHESTER UNIVERSITY NHS FOUNDATION TRUST Y62 \n", + "1 R0B SOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T... Y63 \n", + "2 R0D UNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUST Y58 \n", + "3 R1A HEREFORDSHIRE AND WORCESTERSHIRE HEALTH AND CA... Y60 \n", + "4 R1C SOLENT NHS TRUST Y59 \n", + ".. ... ... ... \n", + "208 RYY KENT COMMUNITY HEALTH NHS FOUNDATION TRUST Y59 \n", + "209 TAD BRADFORD DISTRICT CARE NHS FOUNDATION TRUST Y63 \n", + "210 TAF CAMDEN AND ISLINGTON NHS FOUNDATION TRUST Y56 \n", + "211 TAH SHEFFIELD HEALTH & SOCIAL CARE NHS FOUNDATION ... Y63 \n", + "212 TAJ BLACK COUNTRY HEALTHCARE NHS FOUNDATION TRUST Y60 \n", + "\n", + " High Level Health Geography lat long \\\n", + "0 QOP 53.462440 -2.227710 \n", + "1 QHM 54.902770 -1.408705 \n", + "2 QVV 50.721389 -1.972792 \n", + "3 QGH 52.192162 -2.179038 \n", + "4 QRL 50.901607 -1.329799 \n", + ".. ... ... ... \n", + "208 QKS 51.171653 0.870975 \n", + "209 QWO 53.839670 -1.788610 \n", + "210 QMJ 51.535866 -0.131679 \n", + "211 QF7 53.399947 -1.440936 \n", + "212 QUA 52.508420 -2.084500 \n", + "\n", + " Organisation Name_y \\\n", + "0 MANCHESTER UNIVERSITY NHS FOUNDATION TRUST \n", + "1 SOUTH TYNESIDE AND SUNDERLAND NHS FOUNDATION T... \n", + "2 UNIVERSITY HOSPITALS DORSET NHS FOUNDATION TRUST \n", + "3 Herefordshire and Worcestershire Health and Ca... \n", + "4 Solent NHS Trust \n", + ".. ... \n", + "208 Kent Community Health NHS Foundation Trust \n", + "209 BRADFORD DISTRICT CARE NHS FOUNDATION TRUST \n", + "210 CAMDEN AND ISLINGTON NHS FOUNDATION TRUST \n", + "211 Sheffield Health & Social Care NHS Foundation ... \n", + "212 Black Country Healthcare NHS Foundation Trust \n", + "\n", + " Status Date Of Publication Primary Sector \\\n", + "0 22/23 Standards Met 30/06/2023 NHS Trust \n", + "1 22/23 Standards Exceeded 15/06/2023 NHS Trust \n", + "2 22/23 Approaching Standards 30/06/2023 NHS Trust \n", + "3 22/23 Standards Exceeded 05/06/2023 NHS Trust \n", + "4 22/23 Standards Met 30/06/2023 NHS Trust \n", + ".. ... ... ... \n", + "208 22/23 Standards Met 27/06/2023 NHS Trust \n", + "209 22/23 Standards Met 29/06/2023 NHS Trust \n", + "210 22/23 Approaching Standards 29/06/2023 NHS Trust \n", + "211 22/23 Approaching Standards 30/06/2023 NHS Trust \n", + "212 22/23 Approaching Standards 30/06/2023 NHS Trust \n", + "\n", + " Integrated Care Board (where available, from ODS) \n", + "0 NHS GREATER MANCHESTER INTEGRATED CARE BOARD \n", + "1 NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA... \n", + "2 NHS DORSET INTEGRATED CARE BOARD \n", + "3 NHS HEREFORDSHIRE AND WORCESTERSHIRE INTEGRATE... \n", + "4 NHS HAMPSHIRE AND ISLE OF WIGHT INTEGRATED CAR... \n", + ".. ... \n", + "208 NHS KENT AND MEDWAY INTEGRATED CARE BOARD \n", + "209 NHS WEST YORKSHIRE INTEGRATED CARE BOARD \n", + "210 NHS NORTH CENTRAL LONDON INTEGRATED CARE BOARD \n", + "211 NHS SOUTH YORKSHIRE INTEGRATED CARE BOARD \n", + "212 NHS BLACK COUNTRY INTEGRATED CARE BOARD \n", + "\n", + "[213 rows x 11 columns]" + ] + }, + "execution_count": 79, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trusts_dspt = trusts_combined.merge(dspt_snapshot, on = 'Code').reset_index(drop = True)\n", + "trusts_dspt\n" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'RVY', 'RYT'}" + ] + }, + "execution_count": 83, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "set(trusts_combined['Code']) - set(trusts_dspt['Code'])" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    CodeOrganisation NameNational GroupingHigh Level Health Geographylatlong
    146RVYSOUTHPORT AND ORMSKIRK HOSPITAL NHS TRUSTY62QYG53.63355-2.97882
    \n", + "
    " + ], + "text/plain": [ + " Code Organisation Name National Grouping \\\n", + "146 RVY SOUTHPORT AND ORMSKIRK HOSPITAL NHS TRUST Y62 \n", + "\n", + " High Level Health Geography lat long \n", + "146 QYG 53.63355 -2.97882 " + ] + }, + "execution_count": 84, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trusts_combined.loc[trusts_combined['Code'] == 'RVY']" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    CodeOrganisation NameNational GroupingHigh Level Health Geographylatlong
    206RYTPUBLIC HEALTH WALES NHS TRUSTW00Q9951.476792-3.169914
    \n", + "
    " + ], + "text/plain": [ + " Code Organisation Name National Grouping \\\n", + "206 RYT PUBLIC HEALTH WALES NHS TRUST W00 \n", + "\n", + " High Level Health Geography lat long \n", + "206 Q99 51.476792 -3.169914 " + ] + }, + "execution_count": 85, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trusts_combined.loc[trusts_combined['Code'] == 'RYT']" + ] + }, + { + "cell_type": "code", + "execution_count": 86, + "metadata": {}, + "outputs": [], + "source": [ + "trusts_dspt.to_csv('data/DSPT Snapshots/dspt_trusts_snapshot_17_10_23.csv')" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    ICB23CDICB23CDHICB23NM
    0E54000027QRVNHS North West London Integrated Care Board
    1E54000028QMJNHS North Central London Integrated Care Board
    2E54000029QMFNHS North East London Integrated Care Board
    3E54000030QKKNHS South East London Integrated Care Board
    4E54000031QWENHS South West London Integrated Care Board
    5E54000032QKSNHS Kent and Medway Integrated Care Board
    6E54000034QNQNHS Frimley Integrated Care Board
    7E54000042QRLNHS Hampshire and Isle of Wight Integrated Car...
    8E54000044QU9NHS Buckinghamshire, Oxfordshire and Berkshire...
    9E54000063QXUNHS Surrey Heartlands Integrated Care Board
    10E54000064QNXNHS Sussex Integrated Care Board
    11E54000036QT6NHS Cornwall and the Isles of Scilly Integrate...
    12E54000037QJKNHS Devon Integrated Care Board
    13E54000038QSLNHS Somerset Integrated Care Board
    14E54000039QUYNHS Bristol, North Somerset and South Gloucest...
    15E54000040QOXNHS Bath and North East Somerset, Swindon and ...
    16E54000041QVVNHS Dorset Integrated Care Board
    17E54000043QR1NHS Gloucestershire Integrated Care Board
    18E54000022QMMNHS Norfolk and Waveney Integrated Care Board
    19E54000023QJGNHS Suffolk and North East Essex Integrated Ca...
    20E54000024QHGNHS Bedfordshire, Luton and Milton Keynes Inte...
    21E54000025QM7NHS Hertfordshire and West Essex Integrated Ca...
    22E54000026QH8NHS Mid and South Essex Integrated Care Board
    23E54000056QUENHS Cambridgeshire and Peterborough Integrated...
    24E54000008QYGNHS Cheshire and Merseyside Integrated Care Board
    25E54000048QE1NHS Lancashire and South Cumbria Integrated Ca...
    26E54000057QOPNHS Greater Manchester Integrated Care Board
    27E54000010QNCNHS Staffordshire and Stoke-on-Trent Integrate...
    28E54000011QOCNHS Shropshire, Telford and Wrekin Integrated ...
    29E54000013QJMNHS Lincolnshire Integrated Care Board
    30E54000015QK1NHS Leicester, Leicestershire and Rutland Inte...
    31E54000018QWUNHS Coventry and Warwickshire Integrated Care ...
    32E54000019QGHNHS Herefordshire and Worcestershire Integrate...
    33E54000055QHLNHS Birmingham and Solihull Integrated Care Board
    34E54000058QJ2NHS Derby and Derbyshire Integrated Care Board
    35E54000059QPMNHS Northamptonshire Integrated Care Board
    36E54000060QT1NHS Nottingham and Nottinghamshire Integrated ...
    37E54000062QUANHS Black Country Integrated Care Board
    38E54000050QHMNHS North East and North Cumbria Integrated Ca...
    39E54000051QOQNHS Humber and North Yorkshire Integrated Care...
    40E54000054QWONHS West Yorkshire Integrated Care Board
    41E54000061QF7NHS South Yorkshire Integrated Care Board
    \n", + "
    " + ], + "text/plain": [ + " ICB23CD ICB23CDH ICB23NM\n", + "0 E54000027 QRV NHS North West London Integrated Care Board\n", + "1 E54000028 QMJ NHS North Central London Integrated Care Board\n", + "2 E54000029 QMF NHS North East London Integrated Care Board\n", + "3 E54000030 QKK NHS South East London Integrated Care Board\n", + "4 E54000031 QWE NHS South West London Integrated Care Board\n", + "5 E54000032 QKS NHS Kent and Medway Integrated Care Board\n", + "6 E54000034 QNQ NHS Frimley Integrated Care Board\n", + "7 E54000042 QRL NHS Hampshire and Isle of Wight Integrated Car...\n", + "8 E54000044 QU9 NHS Buckinghamshire, Oxfordshire and Berkshire...\n", + "9 E54000063 QXU NHS Surrey Heartlands Integrated Care Board\n", + "10 E54000064 QNX NHS Sussex Integrated Care Board\n", + "11 E54000036 QT6 NHS Cornwall and the Isles of Scilly Integrate...\n", + "12 E54000037 QJK NHS Devon Integrated Care Board\n", + "13 E54000038 QSL NHS Somerset Integrated Care Board\n", + "14 E54000039 QUY NHS Bristol, North Somerset and South Gloucest...\n", + "15 E54000040 QOX NHS Bath and North East Somerset, Swindon and ...\n", + "16 E54000041 QVV NHS Dorset Integrated Care Board\n", + "17 E54000043 QR1 NHS Gloucestershire Integrated Care Board\n", + "18 E54000022 QMM NHS Norfolk and Waveney Integrated Care Board\n", + "19 E54000023 QJG NHS Suffolk and North East Essex Integrated Ca...\n", + "20 E54000024 QHG NHS Bedfordshire, Luton and Milton Keynes Inte...\n", + "21 E54000025 QM7 NHS Hertfordshire and West Essex Integrated Ca...\n", + "22 E54000026 QH8 NHS Mid and South Essex Integrated Care Board\n", + "23 E54000056 QUE NHS Cambridgeshire and Peterborough Integrated...\n", + "24 E54000008 QYG NHS Cheshire and Merseyside Integrated Care Board\n", + "25 E54000048 QE1 NHS Lancashire and South Cumbria Integrated Ca...\n", + "26 E54000057 QOP NHS Greater Manchester Integrated Care Board\n", + "27 E54000010 QNC NHS Staffordshire and Stoke-on-Trent Integrate...\n", + "28 E54000011 QOC NHS Shropshire, Telford and Wrekin Integrated ...\n", + "29 E54000013 QJM NHS Lincolnshire Integrated Care Board\n", + "30 E54000015 QK1 NHS Leicester, Leicestershire and Rutland Inte...\n", + "31 E54000018 QWU NHS Coventry and Warwickshire Integrated Care ...\n", + "32 E54000019 QGH NHS Herefordshire and Worcestershire Integrate...\n", + "33 E54000055 QHL NHS Birmingham and Solihull Integrated Care Board\n", + "34 E54000058 QJ2 NHS Derby and Derbyshire Integrated Care Board\n", + "35 E54000059 QPM NHS Northamptonshire Integrated Care Board\n", + "36 E54000060 QT1 NHS Nottingham and Nottinghamshire Integrated ...\n", + "37 E54000062 QUA NHS Black Country Integrated Care Board\n", + "38 E54000050 QHM NHS North East and North Cumbria Integrated Ca...\n", + "39 E54000051 QOQ NHS Humber and North Yorkshire Integrated Care...\n", + "40 E54000054 QWO NHS West Yorkshire Integrated Care Board\n", + "41 E54000061 QF7 NHS South Yorkshire Integrated Care Board" + ] + }, + "execution_count": 91, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lookup_table = pd.read_csv('data/aux/22_23/Sub_ICB_Locations_to_Integrated_Care_Boards_to_NHS_England_(Region)_(April_2023)_Lookup_in_England (1).csv')\n", + "icb_table = lookup_table.drop_duplicates('ICB23CDH').reset_index(drop=True)[['ICB23CD', 'ICB23CDH', 'ICB23NM']]\n", + "icb_table" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    ICB23CDICB23CDHICB23NMCodeOrganisation NameStatusDate Of PublicationPrimary SectorIntegrated Care Board (where available, from ODS)
    0E54000027QRVNHS North West London Integrated Care BoardQRVNHS NORTH WEST LONDON INTEGRATED CARE BOARD22/23 Standards Exceeded26/06/2023CCG / Integrated Care Board (ICB)NaN
    1E54000028QMJNHS North Central London Integrated Care BoardQMJNHS NORTH CENTRAL LONDON INTEGRATED CARE BOARD22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    2E54000029QMFNHS North East London Integrated Care BoardQMFNHS NORTH EAST LONDON INTEGRATED CARE BOARD22/23 Standards Exceeded30/06/2023CCG / Integrated Care Board (ICB)NaN
    3E54000030QKKNHS South East London Integrated Care BoardQKKNHS SOUTH EAST LONDON INTEGRATED CARE BOARD22/23 Standards Exceeded30/06/2023CCG / Integrated Care Board (ICB)NaN
    4E54000031QWENHS South West London Integrated Care BoardQWENHS SOUTH WEST LONDON INTEGRATED CARE BOARD22/23 Standards Met27/06/2023CCG / Integrated Care Board (ICB)NaN
    5E54000032QKSNHS Kent and Medway Integrated Care BoardQKSNHS KENT AND MEDWAY INTEGRATED CARE BOARD22/23 Standards Met18/07/2023CCG / Integrated Care Board (ICB)NaN
    6E54000034QNQNHS Frimley Integrated Care BoardQNQNHS FRIMLEY INTEGRATED CARE BOARD22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    7E54000042QRLNHS Hampshire and Isle of Wight Integrated Car...QRLNHS HAMPSHIRE AND ISLE OF WIGHT INTEGRATED CAR...22/23 Standards Exceeded30/06/2023CCG / Integrated Care Board (ICB)NaN
    8E54000044QU9NHS Buckinghamshire, Oxfordshire and Berkshire...QU9NHS BUCKINGHAMSHIRE, OXFORDSHIRE AND BERKSHIRE...22/23 Standards Exceeded27/06/2023CCG / Integrated Care Board (ICB)NaN
    9E54000063QXUNHS Surrey Heartlands Integrated Care BoardQXUNHS SURREY HEARTLANDS INTEGRATED CARE BOARD22/23 Standards Exceeded29/06/2023CCG / Integrated Care Board (ICB)NaN
    10E54000064QNXNHS Sussex Integrated Care BoardQNXNHS SUSSEX INTEGRATED CARE BOARD22/23 Standards Exceeded26/06/2023CCG / Integrated Care Board (ICB)NaN
    11E54000036QT6NHS Cornwall and the Isles of Scilly Integrate...QT6NHS CORNWALL AND THE ISLES OF SCILLY INTEGRATE...22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    12E54000037QJKNHS Devon Integrated Care BoardQJKNHS DEVON INTEGRATED CARE BOARD22/23 Standards Met28/06/2023CCG / Integrated Care Board (ICB)NaN
    13E54000038QSLNHS Somerset Integrated Care BoardQSLNHS SOMERSET INTEGRATED CARE BOARD22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    14E54000039QUYNHS Bristol, North Somerset and South Gloucest...QUYBRISTOL, NORTH SOMERSET AND SOUTH GLOUCESTERSH...22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    15E54000040QOXNHS Bath and North East Somerset, Swindon and ...QOXNHS BATH AND NORTH EAST SOMERSET, SWINDON AND ...22/23 Standards Met09/06/2023CCG / Integrated Care Board (ICB)NaN
    16E54000041QVVNHS Dorset Integrated Care BoardQVVNHS DORSET INTEGRATED CARE BOARD22/23 Standards Met20/06/2023CCG / Integrated Care Board (ICB)NaN
    17E54000043QR1NHS Gloucestershire Integrated Care BoardQR1NHS GLOUCESTERSHIRE INTEGRATED CARE BOARD22/23 Standards Met28/06/2023CCG / Integrated Care Board (ICB)NaN
    18E54000022QMMNHS Norfolk and Waveney Integrated Care BoardQMMNHS NORFOLK AND WAVENEY INTEGRATED CARE BOARD22/23 Standards Met26/06/2023CCG / Integrated Care Board (ICB)NaN
    19E54000023QJGNHS Suffolk and North East Essex Integrated Ca...QJGNHS SUFFOLK AND NORTH EAST ESSEX INTEGRATED CA...22/23 Standards Met29/06/2023CCG / Integrated Care Board (ICB)NaN
    20E54000024QHGNHS Bedfordshire, Luton and Milton Keynes Inte...QHGNHS BEDFORDSHIRE, LUTON AND MILTON KEYNES INTE...22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    21E54000025QM7NHS Hertfordshire and West Essex Integrated Ca...QM7NHS HERTFORDSHIRE AND WEST ESSEX INTEGRATED CA...22/23 Standards Met29/06/2023CCG / Integrated Care Board (ICB)NaN
    22E54000026QH8NHS Mid and South Essex Integrated Care BoardQH8NHS MID AND SOUTH ESSEX INTEGRATED CARE BOARD22/23 Standards Met29/06/2023CCG / Integrated Care Board (ICB)NaN
    23E54000056QUENHS Cambridgeshire and Peterborough Integrated...QUENHS CAMBRIDGESHIRE AND PETERBOROUGH INTEGRATED...22/23 Standards Met29/06/2023CCG / Integrated Care Board (ICB)NaN
    24E54000008QYGNHS Cheshire and Merseyside Integrated Care BoardQYGNHS CHESHIRE AND MERSEYSIDE INTEGRATED CARE BOARD22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    25E54000048QE1NHS Lancashire and South Cumbria Integrated Ca...QE1NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA...22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    26E54000057QOPNHS Greater Manchester Integrated Care BoardQOPNHS GREATER MANCHESTER INTEGRATED CARE BOARD22/23 Approaching Standards24/07/2023CCG / Integrated Care Board (ICB)NaN
    27E54000010QNCNHS Staffordshire and Stoke-on-Trent Integrate...QNCNHS STAFFORDSHIRE AND STOKE-ON-TRENT INTEGRATE...22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    28E54000011QOCNHS Shropshire, Telford and Wrekin Integrated ...QOCNHS SHROPSHIRE, TELFORD AND WREKIN INTEGRATED ...22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    29E54000013QJMNHS Lincolnshire Integrated Care BoardQJMNHS LINCOLNSHIRE INTEGRATED CARE BOARD22/23 Standards Met27/06/2023CCG / Integrated Care Board (ICB)NaN
    30E54000015QK1NHS Leicester, Leicestershire and Rutland Inte...QK1NHS LEICESTER, LEICESTERSHIRE AND RUTLAND INTE...22/23 Standards Met29/06/2023CCG / Integrated Care Board (ICB)NaN
    31E54000018QWUNHS Coventry and Warwickshire Integrated Care ...QWUNHS COVENTRY AND WARWICKSHIRE INTEGRATED CARE ...22/23 Standards Met29/06/2023CCG / Integrated Care Board (ICB)NaN
    32E54000019QGHNHS Herefordshire and Worcestershire Integrate...QGHNHS HEREFORDSHIRE AND WORCESTERSHIRE INTEGRATE...22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    33E54000055QHLNHS Birmingham and Solihull Integrated Care BoardQHLNHS BIRMINGHAM AND SOLIHULL INTEGRATED CARE BOARD22/23 Standards Met27/06/2023CCG / Integrated Care Board (ICB)NaN
    34E54000058QJ2NHS Derby and Derbyshire Integrated Care BoardQJ2NHS DERBY AND DERBYSHIRE INTEGRATED CARE BOARD22/23 Standards Met29/06/2023CCG / Integrated Care Board (ICB)NaN
    35E54000059QPMNHS Northamptonshire Integrated Care BoardQPMNHS NORTHAMPTONSHIRE INTEGRATED CARE BOARD22/23 Standards Met28/06/2023CCG / Integrated Care Board (ICB)NaN
    36E54000060QT1NHS Nottingham and Nottinghamshire Integrated ...QT1NHS NOTTINGHAM AND NOTTINGHAMSHIRE INTEGRATED ...22/23 Standards Met23/06/2023CCG / Integrated Care Board (ICB)NaN
    37E54000062QUANHS Black Country Integrated Care BoardQUANHS BLACK COUNTRY INTEGRATED CARE BOARD22/23 Standards Met27/06/2023CCG / Integrated Care Board (ICB)NaN
    38E54000050QHMNHS North East and North Cumbria Integrated Ca...QHMNHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA...22/23 Standards Met12/07/2023CCG / Integrated Care Board (ICB)NaN
    39E54000051QOQNHS Humber and North Yorkshire Integrated Care...QOQNHS HUMBER AND NORTH YORKSHIRE INTEGRATED CARE...22/23 Standards Met28/06/2023CCG / Integrated Care Board (ICB)NaN
    40E54000054QWONHS West Yorkshire Integrated Care BoardQWONHS WEST YORKSHIRE INTEGRATED CARE BOARD22/23 Standards Met30/06/2023CCG / Integrated Care Board (ICB)NaN
    41E54000061QF7NHS South Yorkshire Integrated Care BoardQF7NHS SOUTH YORKSHIRE INTEGRATED CARE BOARD22/23 Standards Met28/06/2023CCG / Integrated Care Board (ICB)NaN
    \n", + "
    " + ], + "text/plain": [ + " ICB23CD ICB23CDH ICB23NM \\\n", + "0 E54000027 QRV NHS North West London Integrated Care Board \n", + "1 E54000028 QMJ NHS North Central London Integrated Care Board \n", + "2 E54000029 QMF NHS North East London Integrated Care Board \n", + "3 E54000030 QKK NHS South East London Integrated Care Board \n", + "4 E54000031 QWE NHS South West London Integrated Care Board \n", + "5 E54000032 QKS NHS Kent and Medway Integrated Care Board \n", + "6 E54000034 QNQ NHS Frimley Integrated Care Board \n", + "7 E54000042 QRL NHS Hampshire and Isle of Wight Integrated Car... \n", + "8 E54000044 QU9 NHS Buckinghamshire, Oxfordshire and Berkshire... \n", + "9 E54000063 QXU NHS Surrey Heartlands Integrated Care Board \n", + "10 E54000064 QNX NHS Sussex Integrated Care Board \n", + "11 E54000036 QT6 NHS Cornwall and the Isles of Scilly Integrate... \n", + "12 E54000037 QJK NHS Devon Integrated Care Board \n", + "13 E54000038 QSL NHS Somerset Integrated Care Board \n", + "14 E54000039 QUY NHS Bristol, North Somerset and South Gloucest... \n", + "15 E54000040 QOX NHS Bath and North East Somerset, Swindon and ... \n", + "16 E54000041 QVV NHS Dorset Integrated Care Board \n", + "17 E54000043 QR1 NHS Gloucestershire Integrated Care Board \n", + "18 E54000022 QMM NHS Norfolk and Waveney Integrated Care Board \n", + "19 E54000023 QJG NHS Suffolk and North East Essex Integrated Ca... \n", + "20 E54000024 QHG NHS Bedfordshire, Luton and Milton Keynes Inte... \n", + "21 E54000025 QM7 NHS Hertfordshire and West Essex Integrated Ca... \n", + "22 E54000026 QH8 NHS Mid and South Essex Integrated Care Board \n", + "23 E54000056 QUE NHS Cambridgeshire and Peterborough Integrated... \n", + "24 E54000008 QYG NHS Cheshire and Merseyside Integrated Care Board \n", + "25 E54000048 QE1 NHS Lancashire and South Cumbria Integrated Ca... \n", + "26 E54000057 QOP NHS Greater Manchester Integrated Care Board \n", + "27 E54000010 QNC NHS Staffordshire and Stoke-on-Trent Integrate... \n", + "28 E54000011 QOC NHS Shropshire, Telford and Wrekin Integrated ... \n", + "29 E54000013 QJM NHS Lincolnshire Integrated Care Board \n", + "30 E54000015 QK1 NHS Leicester, Leicestershire and Rutland Inte... \n", + "31 E54000018 QWU NHS Coventry and Warwickshire Integrated Care ... \n", + "32 E54000019 QGH NHS Herefordshire and Worcestershire Integrate... \n", + "33 E54000055 QHL NHS Birmingham and Solihull Integrated Care Board \n", + "34 E54000058 QJ2 NHS Derby and Derbyshire Integrated Care Board \n", + "35 E54000059 QPM NHS Northamptonshire Integrated Care Board \n", + "36 E54000060 QT1 NHS Nottingham and Nottinghamshire Integrated ... \n", + "37 E54000062 QUA NHS Black Country Integrated Care Board \n", + "38 E54000050 QHM NHS North East and North Cumbria Integrated Ca... \n", + "39 E54000051 QOQ NHS Humber and North Yorkshire Integrated Care... \n", + "40 E54000054 QWO NHS West Yorkshire Integrated Care Board \n", + "41 E54000061 QF7 NHS South Yorkshire Integrated Care Board \n", + "\n", + " Code Organisation Name \\\n", + "0 QRV NHS NORTH WEST LONDON INTEGRATED CARE BOARD \n", + "1 QMJ NHS NORTH CENTRAL LONDON INTEGRATED CARE BOARD \n", + "2 QMF NHS NORTH EAST LONDON INTEGRATED CARE BOARD \n", + "3 QKK NHS SOUTH EAST LONDON INTEGRATED CARE BOARD \n", + "4 QWE NHS SOUTH WEST LONDON INTEGRATED CARE BOARD \n", + "5 QKS NHS KENT AND MEDWAY INTEGRATED CARE BOARD \n", + "6 QNQ NHS FRIMLEY INTEGRATED CARE BOARD \n", + "7 QRL NHS HAMPSHIRE AND ISLE OF WIGHT INTEGRATED CAR... \n", + "8 QU9 NHS BUCKINGHAMSHIRE, OXFORDSHIRE AND BERKSHIRE... \n", + "9 QXU NHS SURREY HEARTLANDS INTEGRATED CARE BOARD \n", + "10 QNX NHS SUSSEX INTEGRATED CARE BOARD \n", + "11 QT6 NHS CORNWALL AND THE ISLES OF SCILLY INTEGRATE... \n", + "12 QJK NHS DEVON INTEGRATED CARE BOARD \n", + "13 QSL NHS SOMERSET INTEGRATED CARE BOARD \n", + "14 QUY BRISTOL, NORTH SOMERSET AND SOUTH GLOUCESTERSH... \n", + "15 QOX NHS BATH AND NORTH EAST SOMERSET, SWINDON AND ... \n", + "16 QVV NHS DORSET INTEGRATED CARE BOARD \n", + "17 QR1 NHS GLOUCESTERSHIRE INTEGRATED CARE BOARD \n", + "18 QMM NHS NORFOLK AND WAVENEY INTEGRATED CARE BOARD \n", + "19 QJG NHS SUFFOLK AND NORTH EAST ESSEX INTEGRATED CA... \n", + "20 QHG NHS BEDFORDSHIRE, LUTON AND MILTON KEYNES INTE... \n", + "21 QM7 NHS HERTFORDSHIRE AND WEST ESSEX INTEGRATED CA... \n", + "22 QH8 NHS MID AND SOUTH ESSEX INTEGRATED CARE BOARD \n", + "23 QUE NHS CAMBRIDGESHIRE AND PETERBOROUGH INTEGRATED... \n", + "24 QYG NHS CHESHIRE AND MERSEYSIDE INTEGRATED CARE BOARD \n", + "25 QE1 NHS LANCASHIRE AND SOUTH CUMBRIA INTEGRATED CA... \n", + "26 QOP NHS GREATER MANCHESTER INTEGRATED CARE BOARD \n", + "27 QNC NHS STAFFORDSHIRE AND STOKE-ON-TRENT INTEGRATE... \n", + "28 QOC NHS SHROPSHIRE, TELFORD AND WREKIN INTEGRATED ... \n", + "29 QJM NHS LINCOLNSHIRE INTEGRATED CARE BOARD \n", + "30 QK1 NHS LEICESTER, LEICESTERSHIRE AND RUTLAND INTE... \n", + "31 QWU NHS COVENTRY AND WARWICKSHIRE INTEGRATED CARE ... \n", + "32 QGH NHS HEREFORDSHIRE AND WORCESTERSHIRE INTEGRATE... \n", + "33 QHL NHS BIRMINGHAM AND SOLIHULL INTEGRATED CARE BOARD \n", + "34 QJ2 NHS DERBY AND DERBYSHIRE INTEGRATED CARE BOARD \n", + "35 QPM NHS NORTHAMPTONSHIRE INTEGRATED CARE BOARD \n", + "36 QT1 NHS NOTTINGHAM AND NOTTINGHAMSHIRE INTEGRATED ... \n", + "37 QUA NHS BLACK COUNTRY INTEGRATED CARE BOARD \n", + "38 QHM NHS NORTH EAST AND NORTH CUMBRIA INTEGRATED CA... \n", + "39 QOQ NHS HUMBER AND NORTH YORKSHIRE INTEGRATED CARE... \n", + "40 QWO NHS WEST YORKSHIRE INTEGRATED CARE BOARD \n", + "41 QF7 NHS SOUTH YORKSHIRE INTEGRATED CARE BOARD \n", + "\n", + " Status Date Of Publication \\\n", + "0 22/23 Standards Exceeded 26/06/2023 \n", + "1 22/23 Standards Met 30/06/2023 \n", + "2 22/23 Standards Exceeded 30/06/2023 \n", + "3 22/23 Standards Exceeded 30/06/2023 \n", + "4 22/23 Standards Met 27/06/2023 \n", + "5 22/23 Standards Met 18/07/2023 \n", + "6 22/23 Standards Met 30/06/2023 \n", + "7 22/23 Standards Exceeded 30/06/2023 \n", + "8 22/23 Standards Exceeded 27/06/2023 \n", + "9 22/23 Standards Exceeded 29/06/2023 \n", + "10 22/23 Standards Exceeded 26/06/2023 \n", + "11 22/23 Standards Met 30/06/2023 \n", + "12 22/23 Standards Met 28/06/2023 \n", + "13 22/23 Standards Met 30/06/2023 \n", + "14 22/23 Standards Met 30/06/2023 \n", + "15 22/23 Standards Met 09/06/2023 \n", + "16 22/23 Standards Met 20/06/2023 \n", + "17 22/23 Standards Met 28/06/2023 \n", + "18 22/23 Standards Met 26/06/2023 \n", + "19 22/23 Standards Met 29/06/2023 \n", + "20 22/23 Standards Met 30/06/2023 \n", + "21 22/23 Standards Met 29/06/2023 \n", + "22 22/23 Standards Met 29/06/2023 \n", + "23 22/23 Standards Met 29/06/2023 \n", + "24 22/23 Standards Met 30/06/2023 \n", + "25 22/23 Standards Met 30/06/2023 \n", + "26 22/23 Approaching Standards 24/07/2023 \n", + "27 22/23 Standards Met 30/06/2023 \n", + "28 22/23 Standards Met 30/06/2023 \n", + "29 22/23 Standards Met 27/06/2023 \n", + "30 22/23 Standards Met 29/06/2023 \n", + "31 22/23 Standards Met 29/06/2023 \n", + "32 22/23 Standards Met 30/06/2023 \n", + "33 22/23 Standards Met 27/06/2023 \n", + "34 22/23 Standards Met 29/06/2023 \n", + "35 22/23 Standards Met 28/06/2023 \n", + "36 22/23 Standards Met 23/06/2023 \n", + "37 22/23 Standards Met 27/06/2023 \n", + "38 22/23 Standards Met 12/07/2023 \n", + "39 22/23 Standards Met 28/06/2023 \n", + "40 22/23 Standards Met 30/06/2023 \n", + "41 22/23 Standards Met 28/06/2023 \n", + "\n", + " Primary Sector \\\n", + "0 CCG / Integrated Care Board (ICB) \n", + "1 CCG / Integrated Care Board (ICB) \n", + "2 CCG / Integrated Care Board (ICB) \n", + "3 CCG / Integrated Care Board (ICB) \n", + "4 CCG / Integrated Care Board (ICB) \n", + "5 CCG / Integrated Care Board (ICB) \n", + "6 CCG / Integrated Care Board (ICB) \n", + "7 CCG / Integrated Care Board (ICB) \n", + "8 CCG / Integrated Care Board (ICB) \n", + "9 CCG / Integrated Care Board (ICB) \n", + "10 CCG / Integrated Care Board (ICB) \n", + "11 CCG / Integrated Care Board (ICB) \n", + "12 CCG / Integrated Care Board (ICB) \n", + "13 CCG / Integrated Care Board (ICB) \n", + "14 CCG / Integrated Care Board (ICB) \n", + "15 CCG / Integrated Care Board (ICB) \n", + "16 CCG / Integrated Care Board (ICB) \n", + "17 CCG / Integrated Care Board (ICB) \n", + "18 CCG / Integrated Care Board (ICB) \n", + "19 CCG / Integrated Care Board (ICB) \n", + "20 CCG / Integrated Care Board (ICB) \n", + "21 CCG / Integrated Care Board (ICB) \n", + "22 CCG / Integrated Care Board (ICB) \n", + "23 CCG / Integrated Care Board (ICB) \n", + "24 CCG / Integrated Care Board (ICB) \n", + "25 CCG / Integrated Care Board (ICB) \n", + "26 CCG / Integrated Care Board (ICB) \n", + "27 CCG / Integrated Care Board (ICB) \n", + "28 CCG / Integrated Care Board (ICB) \n", + "29 CCG / Integrated Care Board (ICB) \n", + "30 CCG / Integrated Care Board (ICB) \n", + "31 CCG / Integrated Care Board (ICB) \n", + "32 CCG / Integrated Care Board (ICB) \n", + "33 CCG / Integrated Care Board (ICB) \n", + "34 CCG / Integrated Care Board (ICB) \n", + "35 CCG / Integrated Care Board (ICB) \n", + "36 CCG / Integrated Care Board (ICB) \n", + "37 CCG / Integrated Care Board (ICB) \n", + "38 CCG / Integrated Care Board (ICB) \n", + "39 CCG / Integrated Care Board (ICB) \n", + "40 CCG / Integrated Care Board (ICB) \n", + "41 CCG / Integrated Care Board (ICB) \n", + "\n", + " Integrated Care Board (where available, from ODS) \n", + "0 NaN \n", + "1 NaN \n", + "2 NaN \n", + "3 NaN \n", + "4 NaN \n", + "5 NaN \n", + "6 NaN \n", + "7 NaN \n", + "8 NaN \n", + "9 NaN \n", + "10 NaN \n", + "11 NaN \n", + "12 NaN \n", + "13 NaN \n", + "14 NaN \n", + "15 NaN \n", + "16 NaN \n", + "17 NaN \n", + "18 NaN \n", + "19 NaN \n", + "20 NaN \n", + "21 NaN \n", + "22 NaN \n", + "23 NaN \n", + "24 NaN \n", + "25 NaN \n", + "26 NaN \n", + "27 NaN \n", + "28 NaN \n", + "29 NaN \n", + "30 NaN \n", + "31 NaN \n", + "32 NaN \n", + "33 NaN \n", + "34 NaN \n", + "35 NaN \n", + "36 NaN \n", + "37 NaN \n", + "38 NaN \n", + "39 NaN \n", + "40 NaN \n", + "41 NaN " + ] + }, + "execution_count": 92, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "icb_dspt = icb_table.merge(dspt_snapshot, left_on = 'ICB23CDH', right_on = 'Code')\n", + "icb_dspt" + ] + }, + { + "cell_type": "code", + "execution_count": 94, + "metadata": {}, + "outputs": [], + "source": [ + "icb_dspt.to_csv('data/Dspt Snapshots/ICB_dspt_snapshot_17_10_23.csv')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "interpreter": { + "hash": "397704579725e15f5c7cb49fe5f0341eb7531c82d19f2c29d197e8b64ab5776b" + }, + "kernelspec": { + "display_name": "Python 3.9.18 64-bit", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.18" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/index.md b/index.md new file mode 100644 index 0000000..2de9154 --- /dev/null +++ b/index.md @@ -0,0 +1,111 @@ +, + +# Open Statistics - Cyber Security + + +
    +

    + Important: +

    +

    This project is currently in development. An overview of methodology and caveats are given below. For more information please contact TDAUgroup@england.nhs.uk.
    Opinions expressed in this page are not representative of the views of NHS England and any content here should not be regarded as official output in any form. For more information about the NHS England Transformation Directorate please visit our official website. +

    +
    + +The Data Security and Protection Toolkit is an online self-assessment tool that allows organisations to measure their performance against the National Data Guardian’s 10 data security standards. + +All organisations that have access to NHS patient data and systems must use this toolkit to provide assurance that they are practising good data security and that personal information is handled correctly. This includes trusts, commissioners and CSUs. + +The data displayed in this page will show all organisations open as of 9th of September 2022. Any organisations which have merged and do not have a DSPT status will inherit the DSPT status of the merged organisation. + +The following information displays data taken from a specific snapshot of the DSPT data. The latest status information was downloaded on the 9th September 2022. + +You can find the previous iteration of this page showing the 20/21 DSPT data at 20/21 Open Cyber Page + +For more information on the Data Security and Protection Toolkit, please visit the DSPT portal. + +
    + +## Notes on Methodology + +Composite Metrics for ICS + +The DSPT status for Clinical Commissioning Groups (CCGs) and Trusts are coded (scored) as follows to create the proxy for Integrated Care System (ICS) summary metrics: + +
  • Status Exceeded = 3
  • +
  • Status Met = 1
  • +
  • Approaching Standards = -1
  • +
  • Not Published/Not Met = -3
  • +
    +CCG scores within an ICS are then weighted based on the resident population. + +Trust scores within an ICS are weighted as a simple average. + +Finally, for each ICS, the CCG and Trust scores are weighted equally to arrive at the ICS composite score. + +The final scaling for each of the summary metrics displayed will have an upper bound of 3 and a lower bound of -3. + + +## Summary of DSPT Compliance (2021/2022 edition). +
    +Summary statistics from the DSPT 2021/22 toolkit are shown. + +{% include cross_table_summary_21_222022-10-05.html %} + + + +
    + + +## ICBs and Trusts - Individual Compliance +
    +The compliance of individual ICBs and Trusts are mapped below, with Region boundaries. Toggle the boxes on the top right-hand side to add layers. + + + + +
    + + +
    +The compliance of individual ICBs, made up of a composite score of 50% of the ICB score itself which and 50% of a simple average of Trust scores contained in the ICB. Region boundaries are displayed in blue. + + + + +
    + +
    + +
    +Template for end-to-end open source analytics: [github.io](https://pages.github.com/), and [github actions](https://github.com/features/actions). + +Analytics leverages open source data and R libraries such as [leaflet](https://cran.r-project.org/web/packages/leaflet/index.html) for interactive maps, [plotly](https://plotly.com/r/) for other interactive visualisations and [summarytools](https://cran.r-project.org/web/packages/summarytools/vignettes/introduction.html) for descriptive statistics. + diff --git a/index2.md b/index2.md new file mode 100644 index 0000000..c02a807 --- /dev/null +++ b/index2.md @@ -0,0 +1,128 @@ + + +# Open Statistics - Cyber Security + + +
    +

    + Important: +

    +

    This project is currently in development. An overview of methodology and caveats are given below. For more information please contact analytics-unit@nhsx.nhs.uk.
    Opinions expressed in this page are not representative of the views of NHS England and any content here should not be regarded as official output in any form. For more information about the NHS England Transformation Directorate please visit our official website. +

    +
    + +The Data Security and Protection Toolkit is an online self-assessment tool that allows organisations to measure their performance against the National Data Guardian’s 10 data security standards. + +All organisations that have access to NHS patient data and systems must use this toolkit to provide assurance that they are practising good data security and that personal information is handled correctly. This includes trusts, commissioners and CSUs. + +The following information displays data taken from a specific snapshot of the DSPT data. The latest status information was downloaded on the 8th February 2022. + +For more information on the Data Security and Protection Toolkit, please visit the DSPT portal. + +
    + +## Notes on Methodology + +Composite Metrics for ICS + +The DSPT status for Clinical Commissioning Groups (CCGs) and Trusts are coded (scored) as follows to create the proxy for Integrated Care System (ICS) summary metrics: + +
  • Status Exceeded = 3
  • +
  • Status Met = 1
  • +
  • Approaching Standards = -1
  • +
  • Not Published/Not Met = -3
  • +
    +CCG scores within an ICS are then weighted based on the resident population. + +Trust scores within an ICS are weighted either a) as simple average or b) based on their EPRR score. + +Finally, for each ICS, the CCG and Trust scores are weighted equally to arrive at the ICS composite score. + +The final scaling for each of the summary metrics displayed will have an upper bound of 3 and a lower bound of -3. + + +## Summary of DSPT Compliance (2020/2021 edition). +
    +Summary statistics from the DSPT 2020/21 toolkit are shown. + +{% include data_DSPTmetric2022-02-08.html %} + + + +
    + + +## CCGs and Trusts - Individual Compliance +
    +The compliance of individual CCGs and Trusts are mapped below, with ICS boundaries. Toggle the boxes on the top right-hand side to add layers. + + + +
    + + + +## CCGs and Proportions of Trusts Compliance - Colour Coded Population +
    +The proportions of trust compliance within each ICS with boundaries (in black) are shown. The ICSs are colored to represent the patient population level. The darker the shade of blue the higher the patient population level. + + + +
    + + +## ICSs Composite Compliance - CCG and Trust Score Average Weighted For Population +
    +The compliance of individual ICSs, made up of a composite score of 50% CCG scores which have been weighted for population and 50% of a simple average of Trust scores. Region boundaries are displayed in blue. + + +
    + +
    + +
    +Template for end-to-end open source analytics: [github.io](https://pages.github.com/), and [github actions](https://github.com/features/actions). + +Analytics leverages open source data and R libraries such as [leaflet](https://cran.r-project.org/web/packages/leaflet/index.html) for interactive maps, [plotly](https://plotly.com/r/) for other interactive visualisations and [summarytools](https://cran.r-project.org/web/packages/summarytools/vignettes/introduction.html) for descriptive statistics. + diff --git a/myplotly.md b/myplotly.md new file mode 100644 index 0000000..77c2ffe --- /dev/null +++ b/myplotly.md @@ -0,0 +1,28 @@ + + +# Open Statistics - Cyber Security + +{% include update.html %} + +
    +

    + Important: +

    +

    This project is currently in development. For more information please contact {{ site.github.owner_name }} +

    +
    + +
    + +Template for end-to-end open source analytics: python, [plotly](https://plotly.com/python/), [github.io](https://pages.github.com/), and [github actions](https://github.com/features/actions). + +## Summary of DSPT Compliance (2020/2021 edition) + +{% include barchart_summary_FY2021_w.html %} + +% include crosstab_summary_FY2021.html % + +
    diff --git a/original_mf.md b/original_mf.md new file mode 100644 index 0000000..a10190a --- /dev/null +++ b/original_mf.md @@ -0,0 +1,73 @@ + + +# Open Statistics - Cyber Security + +{% include update.html %} + +
    +

    + Important: +

    +

    This project is currently in development. For more information please contact {{ site.github.owner_name }} +

    +
    + +
    +

    + Important: +

    +

    This project is currently in development. For more information please contact martina.fonseca@nhsx.nhs.uk.
    This is an exploratory piece leveraging open source data and widget tooling in R - it has not received formal QA.
    Opinions expressed in this page are not representative of the views of NHSX and any content here should not be regarded as official output in any form. For more information about NHSX please visit our official website.. +

    +
    + +The Data Security and Protection Toolkit is an online self-assessment tool that allows organisations to measure their performance against the National Data Guardian’s 10 data security standards. + +All organisations that have access to NHS patient data and systems must use this toolkit to provide assurance that they are practising good data security and that personal information is handled correctly. This includes trusts, commissioners and CSUs. + +For more information on the Data Security and Protection Toolkit, please visit the DSPT portal. + +
    + +## Summary of DSPT Compliance (2020/2021 edition). +
    +Summary statistics from the DSPT 2020/21 toolkit are shown. The latest status information was downloaded on the 10th October 2021. + +Note on method: organisations open 31st March 2021 are considered. However, if the organisation does not have a 20/21 DSPT status, it has been allowed to inherit one from its 21/22 successor organisation (if the successor submitted a 2020/21 return). The same applies for the subsections below. + + + +{% include crosstab_summary_FY2021.html %} + + + +
    + + +## CCGs - Individual Compliance +
    +The compliance of individual CCGs is mapped below. + + + +
    + +## Trusts - DSPT Compliance over editions +
    +Below we consider the overall evolution of DSPT status across editions, for trusts open end-financial year 2020/21. +Note that below, for trusts resulting from mergers, we do not reflect the status of their predecessors, unless their identifying organisational code has been kept. + +Despite showing editions side-by-side, it is important to note that the standards - and the level of evidence required to meet those standards - tend to get raised year-on-year. This means that a similar status in two editions is not directly comparable. + + + +
    + +Template for end-to-end open source analytics: [github.io](https://pages.github.com/), and [github actions](https://github.com/features/actions). + +Analytics leverages open source data and R libraries such as [leaflet](https://cran.r-project.org/web/packages/leaflet/index.html) for interactive maps, [plotly](https://plotly.com/r/) for other interactive visualisations and [summarytools](https://cran.r-project.org/web/packages/summarytools/vignettes/introduction.html) for descriptive statistics. diff --git a/outputs/icb_trusts_map_09_11_22.html b/outputs/icb_trusts_map_09_11_22.html new file mode 100644 index 0000000..a40bb41 --- /dev/null +++ b/outputs/icb_trusts_map_09_11_22.html @@ -0,0 +1,4061 @@ + + + + +leaflet + + + + + + + + + + + + +
    +
    +
    + + + + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3617406 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +plotly==4.14.3 +pandas==1.1.3 \ No newline at end of file diff --git a/run.py b/run.py new file mode 100644 index 0000000..5548729 --- /dev/null +++ b/run.py @@ -0,0 +1,61 @@ +import random +import pandas as pd +from datetime import datetime +import plotly +import plotly.graph_objects as go +from plotly.subplots import make_subplots + + +# Generate Data + +x = pd.date_range(datetime.today(), periods=100).tolist() +y = random.sample(range(1, 300), 100) + +# Plot figure +fig = go.Figure([go.Bar(x=x, y=y)]) + +# Asthetics of the plot +fig.update_layout( + {"plot_bgcolor": "rgba(0, 0, 0, 0)", "paper_bgcolor": "rgba(0, 0, 0, 0)"}, + autosize=True, + margin=dict(l=50, r=50, b=50, t=50, pad=4, autoexpand=True), + # height=1000, + # hovermode="x", +) + +# Add title and dynamic range selector to x axis +fig.update_xaxes( + title_text="Date", + rangeselector=dict( + buttons=list( + [ + dict(count=6, label="6m", step="month", stepmode="backward"), + dict(count=1, label="1y", step="year", stepmode="backward"), + dict(step="all"), + ] + ) + ), +) + +# Add title to y axis +fig.update_yaxes(title_text="Count") + +# Write out to file (.html) +config = {"displayModeBar": False, "displaylogo": False} +plotly_obj = plotly.offline.plot( + fig, include_plotlyjs=False, output_type="div", config=config +) +with open("_includes/plotly_obj.html", "w") as file: + file.write(plotly_obj) + +# Grab timestamp +data_updated = datetime.now().strftime("%d/%m/%Y %H:%M:%S") + +# Write out to file (.html) +html_str = ( + '

    Latest Data: ' + + data_updated + + "

    " +) +with open("_includes/update.html", "w") as file: + file.write(html_str) \ No newline at end of file