ucl-ihi / CodeClub

Repository for all things IHI CodeClub
https://ucl-ihi.github.io/CodeClub/
3 stars 5 forks source link

checking diagnoses for all the codes present in the readcode file #11

Closed camcaan closed 5 years ago

camcaan commented 5 years ago

data frame with read codes

readcodes <- ("<>")

clinicaldata joining medical.txt dictionary

DX <- clinical_data %>% left_join(medical.txt)

checking the diagnoses based on read codes

PC_DX <- DX %>% filter(readcodes == "F110.00") %>% distinct(epatid) %>% mutate(AD=1)

alhenry commented 5 years ago

Hi @camcaan can you please clarify what are you trying to do here?

Please also close the issue and post the solution (if any) so it doesn't get mixed up with currently active issues

camcaan commented 5 years ago

I was something simple i didn't know how to do. basically i had a read code file and clinical and a medical dictionary file and i wanted to look how many patients had those read code in their diagnoses in the clinical file. so I did (1) joined the clinical file and medical file by medcode column (2) scaned for the read code in the joined file

joining clinical and medical file

dx <- clinical %>% left_join(medical)

filter for the readcodes

PC_diagnoses <- dx %>% filter(readcode %in% read_code$readcode) %>% mutate(AD= 1)