question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Felix Möhlmann commented

Assigning Pointer Data For More Rows In Schedule

@Matthew Gillespie

I like the way you defined location name in terms of pointer data in schedule table itself.

How to Set Overflow Location Logic Based on Chair Availability? - FlexSim Community

It looks more scalable in this way. But I think I have to use picker for every row after assigning pointer data to cells. It will be much difficult to do it for more number of rows (1000) having multiple location.

What is the best way to do it?

Thank you!

FlexSim 21.0.10
locationhcschedulepointer data
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
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

You don't have to use the picker. If the entered values are all the same or follow a regular pattern, you can copy and paste blocks of previous cells.

copypaste.gif

You can also use code to assign values to the schedule. An example is provided in the script window of the attached model.

As is, the code assigns "RegularChair" to each cell in the fifth column. You could also modify it to assign different values depending on some condition, for example the value in another row.

1651135490812.png

test13-chairs_1.fsm


copypaste.gif (184.4 KiB)
1651135490812.png (43.4 KiB)
test13-chairs-1.fsm (274.5 KiB)
· 7
5 |100000

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

Ankur A3 avatar image Ankur A3 commented ·

Thank you so much @Felix Möhlmann for this piece of code!

Still I would like to ask 1 more question. Actually, there are multiple locations based on provider. Suppose if user want to add provider in existing model, this process looks little bit difficult for new user. Is there any other easy way to do it? I am expecting something in excel and paste directly here that data.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Ankur A3 commented ·

Values pasted from excel will automatically interpreted as either a string (text) or a number. You can paste in the name of the object and then run code (similar to before) to find the correct object and replace the name with a pointer. This could also be done as part of the "Post Import Code" if you set up an automatic excel import.

copypastepointer.gif

Alternatively yoiu can leave the value in the soure as text and replace the token label with a pointer in the arrivals flow before creating the patient.

1651146629730.png

test13-chairs_2.fsm

0 Likes 0 ·
copypastepointer.gif (177.6 KiB)
1651146629730.png (14.6 KiB)
test13-chairs-2.fsm (280.0 KiB)
Ankur A3 avatar image Ankur A3 commented ·

Thank you so much! @Felix Möhlmann

I really like the second approach of doing it. But I have 1 question here if I may ask.

If we have two location with respect to chair label "regular_chair", let say "regular_chair_MD" for MD, "regular_chair_clerk" for clerk. So, is there any way to join suffix in the label "regular_chair" and get the chair pointer to access these locations?

test13-chairs3.fsm

0 Likes 0 ·
test13-chairs3.fsm (74.8 KiB)
Felix Möhlmann avatar image Felix Möhlmann Ankur A3 commented ·
Happy to hear that you figured it out. Just for completeness sake, in case other users are searching for the same question:

You can simply add strings together with a "+" operator. So if "token.chair" is "regular_chair" and "token.MD" is "MD", then

Model.find(token.chair + "_" + token.MD) 

would search for the object named "regular_chair_MD".

0 Likes 0 ·
Ankur A3 avatar image Ankur A3 Felix Möhlmann commented ·
@Felix Möhlmann

I want to change my label name "Chair" based on whatever is acquired from overflow location (randomly picked). While clicking on token, I can see that pointer data "/Chair6" is allocated in locations label field. But I only want to assign "Chair6" to my Chair label.

Is there any way to do it?

Thank you!

0 Likes 0 ·
Show more comments
Ankur A3 avatar image Ankur A3 commented ·

I got it. Thank you for you support! @Felix Möhlmann

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.