question

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

Location Acquired in Label?

Hi there,

I can't seem to get the name of the bed my patient acquires in a label. What is the proper syntax for this?

FlexSim 22.1.0
labelssyntaxacquired location
5 |100000

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

James Rodgers1 avatar image
0 Likes"
James Rodgers1 answered Ashlee W commented

The error is because the "Unscheduled Beds" group is missing the "c".

1654008803582.png

But there's an additional issue. Each bed needs to be named individually in the group to use the "group" search mechanism. I added a script to put all the beds into the group.


orthosurgery-inpatientbeds-actuallosv2-priority_2.fsm


· 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 ·
Embarrassing spelling error, haha! But thanks a million. That worked!
0 Likes 0 ·
James Rodgers1 avatar image
0 Likes"
James Rodgers1 answered Ashlee W commented

You would need to check each group to see if the acquired location is a member using the group.isMember method:

Object bed = patient.Locations[1];

string groupname;

if(Group("Beds") .isMember(bed))

groupname = Group("Beds").name;

· 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'm getting an error when I try to make this work. The code is located in "Assign Labels (get bed time)" in the code for the BedType label in the model attached.

OrthoSurgery_InpatientBeds_ActualLOSv2_Priority.fsm

0 Likes 0 ·
James Rodgers1 avatar image
0 Likes"
James Rodgers1 answered Ashlee W commented

The last acquired location would be under patient.Locations[1] so you can access the name of the location by

string bedname = patient.Locations[1].name;

· 2
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 am new to FlexSim and this forum has been a lifesaver!
0 Likes 0 ·
Ashlee W avatar image Ashlee W commented ·
Is there a way to get the name of the multi-location group that the location belongs to?
0 Likes 0 ·