question

Leah R avatar image
0 Likes"
Leah R asked Leah R commented

How to pull from list based on patient label ?

Hello,

I am trying to model the functionning of an operating room. I modeled the process before, during and after the surgery.

Each patient has a label called rang_journee which is their surgery rank. If a patient A is ready to undergo surgery, they can only start the surgery if there is no patient with a lower rank than them in the model.

For example, patient 1's rank is 10 and patient 2's rank is 20. If both patient are in the model and patient 2 is ready to undergo surgery before patient 1, it will still not receive the surgery.

In order to model that I :

  • created a List in which I want to push all the rang_journee of the patient that are in the model but that did not start the surgery yet ;
  • created a "push to list" activity. It pushes the rang_journee in the list when the patient is created and release the token immediately (see figure 1)
  • created a "pull from list" activity just before starting surgery. It should work as a filter to only let the patient with the lowest rank start (see figure 2). I cannot seem to make it work though.

My question is : how can I change that "pull from list" activity so that it only allows the patient with the lowest rank to go to the next step ?

Thanks in advance !

Leah


1658234839915.png

1658234913352.png

FlexSim 22.1.0
listpull from listpush to list
1658234839915.png (65.6 KiB)
1658234913352.png (59.4 KiB)
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

·
Clair A avatar image
0 Likes"
Clair A answered Leah R commented

Hi Leah,

Please find attached a small example 2022-07-19 Pull patient from list.fsm.

Each patient has a surgeryRank label. I push patients in a list when they arrive in the waiting room:

1658239802843.png

This list has a field for the surgeryRank label:

1658239927438.png

When I pull a patient, the list is ordered by the surgeryRank field:

1658240033694.png

This way the patient with surgeryRank = 1 is the first patient to be pulled, even if he was not the first patient in the list.


· 3
5 |100000

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

Leah R avatar image Leah R commented ·
Thank you, it works perfectly !


I just have one last question to be able to apply it to my model. I have several ORs (and thus several patient lists).

It is possible to adapt the name of the list to push the patient data into based on a label ?

For instance, something like PatientList{patient.ORnumber}

If it is not possible, i guess i will use a decide with as many ouptuts as the number of ORs I have.


Thanks in advance !


0 Likes 0 ·
Clair A avatar image Clair A Leah R commented ·

I would rather use a single list and add the OR index as a field in the list:

1658245754195.png

Then the query to pull the correct patient for that OR and ordered by surgeryRank would be:

WHERE ORindex = puller.ORindex ORDER BY surgeryRank ASC

See attached modified model 2022-07-19 Pull patient from list where OR is already known.fsm.

1 Like 1 ·
Leah R avatar image Leah R Clair A commented ·
Thank you, it works perfectly :)
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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