question

FlexSim245 avatar image
0 Likes"
FlexSim245 asked Matthew Gillespie edited

Use multiple patient flows throughout the day

Hi all,

In my model, healthcare model, i have two different patient flows and I wanted to alternate between them throughout the day. (patient flow 1 to be used from 8 am to 12 pm and patient flow 2 to be used from 12 pm to 5 pm), both of them are defined in the parameters option.

I thought about the source with the arrivals used, there is an option of offset/variability that has an option to use the parameters but I am not sure if there is a way to add a code for a new column and define a specific patient flow in each hour? thank you!

FlexSim 21.2.1
parameterspatient flowarrival source
· 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.

Ryan Clark avatar image Ryan Clark commented ·

Hi @FlexSim245, was Matthew Gillespie's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If you do need more help, please post your model or a sample model that demonstrates your question to receive a more accurate solution. Proprietary models can be posted as a private question visible only to FlexSim U.S. support staff. You can also contact your local FlexSim distributor for phone or email help.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Matthew Gillespie edited

Within the Patient Flow field of the Create Patient activity you can dynamically choose a patient flow.

For example, here I've chosen the Conditional Person Flow pickoption and used

Model.dateTime.hour < 12

as the condition. This makes it so that from midnight to noon it uses Patient Flow and from noon to midnight it used Patient Flow 2.

1634597274790.png

FlowByTimeOfDay.fsm


1634597274790.png (28.2 KiB)
flowbytimeofday.fsm (41.5 KiB)
· 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.

FlexSim245 avatar image FlexSim245 commented ·
@Matthew Gillespie Thanks for the reply! But I am trying to do this for 3 patient flows, and this is a condition taking only yes or no, which takes two destinations. Could you please assist if I want to have 3 patient flows, in my model how to edit the code? if my model Is working for 24 hours and I may want to alternate every 3 hours or 4 hours for a specific patient flow, i.e. from 12 am - 3am will work on patient flow 1, 3am to 7am with patient flow 2, 7am to 10 am process flow 1, 10am to 1pm process flow 3? Thanks in advance!
0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ FlexSim245 commented ·

@FlexSim245 In that case you can just open the code editor for that field and use some if statements, like this:

int hour = Model.dateTime.hour;

if (hour < 3 || hour >= 7 && hour < 10) // 12 - 3 AM and 7 - 10 AM
    return Model.find("Tools/ProcessFlow/Patient Flow");
if (hour >= 3 && hour < 7) // 3 - 7 AM
    return Model.find("Tools/ProcessFlow/Patient Flow2");
else
    return Model.find("Tools/ProcessFlow/Patient Flow3");

FlowByTimeOfDay2.fsm

Alternatively you could use the Person Flow By Case pickoption and fill out hour by hour which flow to use.

1634671579061.png

0 Likes 0 ·
1634671579061.png (40.1 KiB)
FlexSim245 avatar image FlexSim245 Matthew Gillespie ♦♦ commented ·

@Matthew Gillespie This has finally worked with the custom code added, Thank you for your response. After having 3 models alternating throughout the day,12-3 and 7-10 am (A) takes model 1 , 3- 7 am (B) takes model 2 and other (C) takes model3, this is what has been implemented in this case. I am also trying to alternate between these 3 , meaning that if there is a way without manually changing the code to have the first big model as shown:

A-Model1, B-Model2, C-Model3

The second:

A-Model1, B-Model3, C-Model2

The third:

A-Model2, B-Model3, C-Model1

The forth:

A-Model2, B-Model1, C-Model3

The fifth:

A-Model3, B-Model2, C-Model1

The sixth:

A-Model3, B-Model1, C-Model2

So the shifts themselves do not want to change them but the patient flow to be changed. Thank you

0 Likes 0 ·
Show more comments

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.