I have a dataset which includes Unique ID number, Date of Admission and Date of Order of antibiotics. The data has multiple entries for date of admission and date of order of antibiotics. The question I want to answer is whether the patient was on antibiotics on or before 30 days of admission.
Example Dataset.
For each unique ID the challenge is to compare the range of date of order values and see whether it is same or within 30 days prior to the admission date.
Example Dataset.
ID Number | Admission Date | Date of Order | ||
1 |
|
|
||
1 |
|
|
||
2 | 4/18/2015 | 1/22/2015 | ||
2 | 12/28/2015 | 4/20/2015 | ||
2 | 1/20/2015 | 4/21/2015 | ||
2 | 5/20/2015 | 7/16/2015 | ||
2 | 2/25/2016 | 12/28/2015 | ||
3 | 2/27/2015 | 2/23/2015 | ||
4 | 4/16/2015 | 4/17/2015 |
Comment