Hi Experts, My data looks like this: WANT: WANT: WANT; Identifier admitday dischargeday COUNT NEWADMITDAY NEWDISDAY 1 16JUL2023 18JUL2023 1 16JUL2023 18JUL2023 2 11FEB2022 16FEB2022 1 11FEB2022 16FEB2022 2 27MAR2023 03APR2023 2 27MAR2023 03APR2023 3 01OCT2017 31OCT2017 1 01OCT2017 24JAN2018 3 01NOV2017 30NOV2017 1 01OCT2017 24JAN2018 3 01DEC2017 31DEC2017 1 01OCT2017 24JAN2018 3 01JAN2018 11JAN2018 1 01OCT2017 24JAN2018 3 12JAN2018 23JAN2018 1 01OCT2017 24JAN2018 3 13JAN2018 24JAN2018 1 01OCT2017 24JAN2018 3 23JUN2018 28JUN2018 2 23JUN2018 28JUN2018 4 05FEB2021 06FEB2021 1 05FEB2021 14FEB2021 4 05FEB2021 07FEB2021 1 05FEB2021 14FEB2021 4 05FEB2021 11FEB2021 1 05FEB2021 14FEB2021 4 05FEB2021 14FEB2021 1 05FEB2021 14FEB2021 I need to count hospitalizations per patient. However, multiple overlapping hospital admissions and discharge records should be collapsed into 1 inpatient encounter. In addition, an inpatient encounter with an admission date that occurred within 1 day of a prior inpatient encounter should be counted as a single inpatient encounter. You can see that for identifier #3, this patient had one hospitalization from Oct 1, 2017 – Jan24 and one from June 23, 2018 – June 28, 2018. Any help would be greatly appreciated!
... View more