BookmarkSubscribeRSS Feed
Guptashwe
Calcite | Level 5

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

1 REPLY 1
PeterClemmensen
Tourmaline | Level 20

Can you post what your desired result looks like? Makes it much easier to help you 🙂

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1072 views
  • 0 likes
  • 2 in conversation