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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

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