Can anyone help with this please …
I have data where each record represents an inpatient ward stay at a particular hospital ward. A patient may have multiple inpatient ward stays and change ward within an inpatient stay.
There are different types of ward (serving the same function) and there are multiple wards of the same type.
When a patient moves to another ward of the same type on the same day or the next day it is classed as the same inpatient spell.
When a patient moves to another ward but it not on the same day or the next day, this constitutes the start of a new inpatient spell.
When a patient moves to another ward of a different type, regardless of whether it was on the same or next day, this constitutes the start of a new inpatient spell
I am trying to calculate a summary, at individual patient level by inpatient spell. The attached data provides two example patients, showing the source data records and the expected/required output.
Hope you can help
ThanksEasymorph Patient Example Data.xlsx (10.7 KB)