October 2019

Background

40250 patients recorded as having died over a 5 year period.

169 deaths per week over 9 clinical systems.

WHERE DO YOU START?

Start by looking at the patterns in a public health context…

How? …

Introduce seasonality effects in deaths.

Overall Trends in all deaths

And…

Difference in gender and longevity.

Weekly recorded deaths of patients

Females are more likely to die at a much older age. Deaths in under 30 year olds is less likely

Females are more likely to die at a much older age. Deaths in under 30 year olds is less likely

ONS Provisionally Reported Weekly deaths

Key data issues:

  • wide form data
  • numerous blank rows and blank columns
  • multiple sheets
  • file name changes each week

Transform this…

To this…

date Total deaths, all ages
2018-01-05 12723
2018-01-12 15050
2018-01-19 14256
2018-01-26 13935
2018-02-02 13285

Using

amongst other packages, Janitor commands:

  • clean names: removes spaces in column headers and replaces with the _ character
  • remove_empty: gets rid of rows and columns – this dataset has a lot of those!
df <- DeathsImport %>% 
  clean_names %>% 
  remove_empty(c("rows","cols")) 

Blog links

Suspected and confirmed Suicides - code

Using qicharts2 c chart (Poisson distribution)

#qicharts2 code

Suic_Plot <- qic(WeekRnd, n,
    data = Suic,
    chart = "c",
    title = "Suspected Suicide Deaths",
    subtitle = "SPC c Chart by week",
    caption = "As recorded on Ulysses",
    ylab = "Number",
    xlab = "Time",
    x.angle = 45) +
  scale_y_continuous(breaks = pretty_breaks(3))

Suspected and confirmed Suicides - plot

Finding the data behind the plot - code

Patients who died who are outside of the upper control limit from the previous chart.

#Get the dates where the points are outside of the control limits
Suic_Sigma <- Suic_Plot$data %>% 
  filter(sigma.signal == TRUE) %>% 
   mutate(WeekRnd = as.Date(x))
  #mutate(Week = as.Date(x) %m-% weeks(1)) #for mR charts (Gaussian)

#Taking these dates join back to the data set to get patient details
Suicide_Pseudo <- Deaths_Services %>% 
  filter(!is.na(Suicide)) %>%
  inner_join(Suic_Sigma) %>% 
  select(MergedID, SI, CoronersVerdict, Suicide)  %>% 
  group_by(MergedID, CoronersVerdict, Suicide) %>% 
  slice(1) %>% 
  ungroup() %>% 
  mutate(ID = row_number(MergedID)) %>% 
  select(ID, SI, CoronersVerdict, IncidentCategory = Suicide) %>% 
  arrange(ID)

Finding the data behind the plot - data

ID SI CoronersVerdict IncidentCategory
1 Y Narrative Suicide - Apparent
2 Y Narrative Suicide - Apparent
3 N Drug Related Suicide - Apparent
4 Y NA Suicide - Apparent
5 Y Open Suicide - Apparent
6 Y Suicide Suicide - Apparent
7 Y NA Suicide - Apparent
8 N NA Suicide - Confirmed

Time between SPC

T charts are used for rare events (exponential distribution)

Time between SPC with break

Interactive Chart

Using ggplotly the charts can be made interactive.

Downsides: - caption and subtitle doesn't work

ggplotly(tChart_Suicide)

Conclusions

  • Patient Safety Managers do a great job of verifying and spotting patterns
  • No untoward patterns found
  • Areas of potential hidden risk need more data: hospice care, end of life

Thanks to…