question

Ashlee W avatar image
0 Likes"
Ashlee W asked Ashlee W commented

Patient Acquire Sort By Function Not Working As Expected

Inpatient.Capacity.Planning_Surgery_Ortho_1.fsmHi There,

I am simulating a surgical wait list. I would like for the patients waiting for a surgery bed to acquire a bed based on what percentage of their target wait time has elapsed. I have a user event updating this percentage (label) on a repeating basis for each scheduled patient and I am using the label value in the "Sort By" field in the advanced portion of the Location Resource.

For example: This should mean that if a patient has waited 50% of their wait time and another has waited 10% the patient who has waited 50% should be selected to acquire a bed resource sooner than the patient who has waited 10% regardless of when they arrived to the "acquire location" block.

Essentially instead of FIFO (first in first out) for the resource I want FlexSim to choose based on a label value. However I just exported the Person Waiting For Location History table and it appears that is not what is happening. See below:

1658509109023.png

In the above output - PID#2147 got their bed about 29 minutes ahead of PID#2148 but if it were sorting by the percent of their target wait time like I have asked it PID#2148 should have gotten a bed first since a larger percentage of their wait time had elapsed. It looks like FlexSim is still using FIFO...


Any thoughts on what might be happening/causing this?

Thanks,

Ashlee

FlexSim 22.1.2
acquire resourcelocation resourcesort by
5 |100000

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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Ashlee W commented

There are a few issues here. First, by putting patient.PerTarget in the Sort By field you're telling it to get the value of the patient's PerTarget label and use that in the query. Thus when the model runs it gets the value of PerTarget (which is 0 when first trying to acquire) and uses that in the query. So you're ordering by 0.

1658512994373.png

Second, and more important, this is the wrong place to try to do this kind of sort. The Sort By field of the Acquire activities is for sorting the things you're trying to acquire (locations in this case) and not the things doing the acquiring (patients). This field is for things like sort by which bed has been used least or by the comfort level of the bed, etc. If you instead want to sort the patients when a location becomes available and multiple patients want to pull it you need to use the Back Order Queue Strategy on the Back Orders tab of the Locations list properties.

1658513339305.png

Note that you use the keyword Puller to reference the thing doing the pulling (the patient).


1658512994373.png (10.3 KiB)
1658513339305.png (9.6 KiB)
· 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.

Ashlee W avatar image Ashlee W commented ·
Thank you so much, I'll give this a try!
0 Likes 0 ·
James Rodgers1 avatar image
0 Likes"
James Rodgers1 answered Ashlee W commented

By default, the sort field works as "Ascending" so it will sort the resources in order of label you have identified from smallest to largest. You want the opposite order so put "DESC" after the label name and it will sort the patients based on patient.PerTarget largest to smallest.

· 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.

Ashlee W avatar image Ashlee W commented ·

I don’t think it’s sorting them in ascending order either. It seems to be FIFO regardless of what I put in the Sort By field. If you look at the excel screenshot the acquire time is the same order as the request time regardless of the PerTarget field.


I also get a SQL exception error when I try to use the DESC.

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.