Closed shijiaSMH closed 1 week ago
Function development - skeleton codes
Homelessness <- function(data, ipdiagnosis, erdiagnosis){
data[, homeless := F]
data[genc_id %in% ipdiagnosis[diagnosis_code %in% c('Z590', 'Z591')]$genc_id |
genc_id %in% erdiagnosis[er_diagnosis_code %in% c('Z590', 'Z591')]$genc_id, homeless := T]
}
Documentation
Please use the exact same argument/code structure as in covid_flag()
function (see here: https://github.com/GEMINI-Medicine/Rgemini/blob/master/R/covid_flag.R).
Will add a homelessness function when specific implementation is agreed by group, based on conceptual and empirical evidence