How can I edit destination by case when escorting patient?

How can I edit destination by case when escorting patient?

miguel_m7
Not applicable
26 Views
5 Replies
Message 1 of 6

How can I edit destination by case when escorting patient?

miguel_m7
Not applicable

[ FlexSim 19.2.2 ]

I am trying to save a room for a critical patient for after he/she completes getting diagnostics work. I want my patient to be escorted to their old room, but I want to account for the possibility of using a different shared asset. flowhelp.png

I created the label RoomType and assigned values 1, 2, 3. I thought I could manage destination by Object by case, using the case function: token.RoomType. I tried to set up the cases with getlastacquiredresource("Trauma Room",current), getlastacquiredresource("Standard Room",current), and getlastacquiredresource("Rooms",current) respectively, but I have been getting the following errors:

"Flexscript ErrorMODEL:/Tools/ProcessFlow/CriticalPatients/Escort Patient~8>variables/destinationRef Line 14Incorrect string type for parameter 1 in call to command getlastacquiredresource, expecting node Flexscript ErrorMODEL:/Tools/ProcessFlow/CriticalPatients/Escort Patient~8>variables/destinationRef Line 15Incorrect string type for parameter 1 in call to command getlastacquiredresource, expecting node Flexscript ErrorMODEL:/Tools/ProcessFlow/CriticalPatients/Escort Patient~8>variables/destinationRef Line 16Incorrect string type for parameter 1 in call to command getlastacquiredresource, expecting node Flexscript ErrorMODEL:/Tools/ProcessFlow/CriticalPatients/Escort Patient~8>variables/destinationRef Could not finish parsing because of previous errors."

I believe I need the correct application of getlastrecquiredresource(), or maybe another way to manage destination by case.

final-project-model-v1.fsm

0 Likes
Accepted solutions (1)
27 Views
5 Replies
Replies (5)
Message 2 of 6

miguel_m7
Not applicable
0 Likes
Message 3 of 6

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

I modified your model to do what I think you're trying to do. I changed the first Go To Room container to only have one Location Resource called "Room" and it defines it's Location with a By Case function that uses a different group for each different RoomType. That way you can then just have the patient escorted to the acquired location from the Room resource.

roombycase.fsm

23942-roombytype.png



Matthew Gillespie
FlexSim Software Developer

Message 4 of 6

miguel_m7
Not applicable

That solves my problem. Thank you so much!

0 Likes
Message 5 of 6

miguel_m7
Not applicable

HI @Matthew Gillespie

I finished creating the model. Most things look accurate, but I noticed that for the Critical Patients, even though the logic is programmed to let the patient take the first available room, they are only subject to TraumaRooms. Could you help me figure out why this is happening? It is easier to observe this on 11/15/19 at night on the model.

Thank you!

final-project-final-v.fsm

Message 6 of 6

Matthew_Gillespie
Autodesk
Autodesk

Oh, we still need to uncheck the Same As Last Acquired box on the Acquire Standard Room and the Acquire Empty Room activities.

24132-final-project-final-v2.fsm

24141-sameaslast.png



Matthew Gillespie
FlexSim Software Developer

0 Likes