Commit 8540b0c4 authored by Ashley Stewart's avatar Ashley Stewart 💃
Browse files

Merge remote-tracking branch 'Upstream/master'

parents 8010b485 0c385540
......@@ -38,7 +38,8 @@ CommentaryCodesAsFactor <- function(cc) {
`24` = "Data not available in medical record (i.e Pathology for an MRO participant not found it in their medical record)",
`25` = "Visit should have occurred but was not conducted",
`26` = "Visit could not occur",
`27` = "Visit did not occur due to operational issue"
`27` = "Visit did not occur due to operational issue",
`28` = "Participant ineligible"
)
}
......
......@@ -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