question

Sumanth Raja avatar image
0 Likes"
Sumanth Raja asked Sumanth Raja commented

Changing a previously assigned location of a patient.

new-admit-protocol-model1.fsm

Hello! I am currently modeling a new admission protocol for patients admitted to inpatient units from different sources. I am having a little trouble setting up rules for admissions based on queue length. This is what I have thus far:

I have patients arriving through different locations and entering their respective queues based on their arrival source. Upon entering the queue, the simulation evaluates the current queue size (ED_Queue) and decides on the next activity (Regular placement vs off-service). What I would like the model to do is, continuously evaluate the queue length and when it exceeds a certain value (set as 12 in order to test), I would like to re-assign the targeted location for the first patient in the queue. This is how I have set it up.

This shows the decision point that decides a patient's next activity based on queue length.

I quickly realized that this would only evaluate queue length at a snapshot of time and does not continuously evaluate the length of the queue. In order to do this, I set up an "On-entry" trigger for the queue object to trigger activity 20 for the first patient in the queue whenever the queue length exceeded 12.

But for whatever, reason, even though activity 20 is triggered for the patient, it does not proceed to trigger activity 22 to allocate a new location for the patient.

Example:

When I run the model, as you see in the screenshot below, the activity times are listed for the first patient in the queue while the queue length is below 12.

For the same patient, when the queue length exceeds 12, we see that the activity time for activity 20 changes (which implies that the on entry trigger from the ED_Queue works) but for whatever reason, it doe not proceed to activity 22 as it should.

Any help would be much appreciated. Thank you!

Best,

Sumanth

@lou.keller

@jim.montgomery

Choose One
queue contentlocations
pic-1.png (277.8 KiB)
pic-2.png (298.9 KiB)
pic-3.png (275.2 KiB)
pic-4.png (277.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.

Cliff King avatar image
0 Likes"
Cliff King answered Sumanth Raja commented

There is a pick list option to "Terminate > Patient Activity" in many of the trigger fields, plus there is a command named terminateactivity() you can use as well. I'm always hesitant to terminate activities because of all the possible states an activity can be in at the time the terminate command is issued that could possibly cause issues. It doesn't mean I don't do it, it's just that I try other options first... I think you should try using the Activity Start Condition method I suggested as a solution first. It's better to not have the activity start in the first place; rather than let the activity start and then try to terminate it. Let us know how it goes!

· 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.

Sumanth Raja avatar image Sumanth Raja commented ·

Hello Cliff! The Activity start condition worked perfectly. Thank you!

0 Likes 0 ·
Cliff King avatar image
0 Likes"
Cliff King answered Sumanth Raja commented

OK, now that I've had a chance to take a look at the actual model, I think I know what you're up against. You're not going to be able to start a second transfer activity while there is already one transfer activity pending for the patient. The software won't let you do that. It will ignore any transfer activities that try to start while a transfer activity is already underway for a given patient.

You can try to resolve this issue one of two ways. Either terminate the active transfer first before trying to start the second transfer activity, or you can put an Activity Start Condition on the first transfer activity so that it won't actually start if the destination (or staff to take them there) are not available.

I realize the model is a work in progress, but here are a couple general things I found while poking around in the model that you should address:

  • Don't add or modify code on a standard pick list option without making it obvious to others that you have altered the original pick list option. It took me awhile to figure out where you were setting the labels of a patient because the Creation Trigger on the patient arrival objects looked like you were just setting the "Level of Care" label to 1.
  • In the custom code of the trigger mentioned above, you are using a single = for the conditional comparator in the three if() statement rather than the double ==.
  • I don't think the following inline if statement you're using in the "Based on multiple cases" option in the Patient Destination field of activity 10 is correct because if "Arrival Source" == 5, then the case will be 5 and you do not have a case for a value of 5!
getlabelvalue(patient, "Arrival Source") == 5 ? getlabelvalue(patient, "PCI")  : getlabelvalue(patient, "Arrival Source")
  • All the cases have not been defined for the Next Activity of activity 11.
· 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.

Sumanth Raja avatar image Sumanth Raja commented ·

Hello Cliff,

Thank you for the quick response. Is there a way by which I can terminate an pending transfer activity for the selected patient before triggering a new transfer activity?

For points 1 and 2, I have gone ahead and modified my code based on your pointers, thank you for that!

On the 3rd point you had mentioned, what I want the model to do is send the patients to their appropriate queues. "Arrival Source == 5" are all those patients who arrive through the "Transfer_Admits" entry, and I want those patients to enter the queues based on their PCI values. Patients arriving from the other 2 sources, I want them to enter their queues based on the "Arrival Source" label. So if Arrival source is 5, then they would pick an option based on their PCI label (in my model these are 1, 2 and 3).

I will modify activity 11 as I built out my model.

Best,

Sumanth

0 Likes 0 ·
Cliff King avatar image
0 Likes"
Cliff King answered

Ignore my last post. I do see the images and attached model now. My browser window just needed refreshed after properly logging in!!

5 |100000

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

Cliff King avatar image
0 Likes"
Cliff King answered

Sounds like a fun problem to try and solve. I'd prefer to play around with the model you already have built, if you don't mind sharing it. If you don't feel comfortable sharing it online, then either post it privately or send me a direct email. I wonder if maybe you tried to attach the model already but failed, because I don't see the screenshot image you mentioned either.

Your approach seems like a one that ought to work, so I'm curious why it isn't. You mentioned two activities (20 & 22), rather than a single activity to kick off with the start activity trigger, so I'm guessing that is the issue. If activity 22 is being kicked off by having 20 as its predecessor, then that won't work because predecessor kickoffs only can happen once. This would be easily resolved by using activity 20's Next Activity field kick off 22. If I've totally interpreted things wrong, then don't bother trying to correct me until I have a chance to see the model.

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.