Anny Rodriguez, MPH
Roy Williams, MPH
Prasad Bhoite, MS, MPH
Ingrid Gonzalez, MPH
Catalina Canizares
Gabriel Odom, PhD, ThD
The COVID ShinyApp Code is available on Github.
Portal
Health Risk Profile (HRP)
# Import the required libraries library(odbc) # For Connecting to the database # Create a Database Connection # Note you need to set up DNS configuration before you run the code con <- DBI::dbConnect(odbc::odbc(), "**********") # Read the data tables from MS SQL Server # HRP Tables HRP_Household <- DBI::dbGetQuery(con, "select * from Household") glimpse(HRP_Household) HRP_Member <- DBI::dbGetQuery(con, "select * from Member") glimpse(HRP_Member)
Window Function - lead()::: {.panel-tabset}
# Introducing the Window Function - Lead
Portal_Participating_HH <- Portal_HH_Status_History %>%
group_by(HH_ID) %>%
mutate(end_date = dplyr::lead(as.Date(Status_Date)-1, n = 1, default = NA)) %>%
mutate(end_date = ifelse(is.na(end_date), "2099-12-31", as.character(end_date))) %>%
filter(Status %in% c('Active') &
(end_date >= Start_Date_Reporting_Period) &
(status_date < A_Day_After_End_Date_Reporting_Period)) %>%
distinct(HH_ID, .keep_all = TRUE) %>%
mutate(Participating_HH = "Participating_HH")
tidyDisasters
tidyYRBS
Key contains begin year, month, state and a ticker to differentiate events with the same key
QUESTIONS?