Update patient label with Global process?

Update patient label with Global process?

rob_davies1
Not applicable
502 Views
2 Replies
Message 1 of 3

Update patient label with Global process?

rob_davies1
Not applicable

[ FlexSim HC 5.1.0 ]

I want to make EVERY PATIENT in my model age yearly. I'm guessing a global process would do this, but I cannot get the label to update.

I'm using patiet label "AgeNow" to track age. I setup global process to kick off at time zero and repeat every 60 min. (scale: 60 min model time = 1 year)

6328-jai5f.png

And I've set the finished trigger activity to increment the variable.

6329-yjild.png

I know the global process is running because I added a MSG() code to pop up. I'm not sure what I'm missing. Any ideas?

0 Likes
Accepted solutions (1)
503 Views
2 Replies
Replies (2)
Message 2 of 3

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

A global process is not associated with any patients (thus the term "global"). The patient variable in a global process is a reference to the global process itself, so you're setting a label on the global process, but not on any patients. You would need to write some code to loop through all the object's in the model to find all the patients and then increment their label. For example:

forobjecttreeunder(model()) {
	if(getobjecttype(a) == OBJECT_Patient)
		inc(label(a, "AgeNow"), 1);
}


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 3

rob_davies1
Not applicable

Thanks Matt, That's the insight I'm looking for. I'm still learning how Flexsim thinks.

0 Likes