diff --git a/R/00-update_refs.R b/R/00-update_refs.R index c32bfdf57..5a3fab1f3 100644 --- a/R/00-update_refs.R +++ b/R/00-update_refs.R @@ -17,13 +17,15 @@ # ################################################################################ +## MANUALLY UPDATE ##----------------------------------------------------------- + #' End date #' #' @return Get the end date of the latest update period #' @export #' end_date <- function() { - ## UPDATE ## + ## MANUALLY UPDATE ## # Specify update by indicating end of quarter date # Q1 June = 30062024 # Q2 September = 30092024 @@ -70,20 +72,39 @@ check_year_valid <- function( "sds", "sparra" )) { + ## MANUALLY UPDATE ## + # Check extracts which we do not have data for and ensure this is picked up + # by the following code: + # DN starts in 2015/16 + # SPARRA starts in 2015/16 if (year <= "1415" && type %in% c("dn", "sparra")) { return(FALSE) + # CMH starts in 2016/17 + # Homelessness starts in 2016/17 + # DD starts in 2016/17 } else if (year <= "1516" && type %in% c("cmh", "homelessness", "dd")) { return(FALSE) + # Social Care data sets start in 2017/18 Q4 + # Cost_DNAs start in 2017/18 } else if (year <= "1617" && type %in% c("ch", "hc", "sds", "at", "client", "cost_dna")) { return(FALSE) + # HHG starts in 2018/19 } else if (year <= "1718" && type %in% "hhg") { return(FALSE) + # CMH stops in 2020/21 + # DN stops in 2020/21 } else if (year >= "2122" && type %in% c("cmh", "dn")) { return(FALSE) + # HHG stops in 2022/23 } else if (year >= "2324" && type %in% "hhg") { return(FALSE) + ## CHECK - what is the latest NSU cohort available? + # NSU is currently available for 2023/24 + ## CHECK - What period does SDS data get submitted? + # SDS is only available up to March 2024 currently. } else if (year >= "2425" && type %in% c("nsu", "sds")) { return(FALSE) + ## CHECK - what data do we have available for Social Care and SPARRA? } else if (year >= "2526" && type %in% c("ch", "hc", "sds", "at", "sparra")) { return(FALSE) } @@ -91,6 +112,9 @@ check_year_valid <- function( return(TRUE) } +#------------------------------------------------------------------------------- + +## AUTOMATED REFS - please check to ensure these are used correctly ## #' Delayed Discharge period #'