I successfully grouped the diagnosis code into disease classes and label it as "yes" for each DMRN. This is how the outcome looks like:
DMRN |
DX_CODE |
DX_NAME |
nervous |
circular |
respiratory |
genitourinary |
constipation |
DM |
7 |
I10 |
hypertension |
|
Yes |
|
|
|
|
7 |
J44.9 |
COPD |
|
|
Yes |
|
|
|
7 |
M19.90 |
Arthritis |
|
|
|
|
|
|
7 |
N40.0 |
BPH |
|
|
|
Yes |
|
|
Then, I would like to collapse the rows so that each DMRN has only one row and drop DX_CODE and DX_NAME.
This is how I want the table look like:
DMRN |
nervous
|
circular |
respiratory |
genitourinary |
constipation |
DM |
7 |
|
Yes |
Yes |
Yes |
|
|
What codes should I use? Thank you so much for your help.