Hi guys!
I’m trying to apply a particular filter to a dataset with many activities.
The scenario is as follows.
The raw event log contains activities done in a general hospital for over a year.
If I want to get the process for a specific activity, I would normally just filter ‘Include only cases that contain ‘Knee Replacement Surgery’.
However, because there is so much going on in the hospital, such a filter is not enough. For example, if a person underwent a knee surgery is june 2021, the process map will also try to include other procedures that this person did in january 2021 or december 2021, even though these have nothing to do with the knee replacement surgery.
For that reason, I’m trying to narrow the filter down as follows:
“Provide an event log that only includes data of a maximum of 2 weeks in the past after the activity ‘Knee replacement surgery’ and a maximum of 2 weeks after this same activity.”
Note that this is NOT the same as applying a general time filter on the event log (for example ‘only include May, June and July).
The end result should still contain any occurrence of this activity in the full year of 2021. But if a patient has undergone the activity on June 15, 2022, only the ‘June’ activities for that patient will be included (2 weeks backwards and 2 weeks forward). If that some patient had undergone a medical visit in January or December, those will be discarded.
If another patient in that same dataset has undergone the knee replacement in October 1, only the last 2 weeks of September and the first 2 weeks of October should be included for this case.
The intention of this procedure is to limit the process maps as much as possible to only include the activities directly surrounding the knee procedure, and discard the many other medical activities the same patients might undergo that year. It is assumed that this will make our process map for specific hospital procedures a lot easier to oversee (less like a spaghetti process map).
So far, I have not been able to find a PQL solution for this question. I would therefore appreciate it very much if anyone can point me in the right direction. Thank you in advance!