Hello, I got stuck with this coding and would appreciate any help. I am interested in find the initial/first ever cancer diagnosis (Ischemic Stroke or Hemorrhagic Stroke), the date of initial diagnosis. Then I want to find if there a recurrent dx of ischemic or Hemorrhagic Stroke and create a label for it as recurrent if it occurred after the initial/first cancer diagnosis. For Atrial Fibrillation (AFIB), I want to create a label for each ICD code and label the encounter as pre/post initial stroke depending on the encounter date and initial stroke date. I want to pull data for seizure diagnosis and create a label for each ICD code and label the encounter as “post” initial stroke. Ischemic Stroke ICD 9 codes: 433, 434, 436, I63, I693, G459 Hemorrhagic Stroke ICD 9 codes: 430, 431, 4320, 4321, 4329, I60, I61, I62 Recurrent Ischemic Stroke ICD 9 codes: 435, 436, 433, 434, I60 – I64 AFIB ICD9/10: 42731, I480, I481, I482, I489 Seizure ICD 9/10: 345, 78039, 345, 6494, G40 data have; infile datalines dsd; informat ID diag_dt dx1 dx2 dx3 dx4; input ID $ 1-7 @8 diag_dt :date9. dx1 $ 18-23 dx2 $ 24-29 dx3 $ 30-35; informat diag_dt date9.; format diag_dt date9.; datalines; 0036059 02AUG2023 G459 I4729 I10 0036059 23JUN2023 G459 R29810 I6782 0036059 28JUN2023 Z8673 G459 0036059 14SEP2023 G459 Z8673 0068059 19OCT2009 436 0095408 04AUG2023 A419 I253 K625 0095408 26JUL2021 G459 0095408 22APR2024 I6389 Q2112 0114279 10JUL2003 430 7843 7820 0114279 11JUL2003 74781 431 0114279 16JUL2003 431 74781 0114279 10JUL2003 431 7820 0114279 17JUL2003 4329 0126660 04OCT2006 30924 4321 30742 0126660 18SEP2006 4321 0126660 25SEP2006 4321 0126660 16OCT2006 V679 8509 4321 0204855 09SEP2009 436 78609 V681 0324626 20JUN2002 436 7843 34211 0324626 21JUN2002 436 0324626 01AUG2002 436 0346276 30NOV2009 431 5849 4010 0346276 02DEC2009 431 0222626 01AUG2002 433 0222626 30NOV2009 433 5849 4010 0222626 02DEC2009 G40 6494 ; run;
... View more