Surgery Appointment Simulation

All topics specific to modeling questions in Enterprise Dynamics
Post Reply
masihmolavyzada
Posts: 6
Joined: Tuesday 02 July, 2024 - 17:24

Surgery Appointment Simulation

Post by masihmolavyzada »

Hello

I'm woriking on building a model of a surgery process in a hospital. My objective is to simulate different scenarios by adjusting operational and administrative parameters and then measuring their impact on patient throughput. Since this is my first model in this domain, my plan is to create a basic version initially, which I can refine with more detailed features as I gain more knowledge and experience with the software.

The hospital operates Monday-Friday from 8am til 3:30pm.

In my current setup I have a source that gives the patients 4 different labels:

Code: Select all

Do(
    Label([BM)], i) := LogNormal(3.3,0.25),
    Label([Diabetes], i) := Bernoulli(10, 1, 0),
    Label([SDS], i) := Bernoulli(60, 1, 0),  
    Label([Cemented], i) := Bernoulli(60, 1, 0) 
"SDS" stands for Same Day Surgery eligible patients and "Cemented" is a specific type of surgery.

From the source the patient enters a queue and then they will enter the server which represents the operating room. The queue has an availability control connected to it that closes the queue at hr(5) and opens again at hr(24). The operating room server also has an availability control connected to it that closes at hr(7.5) and opens again at hr(24).

My question is - how can I allow the server to finish the last patient (as in going to overtime) before closing?

I also want to include some operational limitations such as:
- There cannot be 3 cemented surgeries in a day.
- At least one SDS patient a day per operating room if possible.
- Patients with diabetes always get timeslot 1 or 2
- Scheduling patients with high BMI in the same operating room is something that should be avoided, but allowed if necessary.
- Patients that are younger and does not have any Diabetes or high BMI are preferred on Mondays, Tuesdays and Wednesdays.
- Only one operating room is available on Fridays
- On Thursdays the surgeries start at 8:30

Since, this is my first attempt I would really appreciate some guidance. Let me know if anything is unclear or needs further elaboration.
eksempel.mod
(25.26 KiB) Downloaded 222 times
Gabe-Hein Dijkstra
Posts: 24
Joined: Friday 13 May, 2022 - 10:16

Re: Surgery Appointment Simulation

Post by Gabe-Hein Dijkstra »

Hi masihmolavyzada,

First of all, welcome to the community!

The project you are working on sounds very interesting. In the GUI of the Availability Control atom, you can indicate which types of events you want to control (Inputs, Outputs, Events etc.). If only the checkbox before the inputs is checks, only the entrance of new atoms will be blocked. Atoms will still be able to leave after their assigned cycletime.

An example model of the above situation can be found in the Example Wizard (Ribbon > Help > Example Wizard > Supermarket.mod).

Hope this helps! Please let me know if you have any further questions.

Kind regards,
Gabe-Hein
masihmolavyzada
Posts: 6
Joined: Tuesday 02 July, 2024 - 17:24

Re: Surgery Appointment Simulation

Post by masihmolavyzada »

Hi Gabe-Hein,

Thank you so much for the warm welcome and for your helpful guidance!

Do you know if there's a way for me to record the patient's overtime? Specifically, I'm interested in recording the duration from when the input shuts down to when the patient leaves the server.

Best regards
Masih Molavyzada
Gabe-Hein Dijkstra
Posts: 24
Joined: Friday 13 May, 2022 - 10:16

Re: Surgery Appointment Simulation

Post by Gabe-Hein Dijkstra »

Hi Masih,

What you could do is making use of the 'Trigger on up' and the 'Trigger on down' in the GUI of the Availability Control atom. When the server becomes unavailable a label can be placed on the server containing the time the unavailability started:

Code: Select all

{ Set label on server. }
Label([DownTime], Out(1, c)) := Time
This label should be removed when the server becomes available again.

On the 'Trigger on exit' of the server, code can be placed stating that if the label DownTime is present on the server (the label is larger than zero), the difference between the current time and start of the down time has to be logged in the tracer or a table.

If I can do anything else to help, let me know.

Kind regards,
Gabe-Hein
masihmolavyzada
Posts: 6
Joined: Tuesday 02 July, 2024 - 17:24

