I have a data set where a patient and their claim dates, I want to flag the date which is the index disease date. Logic is that the patient must have at least 2 claim with-in 30 days to confirm the patient has the disease (A, B, C have disease). Next, we want to identify the Index date, which is not same as the min date of the patient (ex: Patient B's 1st claim doesn't meet our disease condition as no. of claims between 05/01 and 30days is only 1).
Have:
PatientID Dates
A 01/01/2018
A 01/03/2018
A 03/01/2018
A 03/03/2018
B 05/01/2018
B 07/02/2018
B 07/05/2018
C 06/07/2018
C 06/13/2018
Want:
PatientID Dates Flag
A 01/01/2018 Index
A 01/03/2018 Treatment
A 03/01/2018 Treatment
A 03/03/2018 Treatment
B 05/01/2018 Screening
B 07/02/2018 Index
B 07/05/2018 Treatment
C 06/07/2018 Index
C 06/13/2018 Treatment
What if a patient has multiple set of dates that are within 30 days of each other?
@Sujithpeta wrote:
Primary goal is to identify the index date, not much worried about flagging the treatment and screening.
I am going to suggest that you may be suppressing too much information. Since your implication is that these should be somehow related, the within 30 days, then shouldn't we be looking at what was actually done on any given date?
Or at least verify that all of the dates that you show have already been filtered to the appropriate tests, diagnosis, treatments, or whatever.
From unpleasant experience I know that is very possible to have multiple medical claims on the same date that are not related to other claims.
Hey, I already filtered for appropriate claims without multiple same day claims, my data set is just unique patient ID and dates.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.