question

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

User Event to Change Label

OrthoSurgery_InpatientBeds_wHistos_RecalcWait.fsm

Hi there,

I want to use a user event to update a label for a group of patients in my model. I cannot figure out the syntax to access the patient labels via the custom code in the user event. Could you please point me in the right direction?

FlexSim 22.1.1
flexscriptlabelsyntaxuser event
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

You were on the right track. The <no path> items from the CurrentPatients group were there because there wasn't anything to remove patients from the group after they had been deleted. I added a code activity to remove the patients from the group just prior to leaving in the patient process flow.

There was also an error being created by the use of CreateTokens and the WaitTimeLoop subflow in the Priority 3 patient path. I wasn't sure what your intent was there so I removed it. We can deal with that offline or in a new post.

orthosurgery-inpatientbeds-whistos-recalcwait 20220610.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 ·
Thank you so much!!
0 Likes 0 ·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

Your code is correct. Though when I open your model the 'CurrentPatients' group contains a lot of empty pointers (no path). Trying to read a label from those will of course not work. After deleting those entries, the event seems to work correctly.

1654841846729.png


1654841846729.png (11.5 KiB)
5 |100000

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

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.