• buckeye_sql3000 (4/24/2014)


    Hello,

    I've read many posts about hospital readmissions, but my question is a bit different, so I thought to post.

    Fields in pt_table:

    encounter_id --(unique per visit)

    medical_record_num

    admit_date

    discharge_date

    {many other fields}

    Deliverable:

    I'd like to scan the pt_table or join it to itself in order to create another table of all index_admissions which are all admissions into the hospital with a subsequent readmission or readmissions. A readmission for this task will be defined as any inpatient return to the hospital within 30 days after the Index admission's discharge_date and all readmissions are counted separately.

    The other table will be the subsequent 30_day_readmissions table.

    So, the index_admission table can have one patient(row) which can link to multiple rows in the 30_day_readmissions table if the patient was readmitted multiple times within 30 days after the Index admission. Patients can also be readmitted back to the hospital on the same day of discharge or readmitted twice on another following the discharge day. All rows in the 30_day_readmission table should have a linking row in the index_admission table.

    Any help is greatly appreciated!

    Why do you want a separate table for this? This is a perfect example of where a view fits the bill perfectly.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/