question

Maryam H2 avatar image
0 Likes"
Maryam H2 asked Ryan Clark commented

Force patients leave the model during off-schedule hours

Hi,

Is there any way to force the patients to leave the model after 5 PM other than creating several decide activities and locate them before/after some set of activities with this code in it:

  1. Model.dateTime.hour<8 || Model.dateTime.hour> 16

The problem with this method is that tokens are stuck in the activity during the transition to off-schedule hours and will not leave the model. I was looking for an approach to trigger "left without being seen" unless the patient is in the process of MD visitation.

Thanks!


FlexSim 21.2.3
decide activityleft without being seenmodel time hour
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Maryam H2 commented

You can use the "Release Token" activity to achieve this. 1634624875870.png

In the attached example, each patient token creates a child token. This child token will wait for its parent token to acquire an MD. Before it enters the "Wait for Event" activity, it is assigned a label that is used as the maximum wait time in the activity and coincides with the start of the off-schedule hours. In the example that time is 9:00AM.

If no staff has been acquired at that time, the child token will be released through the second connector and enter the "Release Token" activity. This is set to release the parent from whereever it is (in the example this will be the acquire activity) to the last two activities in the main flow (walk and remove patient).

1634625045013.gif

If the parent token that gets released might have already acquired some resource (staff/location/equipment), you would have to check for the respective label and route it through the corresponding release activity before removing the patient.

In the example model, the wait time also could have been used in the "Acquire Staff" activity directly, with a second connector leading to the end of the main flow. The advantage of using the "Release Token" activity is that the parent token can be moved regardless of its current position in the flow.

ReleaseWaitingPatients.fsm


· 6
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.