Commit 4b2abfe4 authored by Jason Rigby's avatar Jason Rigby
Browse files

Merge branch 'substudy-membership-summary' into 'master'

add alsop and show to substudy membership summary

See merge request aspree/aspree-r-package!30
parents 9fda02b0 1a869acc
......@@ -136,6 +136,22 @@ GetSubstudyMembership <- function(con, country = NA, returnFrequencyTable = TRUE
hearing_membership$Hearing <- hearing_membership$Hearing & hearing_membership$Consent
hearing_membership <- hearing_membership %>% select(SubjectID, Hearing)
alsop_medical_membership <- con %>% tbl("tblAlsopMedical") %>% select("SubjectID") %>% data.frame()
alsop_medical_membership$ALSOP_medical <- TRUE
alsop_social_membership <- con %>% tbl("tblAlsopSocial") %>% select("SubjectID") %>% data.frame()
alsop_social_membership$ALSOP_social <- TRUE
alsop_membership <- alsop_medical_membership %>% merge(alsop_social_membership, by = "SubjectID", all = TRUE)
print(sum(alsop_medical_membership$ALSOP_medical, na.rm = TRUE))
alsop_membership$ALSOP <- alsop_membership$ALSOP_medical | alsop_membership$ALSOP_social
alsop_membership <- alsop_membership %>% select(SubjectID, ALSOP)
alsop_membership <- con %>% FilterRandomisedParticipants(alsop_membership)
alsop_membership$ALSOP[is.na(alsop_membership$ALSOP)] <- FALSE
show_membership <- con %>% tbl("tblBiobankSHOW") %>% select(SubjectID, TubeID) %>% rename(SHOW = "TubeID") %>% data.frame() %>% distinct(SubjectID, .keep_all = TRUE)
show_membership <- con %>% FilterRandomisedParticipants(show_membership)
show_membership$SHOW <- !is.na(show_membership$SHOW)
membership <- data.frame(SubjectID = hearing_membership$SubjectID, ASPREE = TRUE) %>%
merge(biobank_membership, by = "SubjectID") %>%
merge(envision_membership, by = "SubjectID") %>%
......@@ -144,7 +160,9 @@ GetSubstudyMembership <- function(con, country = NA, returnFrequencyTable = TRUE
merge(amd_membership, by = "SubjectID") %>%
merge(knee_membership, by = "SubjectID") %>%
merge(neuro_membership, by = "SubjectID") %>%
merge(hearing_membership, by = "SubjectID")
merge(hearing_membership, by = "SubjectID") %>%
merge(alsop_membership, by = "SubjectID") %>%
merge(show_membership, by = "SubjectID")
if (!is.na(country)) {
membership <- membership %>% FilterByCountry(country, sectionPaths)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment