-
Notifications
You must be signed in to change notification settings - Fork 0
/
CancerDiagnosis.sql
19 lines (19 loc) · 1.54 KB
/
CancerDiagnosis.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CASE
WHEN {Medical\Date Cancer Diagnosis 1} < {Personal\P DOB} THEN 'Cancer Diagnosis 1 before DOB'
WHEN {Medical\Date Cancer Diagnosis 2} < {Personal\P DOB} THEN 'Cancer Diagnosis 2 before DOB'
WHEN {Medical\Date Cancer Diagnosis 3} < {Personal\P DOB} THEN 'Cancer Diagnosis 3 before DOB'
WHEN {Medical\Date Cancer Diagnosis 4} < {Personal\P DOB} THEN 'Cancer Diagnosis 4 before DOB'
WHEN {Medical\Date Cancer Diagnosis 1} > {Personal\P DOD} THEN 'Cancer Diagnosis 1 after DOD'
WHEN {Medical\Date Cancer Diagnosis 2} > {Personal\P DOD} THEN 'Cancer Diagnosis 2 after DOD'
WHEN {Medical\Date Cancer Diagnosis 3} > {Personal\P DOD} THEN 'Cancer Diagnosis 3 after DOD'
WHEN {Medical\Date Cancer Diagnosis 4} > {Personal\P DOD} THEN 'Cancer Diagnosis 4 after DOD'
WHEN {Medical\Date Cancer Diagnosis 1} = {Personal\P DOB} THEN 'Cancer Diagnosis 1 same as DOB'
WHEN {Medical\Date Cancer Diagnosis 2} = {Personal\P DOB} THEN 'Cancer Diagnosis 2 same as DOB'
WHEN {Medical\Date Cancer Diagnosis 3} = {Personal\P DOB} THEN 'Cancer Diagnosis 3 same as DOB'
WHEN {Medical\Date Cancer Diagnosis 4} = {Personal\P DOB} THEN 'Cancer Diagnosis 4 same as DOB'
WHEN {Medical\Date Cancer Diagnosis 1} = {Personal\P DOD} THEN 'Cancer Diagnosis 1 same as DOD'
WHEN {Medical\Date Cancer Diagnosis 2} = {Personal\P DOD} THEN 'Cancer Diagnosis 2 same as DOD'
WHEN {Medical\Date Cancer Diagnosis 3} = {Personal\P DOD} THEN 'Cancer Diagnosis 3 same as DOD'
WHEN {Medical\Date Cancer Diagnosis 4} = {Personal\P DOD} THEN 'Cancer Diagnosis 4 same as DOD'
ELSE 'OK'
END