Hello
I am using SAS 9.3.
I have inpatient and outpatient data. I want to link the Emergency Room abstract with the inpatient one for those admitted via the ER. However, the admit date of the inpatient visit could be a day later than the end date of the ER abstract. Is there any way to do this?
The ED table only has those visits admitted and the inpatient cases only have those admitted via the ED. The current resulting dataset is missing out on those where the ED end date is a day later i.e. the inpatient admit date is April 10, 2017 and the ED end date is April 11, 2017.
My current code:
proc sql;
create table Links as select
a.HCN,
a.alias,
a.admdate,
b.regdate,
b.triage
from inpatients as a
left join ED as b
on a.HCN = b.HCN
and b.enddate<=a.admdate<=b.enddate+1;
Any and all assistance greatly appreciated.
... View more