# Load environment file source(here::here("setup_environment.R")) # Read in SMR data, filtered on latest period/reported hospitals smr_data <- read_csv(paste0(data_folder, pub_day, "/output/", pub_day, "_SMR-data.csv")) %>% filter(period == 3 & location %in% c(hosp_filter, scot_filter)) %>% mutate(st_err = round_half_up(sqrt(1/round_half_up(pred, 8)), 8), z = if_else(location_type == "hospital", round_half_up(((round_half_up(smr, 8) - 1)/round_half_up(st_err,8)), 8), 0)) %>% mutate( z_max = max(z), z_min = min(z), z_flag = case_when(z == z_max ~ 1, z == z_min ~ -1, TRUE ~ 0), z = if_else(z == z_max | z == z_min, 0, z), z_max = max(z), z_min = min(z), z = case_when(z_flag == 1 ~ z_max, z_flag == -1 ~ z_min, TRUE ~ z), z_flag = if_else(z != 0, 1, 0), w_score = round_half_up(sqrt(sum(round_half_up(z * z, 8))/sum(z_flag)),8)) %>% # Calculate funnel limits for funnel plot mutate(uwl = 1 + 1.96 * round_half_up(st_err * w_score,8), ucl = 1 + 3.09 * round_half_up(st_err * w_score,8), lwl = 1 - 1.96 * round_half_up(st_err * w_score,8), lcl = 1 - 3.09 * round_half_up(st_err * w_score,8)) %>% # Create flag for where hospital sits on funnel plot mutate(flag = case_when(smr > ucl ~ "2", smr > uwl & smr <= ucl ~ "1", smr < lwl & smr >= lcl ~ "1", TRUE ~ "0"), flag_above = case_when(smr > ucl ~ TRUE, TRUE ~ FALSE), flag_below = case_when(smr < lcl ~ TRUE, TRUE ~ FALSE)) # Read in trends data for charting, filtering out missing data trend_data <- read_csv(paste0(data_folder, pub_day, "/output/", pub_day, "_trends-data-level2.csv"), col_types = cols( quarter = col_double(), quarter_short = col_character(), quarter_full = col_character() )) %>% filter(time_period == "Quarter") %>% select(-(month), -(month_label), -(time_period)) %>% filter(!is.na(label)) %>% arrange(hb, label, quarter) # Extract latest row for all admissions/discharge at Scotland from the trends # data. Could maybe be put into a function but works like this for now latest_deaths_admission <- trend_data %>% filter(hb == "Scotland" & label == "All admissions" & quarter == 20) latest_deaths_discharge <- trend_data %>% filter(hb == "Scotland" & label == "Discharge" & quarter == 20) # Calculates the end date for a quarter in string format completeness_next <- case_when(month(end_date) == 12 ~ paste0("31 March ", year(end_date + days(1))), month(end_date) == 3 ~ paste0("30 June ", year(end_date)), month(end_date) == 6 ~ paste0("30 September ", year(end_date)), month(end_date) == 9 ~ paste0("31 December ", year(end_date))) # Create custom colour/shape palette for the trend charts trend_palette <- scale_color_manual(values = c("#004949", "#006dd1", "#49006a", "#920000", "#924900", "#db6d00", "#24ff24")) shape_palette <- scale_shape_manual(values = c(16, 15, 17, 3, 4, 8, 18)) # ---- ## FUNNEL PLOT ## funnel_plot <- ggplot(smr_data %>% filter(location_type == "hospital"), aes()) + scale_color_manual(values = c("#006ba4", "#c85302", "#ffbc79", "#006ba4", "#ffbc79", "#c85302"), labels = c("Scotland", "Upper/Lower Control Limit", "Upper/Lower Warning Limit", "Hospital", ""), guide = guide_legend(override.aes = list( # The following 2 lines cause issues if a hospital is above/below warning/control limits. # Change to the commented out lines below when there are not hospitals above/below warning limits. linetype = c(rep("solid", 3), "blank", "blank"), shape = c(NA, NA, NA, 19, NA)))) + # linetype = c(rep("solid", 3), "blank"), # shape = c(NA, NA, NA, 19)))) + coord_cartesian(ylim = c(0,2.5)) + geom_line(aes(x = pred, y = ucl, colour = "#c85302")) + geom_line(aes(x = pred, y = uwl, colour = "#ffbc79")) + geom_line(aes(x = pred, y = lwl, colour = "#ffbc79")) + geom_line(aes(x = pred, y = lcl, colour = "#c85302")) + geom_line(aes(x = pred, y = 1, colour = "#006ba4")) + geom_point(aes(x = pred, y = smr, colour = factor(flag), show.legend = FALSE)) + geom_label_repel(data = smr_data %>% filter(location_type == "hospital" & flag_below == TRUE), aes(x = pred, y= smr, label = location_name), nudge_y = -2, size = 4, box.padding = 0.5, point.padding = 0.5, force = 100, segment.size = 0.2, segment.color = "grey50", direction = "x") + geom_label_repel(data = smr_data %>% filter(location_type == "hospital" & flag_above == TRUE), aes(x = pred, y= smr, label = location_name), nudge_y = 2, size = 4, box.padding = 0.5, point.padding = 0.5, force = 100, segment.size = 0.2, segment.color = "grey50", direction = "x") + labs(x = "Number of predicted deaths", y = "Hospital\nStandardised\nMortality\nRatio") + theme(panel.background = element_blank(), panel.grid.major.x = element_line(size = .1, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust=0.5), axis.text = element_text(size = 9, angle= 0), legend.title = element_blank(), # ggplot centres over plot area, not in the full figure, so legend is cut off # when set to "top". This needs manual adjustment when sizes change legend.position = c(0.37, 1.04), legend.background = element_rect(fill = "transparent"), legend.direction = "horizontal", legend.key = element_rect(colour = NA, fill = NA), # make space for legend above plot area plot.margin = unit(c(0.6,0.1,0.1,0.1), "cm")) + scale_x_continuous(labels = comma) print(funnel_plot) # ---- qtr_list <- trend_data %>% filter(label == "All admissions" & location == "Scot") %>% select(quarter_short) chart_2 <- ggplot(trend_data %>% filter(label == "All admissions" & location == "Scot"), aes(x = forcats::fct_reorder(quarter_short, as.numeric(quarter)), y = crd_rate, group = 1)) + geom_line(aes(colour = label, group=label), size = 1) + geom_point(aes(colour = label, shape = label)) + shape_palette + trend_palette + labs(x = element_blank(), y = "Crude\nrate (%)") + theme(panel.background = element_blank(), panel.grid.minor.x = element_line(size = .15, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.line.x = element_line(size = .1, color = "#787878"), axis.line.y = element_line(size = .1, color = "#787878"), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust = 0.5), axis.text.x = element_text(size = 9, angle = 0, hjust = 0.5, vjust = 0.5), legend.title = element_blank(), legend.position = "none", legend.key = element_rect(colour = NA, fill = NA)) + scale_y_continuous(labels = function(x) sprintf("%.1f", x), limits = c(0, NA)) + scale_x_discrete(labels = c(sub(" ", "\n", qtr_list[1,]), "", "", "", sub(" ", "\n", qtr_list[5,]), "", "", "", sub(" ", "\n", qtr_list[9,]), "", "", "", sub(" ", "\n", qtr_list[13,]), "", "", "", sub(" ", "\n", qtr_list[17,]), "", "", "")) chart_3 <- ggplot(trend_data %>% filter(location == "Scot" & (label == "Elective" | label == "Non-elective")), aes(x = forcats::fct_reorder(quarter_short, as.numeric(quarter)) , y = crd_rate)) + geom_line(aes(colour = label, group=label), size = 1) + geom_point(aes(colour = label, shape = label)) + shape_palette + trend_palette + labs(x = element_blank(), y = "Crude\nrate (%)") + theme(panel.background = element_blank(), panel.grid.minor.x = element_line(size = .15, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.line.x = element_line(size = .1, color = "#787878"), axis.line.y = element_line(size = .1, color = "#787878"), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust = 0.5), axis.text.x = element_text(size = 9, angle = 0 , hjust = 0.5, vjust = 0.5), legend.title = element_blank(), legend.position = "top", legend.key = element_rect(colour = NA, fill = NA)) + scale_y_continuous(labels = function(x) sprintf("%.1f", x), limits = c(0, NA)) + scale_x_discrete(labels = c(sub(" ", "\n", qtr_list[1,]), "", "", "", sub(" ", "\n", qtr_list[5,]), "", "", "", sub(" ", "\n", qtr_list[9,]), "", "", "", sub(" ", "\n", qtr_list[13,]), "", "", "", sub(" ", "\n", qtr_list[17,]), "", "", "")) chart_4 <- ggplot(trend_data %>% filter(location == "Scot" & ( label == "Community" | label == "Dental" | label == "Medical" | label == "Other" | label == "Surgery" | label == "Paediatrics" | label == "Emergency" | label == "Gynaecology")), aes(x = forcats::fct_reorder(quarter_short, as.numeric(quarter)), y = crd_rate)) + geom_line(aes(colour = label, group=label), size = 1) + geom_point(aes(colour = label, shape = label)) + shape_palette + trend_palette + labs(x = element_blank(), y = "Crude\nrate (%)") + theme(panel.background = element_blank(), panel.grid.minor.x = element_line(size = .15, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.line.x = element_line(size = .1, color = "#787878"), axis.line.y = element_line(size = .1, color = "#787878"), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust = 0.5), axis.text.x = element_text(size = 9, angle = 0, hjust = 0.5, vjust = 0.5), legend.title = element_blank(), legend.position = "top", legend.key = element_rect(colour = NA, fill = NA)) + scale_y_continuous(labels = function(x) sprintf("%.1f", x), limits = c(0, NA)) + scale_x_discrete(labels = c(sub(" ", "\n", qtr_list[1,]), "", "", "", sub(" ", "\n", qtr_list[5,]), "", "", "", sub(" ", "\n", qtr_list[9,]), "", "", "", sub(" ", "\n", qtr_list[13,]), "", "", "", sub(" ", "\n", qtr_list[17,]), "", "", "")) chart_5 <- ggplot(trend_data %>% filter(location == "Scot" & (label == "0-19 years" | label == "20-39 years" | label == "40-59 years" | label == "60-79 years" | label == "80+ years")), aes(x = forcats::fct_reorder(quarter_short, as.numeric(quarter)) , y = crd_rate)) + geom_line(aes(colour = label, group=label), size = 1) + geom_point(aes(colour = label, shape = label)) + shape_palette + trend_palette + labs(x = element_blank(), y = "Crude\nrate (%)") + theme(panel.background = element_blank(), panel.grid.minor.x = element_line(size = .15, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.line.x = element_line(size = .1, color = "#787878"), axis.line.y = element_line(size = .1, color = "#787878"), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust = 0.5), axis.text.x = element_text(size = 9, angle = 0, hjust = 0.5, vjust = 0.5), legend.title = element_blank(), legend.position = "top", legend.key = element_rect(colour = NA, fill = NA)) + scale_y_continuous(labels = function(x) sprintf("%.1f", x), limits = c(0, NA)) + scale_x_discrete(labels = c(sub(" ", "\n", qtr_list[1,]), "", "", "", sub(" ", "\n", qtr_list[5,]), "", "", "", sub(" ", "\n", qtr_list[9,]), "", "", "", sub(" ", "\n", qtr_list[13,]), "", "", "", sub(" ", "\n", qtr_list[17,]), "", "", "")) chart_6 <- ggplot(trend_data %>% filter(location == "Scot" & (label == "Male" | label == "Female")), aes(x = forcats::fct_reorder(quarter_short, as.numeric(quarter)) , y = crd_rate)) + geom_line(aes(colour = label, group=label), size = 1) + geom_point(aes(colour = label, shape = label)) + shape_palette + trend_palette + labs(x = element_blank(), y = "Crude\nrate (%)") + theme(panel.background = element_blank(), panel.grid.minor.x = element_line(size = .15, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.line.x = element_line(size = .1, color = "#787878"), axis.line.y = element_line(size = .1, color = "#787878"), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust = 0.5), axis.text.x = element_text(size = 9, angle = 0, hjust = 0.5, vjust = 0.5), legend.title = element_blank(), legend.position = "top", legend.key = element_rect(colour = NA, fill = NA)) + scale_y_continuous(labels = function(x) sprintf("%.1f", x), limits = c(0, NA)) + scale_x_discrete(labels = c(sub(" ", "\n", qtr_list[1,]), "", "", "", sub(" ", "\n", qtr_list[5,]), "", "", "", sub(" ", "\n", qtr_list[9,]), "", "", "", sub(" ", "\n", qtr_list[13,]), "", "", "", sub(" ", "\n", qtr_list[17,]), "", "", "")) chart_7 <- ggplot(trend_data %>% filter(location == "Scot" & sub_grp == "Deprivation" & (label == "1 - most deprived" | label == "2" | label == "3" | label == "4" | label == "5 - least deprived")), aes(x = forcats::fct_reorder(quarter_short, as.numeric(quarter)) , y = crd_rate)) + geom_line(aes(colour = label, group=label), size = 1) + geom_point(aes(colour = label, shape = label)) + shape_palette + trend_palette + labs(x = element_blank(), y = "Crude\nrate (%)") + theme(panel.background = element_blank(), panel.grid.minor.x = element_line(size = .15, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.line.x = element_line(size = .1, color = "#787878"), axis.line.y = element_line(size = .1, color = "#787878"), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust = 0.5), axis.text.x = element_text(size = 9, angle = 0, hjust = 0.5, vjust = 0.5), legend.title = element_blank(), legend.position = "top", legend.key = element_rect(colour = NA, fill = NA)) + scale_y_continuous(labels = function(x) sprintf("%.1f", x), limits = c(0, NA)) + scale_x_discrete(labels = c(sub(" ", "\n", qtr_list[1,]), "", "", "", sub(" ", "\n", qtr_list[5,]), "", "", "", sub(" ", "\n", qtr_list[9,]), "", "", "", sub(" ", "\n", qtr_list[13,]), "", "", "", sub(" ", "\n", qtr_list[17,]), "", "", "")) chart_8 <- ggplot(trend_data %>% filter((label == "Died in hospital" | label == "Died in community") & hb == "Scotland") %>% group_by(quarter) %>% mutate(total = sum(deaths)), aes(x = forcats::fct_reorder(quarter_short, as.numeric(quarter)) , y = deaths/total)) + geom_line(aes(colour = label, group=label), size = 1) + geom_point(aes(colour = label, shape = label)) + shape_palette + trend_palette + coord_cartesian(ylim = c(0, 1)) + labs(x = element_blank(), y = "Proportion") + theme(panel.background = element_blank(), panel.grid.minor.x = element_line(size = .15, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.line.x = element_line(size = .1, color = "#787878"), axis.line.y = element_line(size = .1, color = "#787878"), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust = 0.5), axis.text.x = element_text(size = 9, angle = 0, hjust = 0.5, vjust = 0.5), legend.title = element_blank(), legend.position = "top", legend.key = element_rect(colour = NA, fill = NA)) + scale_y_continuous(labels = function(x) sprintf("%.1f", x), breaks = c(0, 0.2, 0.4, 0.6, 0.8, 1)) + scale_x_discrete(labels = c(sub(" ", "\n", qtr_list[1,]), "", "", "", sub(" ", "\n", qtr_list[5,]), "", "", "", sub(" ", "\n", qtr_list[9,]), "", "", "", sub(" ", "\n", qtr_list[13,]), "", "", "", sub(" ", "\n", qtr_list[17,]), "", "", "")) chart_9 <- ggplot(trend_data %>% filter(label == "Discharge" & hb == "Scotland"), aes(x = forcats::fct_reorder(quarter_short, as.numeric(quarter)) , y = crd_rate)) + geom_line(aes(colour = label, group=label), size = 1) + geom_point(aes(colour = label, shape = label)) + shape_palette + trend_palette + labs(x = element_blank(), y = "Crude\nrate (%)") + theme(panel.background = element_blank(), panel.grid.minor.x = element_line(size = .15, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.line.x = element_line(size = .1, color = "#787878"), axis.line.y = element_line(size = .1, color = "#787878"), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust = 0.5), axis.text.x = element_text(size = 9, angle = 0, hjust = 0.5, vjust = 0.5), legend.title = element_blank(), legend.position = "none", legend.key = element_rect(colour = NA, fill = NA)) + scale_y_continuous(labels = function(x) sprintf("%.1f", x), limits = c(0, NA)) + scale_x_discrete(labels = c(sub(" ", "\n", qtr_list[1,]), "", "", "", sub(" ", "\n", qtr_list[5,]), "", "", "", sub(" ", "\n", qtr_list[9,]), "", "", "", sub(" ", "\n", qtr_list[13,]), "", "", "", sub(" ", "\n", qtr_list[17,]), "", "", "")) chart_10 <- ggplot(trend_data %>% filter(label == "Population" & hb == "Scotland" & quarter <= 20), aes(x = forcats::fct_reorder(quarter_short, as.numeric(quarter)) , y = crd_rate)) + geom_line(aes(colour = label, group=label), size = 1) + geom_point(aes(colour = label, shape = label)) + shape_palette + trend_palette + labs(x = element_blank(), y = "Crude rate\nper 1,000\npeople") + theme(panel.background = element_blank(), panel.grid.minor.x = element_line(size = .15, color = "#C0C0C0"), panel.grid.major.y = element_blank(), axis.line.x = element_line(size = .1, color = "#787878"), axis.line.y = element_line(size = .1, color = "#787878"), axis.title.x = element_text(size = 12, face = "bold"), axis.title.y = element_text(size = 12, face = "bold", angle = 0, vjust = 0.5), axis.text.x = element_text(size = 9, angle = 0, hjust = 0.5, vjust = 0.5), legend.title = element_blank(), legend.position = "none", legend.key = element_rect(colour = NA, fill = NA)) + scale_y_continuous(labels = function(x) sprintf("%.1f", x), limits = c(0, NA)) + scale_x_discrete(labels = c(sub(" ", "\n", qtr_list[1,]), "", "", "", sub(" ", "\n", qtr_list[5,]), "", "", "", sub(" ", "\n", qtr_list[9,]), "", "", "", sub(" ", "\n", qtr_list[13,]), "", "", "", sub(" ", "\n", qtr_list[17,]), "", "", "")) # Saving charts as images using function save_plot <- function(chart_number, file_format, list_pos) { chart_title <- case_when(list_pos == 1 ~ paste0("Funnel_Plot.", file_format), T ~ paste0("Chart_", chart_number, ".", file_format)) ggsave(paste0("Chart_", chart_number, ".", file_format), plot = chart_object[[list_pos]], width = 17.49, height = 9.03, units = "cm", device = "png", dpi = 600) } # To loop the ggsave, plots need to be in a list chart_object = list(funnel_plot, chart_2, chart_3, chart_4, chart_5, chart_6, chart_7, chart_8, chart_9, chart_10) mapply(save_plot, chart_number = c(1:10), file_format = "png", list_pos = c(1:10)) mapply(save_plot, chart_number = c(1:10), file_format = "svg", list_pos = c(1:10))
pub_url = paste0("https://publichealthscotland.scot/publications/hospital-standardised-mortality-ratios/hospital-standardised-mortality-ratios-", tolower(format(end_date %m+% months(-11), "%B-%Y")), "-to-", tolower(format(end_date, "%B-%Y")), "/") url_list <- data.frame(a = c(1, 2, 3, 4), url = c(pub_url, pub_url, pub_url, pub_url), stringsAsFactors = FALSE)
c1 <- c(paste0("[Table 1 (Hospital Standardised Mortality Ratios)](", url_list[1, "url"], ")"), paste0("[Table 2 (NHSScotland, NHS Board and hospital overall crude mortality trends and NHSScotland crude mortality trends by demographics and quarter)](", url_list[2, "url"], ")"), paste0("[Table 3 (Crude 30-day mortality from discharge and Overall population crude mortality rates by NHS Board and quarter)](", url_list[3, "url"],")")) c2 <- c(file_sizes(end_date, filepath = paste0(data_folder, pub_day, "/output/"))[1], file_sizes(end_date, filepath = paste0(data_folder, pub_day, "/output/"))[2], file_sizes(end_date, filepath = paste0(data_folder, pub_day, "/output/"))[3]) table_list <- data.frame(c1, c2)
c1 <- c(months(pub_date(end_date, "current") - months(1)), months(pub_date(end_date, "current")), months(pub_date(end_date, "current") + months(1))) c2 <- c(paste0("Source database refreshed (", format(submission_deadline(end_date), "%d %B %Y"),"); Analytical work begins, involving extraction of patient observations with outcome, mapping of predictions from baseline model, calculation of observed & predicted deaths at Hospital-level calculated by aggregating outcomes and predictions, import to reporting template, internal QA and data scrutiny (data completeness); Management Information Tool made available to NHS Boards (", format(mit_available(end_date), "%d %B %Y"),")"), paste0("Official statistics report production cycle commences; Scottish Government and NHS Boards receive standard pre-release access (", format(pub_date(end_date, "current") - days(7), "%d %B %Y"),"); PHS briefs Scottish Government on content of report (", format(pub_date(end_date, "current") - days(6), "%d %B %Y"),"); Report published on PHS website at 09:30 on Tuesday ", format(pub_date(end_date, "current"), "%d %B %Y"),"."), "Hospital Intelligence Dashboard released to Scottish Government’s Directorate for Health Performance and Delivery; Scottish Government and HIS briefed by PHS on analytical data issues and interpretation of the dashboard; dashboard presented to Scottish Government Health & Social Care Management Meeting.") q_process <- data.frame(c1, c2)
c1 <- c("Ayrshire & Arran", "Borders", "Dumfries & Galloway", "Fife", "Forth Valley", "Golden Jubilee", "Grampian", "Greater Glasgow & Clyde", "Highland", "HIS", "Lanarkshire", "Lothian", "Orkney", "Shetland", "Tayside", "Western Isles") c2 <- c("Clinical Improvement Manager, Assistant Director (Healthcare Quality, Governance and Standards), Associate Medical Director","Director of Nursing, Patient Safety Programme Manager", "Nurse Director and Director for Patient Safety, Patient Safety & Improvement Manager", "Patient Safety Programme Manager", "Director of Nursing, Head of Clinical Governance", "Clinical Governance Manager, Director of Nursing & Clinical Services", "Director of Nursing, SPSP Programme Manager", "Head of Clinical Governance", "Head of Quality, Health Intelligence Specialist", "Executive Clinical Director, Consultant in Public Health Medicine, National Clinical Lead for Quality and Safety, 2x Health Improvement Advisors", "Head of Clinical Governance and Risk Management, Patient Safety Manager, 2x Quality Facilitators", "Consultant in Public Health, SPSP Programme Manager, Associate Medical Director", "Clinical Governance & Risk Management Lead", "Director of Pharmacy, Programme Manager - 18 Weeks / SPSP, Senior Planning & Information Officer", "Patient Safety Co-ordinator, Patient Safety Development Manager", "Nurse Director & Director of Patient Safety, SPSP Programme Manager") mi_list <- data.frame(c1, c2)
c1 <- c("**Patients**", "**Deaths**", "**Adjustments**") c2 <- c("One patient observation per spell attributed to the last acute trust prior to death.", "Deaths within 30 days of admission to an acute hospital (wherever they occur); In-hospital deaths occurring beyond 30-days are excluded. ", "CCS group (primary diagnosis)/ Specialty (medical or surgical) / age / sex / admitted from / number and severity of prior morbidities in the previous (i) 12 months (ii) 5-years / number and severity of co-morbidities on admitting episode / number of emergency admissions in the previous 12 months / inpatient or day case / type of admission (elective / non-elective)/ deprivation") c3 <- c("One patient observation per spell attributed to the last acute trust prior to death.", "All deaths occurring in hospital; and deaths within 30 days of discharge from acute hospital (wherever they occur)", "Age/ sex/ admission type/ CCS group (diagnosis) / comorbidity (modified Charlson score) ") c4 <- c("One patient observation per spell attributed to each acute trust involved in care. Only patients with a diagnosis that falls within 56 diagnosis groups are included (~80% of all activity)", "All inpatient and day case deaths in hospital ", "Age/ sex/ admission type/ CCS group (diagnosis) / comorbidity (modified Charlson score)/ deprivation/ previous emergency admissions / palliative care (specialty code 315; ICD10 code Z515/source of admission) ") table_eng_comp <- data.frame(c1, c2, c3, c4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.