I am working with a national database that contains readmission data from approximately 13 million patients in order to identify causes of readmission after a specific diagnosis. Identifying the patients with the diagnosis was done by using COMPUTE procedure1 = ANY('x', DX1 to DX15). The issue I am having is easily identifying all the patients who were initially admitted for the specific diagnosis AND readmitted for complications.
Each time a patient is readmitted, they are identified in the dataset by the same de-identified medical record number (VisitLink in picture), but they don't have the procedure code repeated. To make things a bit more challenging, some patients in the database with the procedure code are not readmitted, and therefore not found more than once.
Is there a way to create a filter or dummy variable that codes for "X" procedure and (if applicable) its "VisitLink" duplicate? Using the example in the picture, can I create a variable or filter patients who have DX1-DX15 42820 and their readmission (as seen by VisitLink x00008o) if there was a readmission?
Thank you in advance for your time and any assistance you may be able to provide!
You do not have the required permissions to view the files attached to this post.