Mechanical ventilation is a limited and labor-intensive resource, requiring a team of physicians, nurses, and respiratory therapists working together to effectively manage the patients requiring these resources. Bed management and staffing models are complicated for several reasons. One, mechanical ventilation is generally restricted to intensive care units with small, fixed numbers of beds relative to the hospital. Second, each type of provider (MD, RN, RT) has a different provider-to-patient ratio to be safe and effective. Third, there are likely seasonal variations in the incidence of acute respiratory failure and a resultant fluctuation in the utilization of mechanical ventilation. I hypothesize that the magnitude of this variation throughout a year likely varies based on hospital geography, hospital urban/rural designation, hospital teaching status, hospital size, and the given years severity of influenza. Understanding hospital-level seasonal variation in case volume of acute respiratory failure may help in healthcare systems planning and resource allocation and anticipate needs for surge capacity for influenza pandemics.
General question:
What is the seasonal variation of acute respiratory failure hospital case volume?
Study Aims:
Describe the trends in hospital case volume of acute respiratory failure per year in the United States from 2002 to 2014 in the HCUP NIS. * Examine by year, quarter, and month as unit of time * Quantify the within-year variance and percent change from minimum to maximum time epoch in the case volume of acute respiratory failure within a calendar year (from January to December) and seasonal year (from July to June of the following calendar year).
Data Overview
“NIS is the largest publicly available all-payer inpatient health care database in the United States, yielding national estimates of hospital inpatient stays. Unweighted, it contains data from more than 7 million hospital stays each year from ~1,000 hospitals. Weighted, it estimates more than 35 million hospitalizations nationally”
The following ICD-9-CM diagnostic codes will be used to construct a respiratory failure case definitions:
Furthermore, each definition includes one version with only the diagnostic code(s) and one version with any of the ICD-9- CM procedure codes:
Initial data management was performed using SAS 9.4 SURVEY family of procedures accounting for the complex survey design. Statistics were output to CSV files for use within R. Further data management for graphical presentation and within year statistics were performed in R
To view SAS code use the following link (can be added later).
To view R code select the button to the right.
census <- read.csv("USCensusEst_2000_2017.csv")
#Annual datasets build out
census.annual <- census %>%
filter(MONTH == 12) %>%
select(year = YEAR, Population = TOT_POP)
annual <- read.csv('nis_2002_2014_annualstats.csv')
discharges.annual <- annual %>%
filter(VarName == "DIED"|
VarName == "discharges")%>%
mutate(Status= as.factor(if_else(VarName == "DIED", "dead",
if_else(VarName == "discharges",
"any", NA_character_))))%>%
select(-VarName)
mortality.annual <- spread(discharges.annual, Status, Sum)
mortality.annual <- mortality.annual %>%
mutate(Mortality = round(100*dead/any, digits = 2),
group="all")
arf.annual <- annual %>%
filter(
VarName != "discharges" &
VarName !="DIED")%>%
separate(col = VarName,
into = c("ICD","Codes","Status"),
sep = "_",
remove = T,
fill = "right") %>%
mutate(ICD, ICD =
if_else(ICD=="arf0","All",
if_else(ICD=="arf5185","518.5",
if_else(ICD=="arf51851","518.51",
if_else(ICD=="arf51852","518.52",
if_else(ICD=="arf51853","518.53",
if_else(ICD=="arf51881","518.81",
if_else(ICD=="arf51882","518.82",
if_else(ICD=="arf51883","518.83",
if_else(ICD=="arf51884","518.84",NA_character_))))))))),
Codes, Codes = if_else(Codes=="dx","Diagnostic only",
if_else(Codes=="dxpx","With 96.7x ", NA_character_)),
Status,
Status = if_else(is.na(Status), "any", Status),
Codes = as.factor(Codes),
Status = as.factor(Status))
arf.annual <- left_join(arf.annual, census.annual, by = c("year"))
arf.annual <- arf.annual %>%
mutate(incidence = round(100000*Sum/Population, digits = 1))
#arf.annual_any <- filter(arf.annual , Status == "any")
arf0.annual <- arf.annual %>%
filter(ICD=="All")
arf0.annual_cfr <- arf0.annual %>%
select(-Population, -incidence)
arf0.annual_cfr <- arf0.annual_cfr %>%
spread(Status, Sum) %>%
group_by(ICD, Codes)%>%
mutate(Mortality = round(100*dead/any, digits = 2))
#Quarterly datasets build out
census.quarter <- census %>%
rename(Year = YEAR,
Population = TOT_POP) %>%
filter(MONTH %in% c(3,6,9,12))%>%
mutate(Quarter = if_else(MONTH == 3, paste0(Year, ".1"),
ifelse(MONTH == 6, paste0(Year, ".2"),
ifelse(MONTH == 9, paste0(Year, ".3"),
ifelse(MONTH == 12, paste0(Year, ".4"),
NA_character_))))) %>%
select(Quarter, Population)
quarter <- read.csv('nis_2002_2014_quarterstats.csv')
discharges.quarter <- quarter %>%
filter(VarName == "DIED"|
VarName == "discharges")%>%
mutate(Quarter= paste0(year, ".",DQTR),
Status= as.factor(if_else(VarName == "DIED", "dead",
if_else(VarName == "discharges",
"any", NA_character_))))%>%
select(-DQTR, -VarName)
mortality.quarter <- spread(discharges.quarter, Status, Sum)
mortality.quarter <- mortality.quarter %>%
mutate(Mortality = round(100*dead/any, digits = 2),
group="all")
discharges.quarter_sd <-discharges.quarter %>%
group_by(year)%>%
summarise(SD = as.integer(sd(Sum)),
normal.SD = SD/mean(Sum),
max = max(Sum),
min = min(Sum),
mean = mean(Sum),
abs_difference = max(Sum)-min(Sum),
rel_difference = round(100*abs_difference/min(Sum), digits = 1))
arf.quarter <- quarter %>%
filter(
VarName != "discharges" &
VarName !="DIED")%>%
separate(col = VarName,
into = c("ICD","Codes","Status"),
sep = "_",
remove = T,
fill = "right") %>%
mutate(ICD, ICD =
if_else(ICD=="arf0","All",
if_else(ICD=="arf5185","518.5",
if_else(ICD=="arf51851","518.51",
if_else(ICD=="arf51852","518.52",
if_else(ICD=="arf51853","518.53",
if_else(ICD=="arf51881","518.81",
if_else(ICD=="arf51882","518.82",
if_else(ICD=="arf51883","518.83",
if_else(ICD=="arf51884","518.84",NA_character_))))))))),
Codes, Codes = if_else(Codes=="dx","Diagnostic only",
if_else(Codes=="dxpx","With 96.7x ", NA_character_)),
Status,
Status = if_else(is.na(Status), "any", Status),
Quarter= paste0(year, ".",DQTR),
Codes = as.factor(Codes),
Status = as.factor(Status))
arf.quarter <- left_join(arf.quarter, census.quarter, by = c("Quarter"))
arf.quarter <- arf.quarter %>%
mutate(incidence = round(100000*Sum/Population, digits = 1))
arf.quarter_any <- filter(arf.quarter , Status == "any")
arf.quarter_any_sd <- arf.quarter_any %>%
filter(Quarter != "2011.4" | ICD != "518.5")%>%
group_by(year, ICD, Codes)%>%
summarise(SD = as.integer(sd(Sum)),
normal.SD = SD/mean(Sum),
max = max(Sum),
min = min(Sum),
mean = mean(Sum),
abs_difference = max(Sum)-min(Sum),
rel_difference = round(100*abs_difference/min(Sum), digits = 1))
arf.quarter_cfr <- arf.quarter %>%
select(-DQTR, -Population, -incidence)
arf.quarter_cfr <- arf.quarter_cfr %>%
spread(Status, Sum) %>%
group_by(Quarter, ICD, Codes)%>%
mutate(Mortality = round(100*dead/any, digits = 2))
arf0.quarter <- arf.quarter %>%
filter(ICD=="All")
arf0.quarter_sd <- arf0.quarter %>%
filter(Status == "any")%>%
group_by(year, Codes)%>%
summarise(SD = as.integer(sd(Sum)),
normal.SD = SD/mean(Sum),
max = max(Sum),
min = min(Sum),
mean = mean(Sum),
abs_difference = max(Sum)-min(Sum),
rel_difference = round(100*abs_difference/min(Sum), digits = 1))
arf0.quarter_cfr <- arf0.quarter %>%
select(-DQTR,-Population, -incidence)
arf0.quarter_cfr <- arf0.quarter_cfr %>%
spread(Status, Sum) %>%
group_by(Quarter, Codes)%>%
mutate(Mortality = round(100*dead/any, digits = 2))
#Monthly Build out
arf0.month <- read.csv('nis_2002_2014_month_variation.csv')
arf0.month <- arf0.month %>%
dplyr::mutate(
AMONTH_FACTOR = as.factor(AMONTH),
month_year_char = paste(AMONTH, "01", year, sep = "/"),
month_year_char = str_pad(month_year_char, width = 7, side = "left", pad = "0"),
Month_Year = as.POSIXct(month_year_char, format = "%m/%d/%Y"))
Before examining epidemiology of respiratory failure we will briefly examine of all hospital discharges.
Summary Over the time period, discharges appear to have peaked in first quarter of 2008, with a general decline since then despite the quarterly fluctuations. Within-year fluctuations appear to have their peaks at the first quarter. The differences in number of discharges from maximum to minimum quarter within a year, relative to the minimum quarter, is large. There is from approximately 4700% to 5800% increase in discharges from minimum to maximum quarters within the years.Hospital mortality appears to have a consistent annual variation, with peaks also in the first quarters. While the range appears small (within 0.3-0.4% within each year) this translates to large numbers of deaths when considering that both admissions and mortality are increased during same period of the year.
Here we utilize 2 case definitions that group together all diagnostic codes for respiratory failure. The two remaining case definitions respond to with or without procedural codes for mechanical ventilation. These case definitions were included in the above graphical analyses but now as we add more variables it would become difficult to discern patterns. Furthemore, these inclusive definitions generally seemed representative of the trends in the singular definitions.
Summary
The above graphs repeat data from above, just singling out our selected case definitions. Pulling from the data table above, the number of disharges with any diagnostic code is increasing at about 31,000 more discharges a year while the number of discharges with any diagnostic code ofr respiratory failure that also include a procedural code for mechanical ventilation is increasing at about 5,900 more discharges per year.
Summary The above graphs represent the absolute and relative (relative to that year’s minimum.) difference between the maximum and mimumn quarterly discharges within a year. The percent changes are similar for the two case definitions within each year. The average change within a year is 16.5846154%. I would interpet this that on average the nation can expect a 17% increase in diagnoses of respiratory failure from the lowest quarter of summer to the highest quarter of winter. This means different things for diagnoses only and diagnoses + procedural codes, since the diagnoses only codes continue to increase at a more pronounced magnitude. In number of discharges, for diagnostic codes this meant a different of 45,000 more discharges in 2002 and 124,000 more winter discharges in 2013 across the nation. For cases including procedural codes, this meant a difference of 22,000 more winter discharge in 2002 and 43,000 more winter discharges in 2011.