Skip to content

Commit

Permalink
Add case_when statement for high_cc cohort
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 committed Feb 7, 2024
1 parent cd8b359 commit e30284b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions R/create_demographic_lookup.R
Original file line number Diff line number Diff line change
Expand Up @@ -344,18 +344,21 @@ assign_d_cohort_high_cc <- function(dementia,
liver,
cancer,
spec) {
high_cc <-
high_cc <- dplyr::case_when(
spec == "G5" ~ TRUE,
# FOR FUTURE: PhysicalandSensoryDisabilityClientGroup or LearningDisabilityClientGroup = "Y",
# then high_cc_cohort = TRUE
# FOR FUTURE: Care home removed, here's the code: .data$recid = "CH" & age < 65
rowSums(dplyr::pick(c(
(rowSums(dplyr::pick(c(
"dementia",
"hefailure",
"refailure",
"liver",
"cancer"
)), na.rm = TRUE) >= 1L |
spec == "G5"
)), na.rm = TRUE) >= 1L) ~ TRUE,
.default = FALSE
)

return(high_cc)
}

Expand Down

0 comments on commit e30284b

Please sign in to comment.