Treatment Duration Assignment:
Please find below a sample data set with three variables:
PATID |
FILL_DT |
INDEX_DATE |
DAYS_SUPP |
1 |
01-Jan-14 |
01-Jan-14 |
30 |
1 |
01-Mar-14 |
01-Jan-14 |
30 |
1 |
01-Feb-14 |
01-Jan-14 |
20 |
1 |
22-Mar-14 |
01-Jan-14 |
15 |
1 |
01-Apr-14 |
01-Jan-14 |
16 |
1 |
15-Apr-14 |
01-Jan-14 |
10 |
2 |
01-Jan-15 |
01-Jan-15 |
20 |
2 |
01-Apr-15 |
01-Jan-15 |
15 |
2 |
01-Feb-15 |
01-Jan-15 |
10 |
2 |
15-Jan-15 |
01-Jan-15 |
16 |
2 |
15-Apr-15 |
01-Jan-15 |
10 |
2 |
05-May-15 |
01-Jan-15 |
50 |
3 |
01-Jan-14 |
01-Jan-14 |
20 |
3 |
01-Mar-14 |
01-Jan-14 |
20 |
4 |
22-Mar-16 |
22-Mar-16 |
40 |
4 |
10-Apr-16 |
22-Mar-16 |
25 |
4 |
01-Apr-16 |
22-Mar-16 |
10 |
Where PATID = Patient ID;
FILL_DT = Date the prescription was filled by the pharmacy;
INDEX_DATE = Date of treatment initiation
DAYS_SUPP= Estimated day count the drug supply should last.
Objective:
Estimate the number of days with continuous treatment prescription (starting from the INDEX_DATE) for every patient
Approach:
Treatment will be considered as continuous when the subsequent FILL_DT of a patient lies immediately after/within the end day of the previous treatment (where END_DATE = FILL_DT + DAYS_SUPP). You need to start from the index date and find the number of days with continuous treatment for every patient. For this, continue following the above-mentioned condition as long as there is break in treatment prescription.
Further, delete the records which do not comply with the continuation criteria. The last date with continuous treatment criteria will be the true end date for each patient.
Outcomes of interest:
Two new variables:
TRUE_END_DATE: The last date fulfilling the continuous treatment criteria for each patient
TX_DURATION: Number of days with continuous treatment based on the above-mentioned criteria
Can you post what your desired result looks like? Makes it much easier to help you 🙂
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.