Hello,
I am working on claims data, and each patient is identified by a unique ID called enrolee ID (enrolid). There are 4 variables that I am interested in dx1, dx2, dx3 and dx4, these variables contain ICD-10 codes (disease diagnosis codes). As this is a claims dataset, there are changes in the diagnosis codes over the years (different dates/years may have different or additional diagnosis for the patient). How do I get a table that has a column for an enrolid and another column for all the dx1s reported in the dataset, and same for dx2, dx3 and dx4
For eg:
I am trying to convert this dataset into a table that looks like this
and similarly for other enrolids
Guidance on this would be greatly appreciated!
I am working on claims data, and each patient is identified by a unique ID called enrolee ID (enrolid). There are 4 variables that I am interested in dx1, dx2, dx3 and dx4, these variables contain ICD-10 codes (disease diagnosis codes). As this is a claims dataset, there are changes in the diagnosis codes over the years (different dates/years may have different or additional diagnosis for the patient). How do I get a table that has a column for an enrolid and another column for all the dx1s reported in the dataset, and same for dx2, dx3 and dx4
For eg:
enrolid | dx1 | dx2 | dx3 | dx4 |
1 | z21 | L40 | L409 | N4230 |
1 | z21 | z113 | R748 | |
1 | z21 | J069 | ||
1 | H35433 | z113 | R748 | |
2 | z21 | L40 | L409 | N4230 |
enrolid | dx1 | dx2 | dx3 | dx4 |
1 | z21, H35433 | L40, z113, J069 | L409, R748 | N4230 |
Guidance on this would be greatly appreciated!
Comment