GEMINI-Medicine / Rgemini

A custom R package that provides a variety of functions to perform data analyses with GEMINI data
https://gemini-medicine.github.io/Rgemini/
Other
3 stars 0 forks source link

Homelessness indicator development #114

Closed shijiaSMH closed 1 week ago

shijiaSMH commented 5 months ago

Will add a homelessness function when specific implementation is agreed by group, based on conceptual and empirical evidence

shijiaSMH commented 3 months 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

loffleraSMH commented 1 month ago

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).