BookmarkSubscribeRSS Feed
shellp55
Quartz | Level 8

Hello

I am using SAS 9.2.

With BallardW's help, I use the following code to determine readmits in my patient database:

Data readmits;
set work.AllData;
by chartno admdate sepdate;
last_sepdate=lag(sepdate);
date_dif = admdate - last_sepdate;
/* create some 0/1 coded variables to get counts by summing*/
if first.chartno then do;
readmin_7 = 0;
readmin_14 = 0;
readmin_21 = 0;
readmin_30 = 0;
readmin_more= 0;
date_dif = 0;/* 0 days since last visit for first*/
end;
else do;
readmin_7 = (date_dif le 7);
readmin_14 = (date_dif le 14);
readmin_21 = (date_dif le 21);
readmin_30 = (date_dif le 30);
readmin_more= (date_dif gt 30);
end;


format admdate ddmmyy10. sepdate ddmmyy10.
run;

However, now I want it so that the index case for looking for readmits is specific i.e. a certain doctor and certain procedures (prostatectomy).  I tried initially to run the above and then pluck out readmits for the cases but I ended up with visits that aren't related i.e. the index case was a readmit to another visit which I don't want.  Initially I thought I would create a table of just the index cases and then a table of all other visits but I don't know how I would compare the two to determine readmits.

Any assistance greatly appreciated - thanks.

2 REPLIES 2
Reeza
Super User

index case for looking for readmits is specific i.e. a certain doctor and certain procedures (prostatectomy).


Are you referring to the index case here or the readmits that are specific? I'm not clear...

At any rate, usually you change your by groupings when you need something like this. I'd need more details to make sure this works in your scenario.

Right now you have the following, and although you don't use admit date and separation date they ensure the data is sorted appropriately.

by chartno admdate sepdate

You can expand this by sorting by doctor/procedure:

by chartno doctor procedure admtdate sepdate

and then using by.procedure instead of by.chartno to change your specifications. 

shellp55
Quartz | Level 8

Hi Reeza

I'll provide some sample data soon but just to clarify, I used as you suggested but found that it wasn't calculating the different readmit status of 7, 14, 21 and 30 days, only showing the date_diff time.  Also, the readmit information is attached to the readmit case, not the original case. This is still somewhat useful but what I really want is that the initial case for this doctor/procedure (which I'm calling the index case) has the readmit information attached to it which is why I was wondering whether there should be two data sets merged.

So if chartno 555555 has the criteria of doctor/procedure, then attached to that record is a series of data elements from the 1st readmission, then the second readmission etc.

I don't know if this makes sense and I apologize if it doesn't.  I'll post sample data soon.....

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 2 replies
  • 1115 views
  • 0 likes
  • 2 in conversation