Help using Base SAS procedures

Calculate Readmission if one is present help

Accepted Solution Solved
Reply
Regular Contributor
Regular Contributor
Posts: 238
Accepted Solution

Calculate Readmission if one is present help

Ok. So I have the below code that merges 2 tables. 1 has the claims information for the patients from the other table. Patients can have multiple admission dates for the same procedure. So, the goal is to say after the patient was discharged say on 1/1/2011 was there a readmission on 1/2/2011 + 30days. The readmission with my code is looking at if they were readmitted the same day and the disch_dt still +30 days. But I need to look and say start looking the day after they were discharged. I tried b.disch_dt+1 for the first case statement but that returned over 7k readmissions which is not correct. It should be around 3800. So I have a comment in there but did that and that did not work. Left the comments in there, not sure why. Maybe so others can see what I have attempted. Not sure what that A. B. things are. that is not in the code. Those Cap letters like the one prior to A.*,. I pasted this from my code so it looks like something that was added on paste. This code runs just fine just does not output the expected results. Again I need it to look at if the patient was discharged on whatever date. Does not matter. Just used 1/1/2011 as example. But say they were discharged 6/30/2011. I need to give it 1 full day, so beging looking on 7/1/2011 and if they were readmitted between 7/1/2011 and 30 days then yes they were readmitted. Thanks. Hope someone can help me figure this out. I know it has something to do with adding an additional case and then the next code that is data needs something added to it.

PROC SQL;

CREATE TABLE ReAdm.Claims_Merge AS

(SELECT DISTINCT

  1. A.*,
  2. B.ADMIT_DT FORMAT=DATE8.,

CASE WHEN B.DISCH_DT IS NULL THEN A.FST_SRVC_DT ELSE B.DISCH_DT END AS DISCH_DT FORMAT=DATE8.,

CASE WHEN B.DISCH_DT IS NOT NULL THEN B.DISCH_DT+30 END AS CUTPUT_DT FORMAT=DATE8.,

/*CASE WHEN B.ADMIT_DT IS NOT NULL THEN B.DISCH_DT+1 END AS START_DT FORMAT=DATE8.,*/

  1. B.STAT_DAY

FROM ReAdm.Claims A

LEFT JOIN ReAdm.Claims_Inpt B

ON A.MBR_SYS_ID = B.MBR_SYS_ID

AND

  1. A.FST_SRVC_DT BETWEEN B.ADMIT_DT AND B.DISCH_DT)

ORDER BY MBR_SYS_ID, STAT_DAY DESC;

QUIT;

PROC SORT NODUPKEY; BY MBR_SYS_ID--PROV_EFF_DT;

RUN;

DATA READM.CLAIMS_INPT2; SET READM.CLAIMS_INPT;

READMIT_DT=ADMIT_DT;

REDISCH_DT=DISCH_DT;

CUTPUT_DT2=DISCH_DT+30;

FORMAT READMIT_DT DATE8. REDISCH_DT DATE8. /*COUNT_DT DATE8.*/ CUTPUT_DT2 DATE8.;

KEEP READMIT_DT REDISCH_DT MBR_SYS_ID COUNT_DT CUTPUT_DT2 ;

RUN;

PROC SQL;

CREATE TABLE ReAdm.Claims_Merge2 AS

(SELECT DISTINCT

  1. A.*,
  2. A.ADMIT_DT FORMAT=DATE8.,
  3. B.READMIT_DT FORMAT=DATE8.,
  4. B.REDISCH_DT FORMAT=DATE8.,
  5. B.CUTPUT_DT2 FORMAT=DATE8.

FROM ReAdm.Claims_Merge A

LEFT JOIN ReAdm.Claims_Inpt2 B

ON A.MBR_SYS_ID = B.MBR_SYS_ID

AND

  1. B.READMIT_DT BETWEEN A.DISCH_DT AND A.CUTPUT_DT)

ORDER BY MBR_SYS_ID, STAT_DAY DESC;

QUIT;

PROC SORT NODUPKEY; BY MBR_SYS_ID--PROV_EFF_DT;

RUN;


Accepted Solutions
Solution
‎04-12-2012 09:03 AM
Regular Contributor
Regular Contributor
Posts: 238

Re: Calculate Readmission if one is present help


All Replies
Regular Contributor
Regular Contributor
Posts: 238

Re: Calculate Readmission if one is present help


Hum. think everyone is stumped by this one.

Solution
‎04-12-2012 09:03 AM
Regular Contributor
Regular Contributor
Posts: 238

Re: Calculate Readmission if one is present help

got it working

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 811 views
  • 0 likes
  • 1 in conversation