Re: Surgery Appointment Simulation

Post by masihmolavyzada »

Hi Gabe-Hein

Now I have updated the Availability Control atom and the Server atom:

AC Trigger on up:

Code: Select all

Label([DownTime], Out(1, c)) := 0
AC Trigger on down:

Code: Select all

Label([DownTime], Out(1, c)) := Time
Server Trigger on exit:

Code: Select all

If(
    Label([DownTime], c) > 0,
    Do(
        var([DowntimeDuration], vbValue),
        DowntimeDuration := Time - Label([DownTime], c),
        Trace([Downtime], DowntimeDuration, [seconds])
    )
)
It seems to be working fine but maybe it would be better to log to a table rather than the tracer.

Do you have any idea how I could model some of the operational limitations I listed?
I tried using the Condition Control atom to limit the amount of "Cemented" surgeries in one day to maximum, 3 while still allowing the other patients to enter the server. Unfortunately, I was unsuccessful in doing this.

To model the timeslots for the operation rooms, I considered using separate servers, with each server representing a different timeslot. What do you think of this idea?

I also have no clue on how to include in the time schedule for the server that it should start at 8:30 am on Thursdays.

I have attached the most recent version of my model in case something should be unclear. I look forward to hearing your thoughts about this.

Best regards
Masih
Attachments
eksempel.mod
(24.15 KiB) Downloaded 216 times
Gabe-Hein Dijkstra
Posts: 24
Joined: Friday 13 May, 2022 - 10:16

Re: Surgery Appointment Simulation

Post by Gabe-Hein Dijkstra »

Hi Masih,

Great that the logging towards the tracer is working. The next step would indeed be writing the logging towards a table.

The main difficulty for implementing the "Cemented" surgeries limit in the current model set-up is the fact that all patients are stored in one queue. Which means some reshuffling is needed once that limit is reached, as otherwise the next "Cemented" patient would block the whole queue. Maybe working with multiple queues per passenger type can help?

I do not fully understand your remark regarding the timeslots for the operation rooms. Does the current solution with the Time Schedule Availability and Availability Control not work? I would let your simulation start at Monday 0:00, when you ran 24 simulation hours you are at Tuesday 0:00 etc.

Kind regards,
Gabe-Hein
masihmolavyzada
Posts: 6
Joined: Tuesday 02 July, 2024 - 17:24

Re: Surgery Appointment Simulation

Post by masihmolavyzada »

Hi Gabe-Hein,

Thank you for your quick response.

Regarding the reshuffling of the queue, is it possible to implement such a mechanism within our current system? By multiple queues, do you mean creating a separate queue specifically for patients with the "Cemented" label and then closing this queue once the limit of three is reached?

As for the timeslots, I was referring to a requirement where patients labeled "Diabetes" should be scheduled as either the first or second patient of the day. I am currently struggling to find a way to model this constraint within our existing setup. Could you please provide some guidance or suggestions on how to achieve this?

Best regards
Masih
Gabe-Hein Dijkstra
Posts: 24
Joined: Friday 13 May, 2022 - 10:16

Re: Surgery Appointment Simulation

Post by Gabe-Hein Dijkstra »

Hi Masih,

I think the reshuffling would be possible to implement, although it will require quite some logical. Furthermore, the sorting of atoms is computation-wise relatively expensive. Yes, I indeed meant to make a seperate queue which can be opened and closed using the OpenInput and CloseInput commands.

In the light of the above, I would suggest also making a seperate queue for patients with "Diabetes". If we are in the first or second timeslot we check if the content of the "Diabetes" queue is positive. If so, we only open the output of that queue. Another way this could be implemented is by making use of the "Input Strategy" of the server, albeit being a bit more complicated to understand.

Hope this helps.
Gabe-Hein
masihmolavyzada
Posts: 6
Joined: Tuesday 02 July, 2024 - 17:24

Re: Surgery Appointment Simulation

Post by masihmolavyzada »

Hi again Gabe-Hein

I guess making separate queues would be better then. Would this solution still work if a patient has both "Cemented" and "Diabetes" as a label?

Best regards
Masih Molavyzada
Post Reply