Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Please help!!
I have two tables. One contains detailed summary of visits (including inpatient admissions) ever made to the hospital. Another table has the readmissions summary. I need to calculate the number of visits (observations, follow ups etc) between the previous inpatient admission discharge date and the readmission date.
Readmissions table has fields: readmission_admit_date, previous_discharge_date, PatientID.
VisitSummary table has fields: PatientID, VisitID, VisitServiceDateTime.
Visits between the previous discharge and readmission.
VisitServiceDateTime>previous_discharge_date
and VisitServiceDateTime<readmission_admit_date
How can I get this done? through Load Editor or by Set Analysis. I am open for any suggestion.
You might get more bites if you post a dummy inline table that mirrors the structure of your data. Three things I don't leave home without, my license to drive, my license to carry, and a code sample mirroring the problem I'm trying to solve.
An Example to the datasets:
Visits:
VisitID | PatientID | ServiceDateTime |
V1 | P1 | 1/1/2020 |
V2 | P1 | 1/10/2020 |
V3 | P1 | 1/20/2020 |
V4 | P2 | 1/30/2020 |
V5 | P2 | 2/10/2020 |
V6 | P3 | 2/11/2020 |
Readmissions:
PatientID | readmission_admit_date | previous_discharge_date |
P1 | 1/15/2020 | 12/25/2019 |
P2 | 2/15/2020 | 1/29/2020 |
P3 | 2/15/2020 | 2/12/2020 |
I need:
PatientID | TotalVisitsBetweenPrevDisch&Readmit |
P1 | 2 |
P2 | 2 |
P3 | 0 |