Hi,
I am working on a dataset with ICD-codes (fractures in this case) and surgical procedure codes (NCSP) from hospital records data. The ICD-codes (ICD-9 and ICD-10), date of occurrence(Date_ICD) and ID is obtained from one data set, and surgical procedure codes (NCSP), date of occurrence(Date_NCSP) and ID is appended to the ICD-code data set as illustrated in the table bellow
One person might have several ICD- and procedure codes, each with a corresponding date.
The goal is to identify number of occurring fractures per person based on following criteria for fractures:
I have tried to figure out how to identify number of occurring fractures per individual based on the above stated criteria for fractures, but haven’t succeeded.
I would be very pleased if I could get some tips regarding how to solve the following problems:
Hopefully it is possible to understand what I am trying to convey.
Best wishes
Ingebjørg
I am working on a dataset with ICD-codes (fractures in this case) and surgical procedure codes (NCSP) from hospital records data. The ICD-codes (ICD-9 and ICD-10), date of occurrence(Date_ICD) and ID is obtained from one data set, and surgical procedure codes (NCSP), date of occurrence(Date_NCSP) and ID is appended to the ICD-code data set as illustrated in the table bellow
One person might have several ICD- and procedure codes, each with a corresponding date.
The goal is to identify number of occurring fractures per person based on following criteria for fractures:
- ICD-NCSP criteria: Occurrence of an ICD-code and a surgical procedure code (NCSP) within plus/minus 2 months from the other date.
E.g. The participant with ID= 8 is registered with Date_ICD and Date_NCSP on 01jun2021 = fracture. - ICD-ICD criteria: Occurrence of two identical occurring ICD-codes with dates within plus minus three months of the other date. E.g. ID 7 has Date_ICD 01.mar 2013 and Date_ICD 01may2013 =fracture
Number | ID | Date_ICD | ICD9 | ICD10 | Date_NCSP | NCSP |
1 | 1 | 01feb197 | 805.3 | . | . | . |
2 | 2 | . | . | . | 01may2017 | WBGM00 |
3 | 3 | . | . | . | 01nov2020 | WBGM00 |
4 | 4 | 01oct2018 | S72.0 | . | . | |
5 | 4 | . | . | . | 01sep2018 | . |
6 | 5 | 01mar2000 | . | S52.5 | . | . |
7 | 5 | 01mar2000 | . | S52.5 | . | . |
8 | 5 | 01feb2000 | . | S52.5 | . | . |
9 | 6 | . | . | . | 01may2021 | NCX32 |
10 | 6 | . | . | . | 01jun2021 | NCJ65 |
11 | 6 | 01apr2009 | S52.5 | . | . | |
12 | 6 | 01jun2021 | . | S52.5 | . | . |
13 | 6 | 01may2021 | S52.5 | . | . | |
14 | 7 | 01mar2013 | . | S52.5 | . | . |
15 | 7 | 01may2013 | . | S52.5 | . | . |
16 | 8 | 01feb2009 | . | S42.2 | . | . |
17 | 8 | 01jan2009 | . | S42.2 | . | . |
18 | 8 | 01jun2021 | . | S72.1 | . | . |
19 | 8 | . | . | . | 01jun2021 | NFJ61 |
20 | 9 | 01feb2009 | S42.2 | . | . | |
21 | 9 | 01jan2009 | . | S42.2 | . | . |
22 | 9 | . | . | . | 01jun2021 | NFJ61 |
23 | 9 | 01jun2021 | . | S72.1 | . | . |
I have tried to figure out how to identify number of occurring fractures per individual based on the above stated criteria for fractures, but haven’t succeeded.
I would be very pleased if I could get some tips regarding how to solve the following problems:
- For each individual experiencing a fracture that fulfil the above stated NCSP+ ICD-criteria, generate a variable with the date for the occurring Date_ICD event.
- For the ICD+ICD criteria, generate a variable that contains the date for the first occurring ICD-code.
For individuals with several events fulfilling the stated fracture criteria, all the corresponding dates must be included for each individual.
ID | Date_ICD_NCSP_Fx | Date_ICD_ICD_fx |
1 | SomeDate | SomeDate |
1 | SomeDate | . |
2 | SomeDate | . |
2 | . | SomeDate |
3 | SomeDate | . |
Best wishes
Ingebjørg
Comment