question

Kenneth Surgenor avatar image
0 Likes"
Kenneth Surgenor asked Katie M commented

Monitor waiting room and then process patients if number gets too large

erflow.fsmHow could you add logic to this model to have a 2nd RN (RN2) go to the waiting room, and process patients in the chair area if the number in the waiting room got too large (say over 10) and then stop processing when back down below that number

Choose One
alternate processing logic
erflow.fsm (98.7 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.

1 Answer

·
Cliff King avatar image
2 Likes"
Cliff King answered Katie M commented

I believe I found a nice modeling solution for what you've described. It required one little trick that only one of us developers would have known about, but other than that it is pretty straight forward.

To understand the solution you need to understand the following points about the inner workings of the Patient Destination (PD) field. This particular activity field is the only field that is automatically reevaluated on a somewhat continual basis. If the PD field returns NULL (i.e. 0) when it is evaluated, then the patient will stay where they are and do nothing until their PD field eventually is evaluated and returns a valid destination. The PD field will have a chance to be reevaluated for every released patient (whose destination variable is NULL) whenever a downstream location to the patient's current location BECOMES available. Now that last sentence is packed full of hard to digest information, but important information, so you may want to reread it a couple times.

So the one trick I needed to do was execute a "receiveitem(Chair1)" command in the Activity Started Trigger of the activity (#40) that determines whether the patient should go to Triage1, Chair1 or nowhere (i.e. PD = NULL). The reason for this is to force the PD's to be reevaluated on all patients currently in the Waiting Room before the PD field is evaluated on the patient who just took a seat in the Waiting Room. Without this trick, the patient who just barely enters the waiting room will sometimes jump ahead of other patients who have been waiting.

The only two non-standard things I did in this model were the PD and Activity Started Trigger fields on the "40_Escort to Triage or Chair" activity.

Let me know if this will work for you, and whether or not you need more explanation.

er-flow.fsm


er-flow.fsm (100.2 KiB)
· 7
5 |100000

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

Katie M avatar image Katie M commented ·

@Cliff King @Matthew Gillespie

I tried doing this as well, using similar code -

if(getavailablelocation(Triage1, patient)) return Triage1;

if(getcensus(WaitingTriage) > 1 && getavailablelocation(Triage2, patient)) return Triage2; return 0;

However it kept saying unknown variable "patient" - I am unsure what else the name would be. I tried the patient visual name "man" and the patient track name... do you have any suggestions for this? Or how I would know what the variable name is for those within my patient track if it is not "patient"?

Thanks

0 Likes 0 ·
Cliff King avatar image Cliff King Katie M commented ·

It's unclear to me where you were writing that code. If you were writing it in a Patient Destination field, then it should have known the variable "patient".

0 Likes 0 ·
Katie M avatar image Katie M Cliff King commented ·

if(getavailablelocation(Triage1, patient)) return Triage1; if(getcensus(WaitingTriage) > 1 && getavailablelocation(Triage2, patient)) return Triage2; return 0;/**direct*/;

Hi @Cliff King

This code works now, however I am running into the problem where the second nurse takes the second patient that is waiting in the triage waiting area before the first patient that has been waiting when he is the only patient. This makes this patient's wait time longer. Any thoughts on this? Thanks!

0 Likes 0 ·
Show more comments
Katie M avatar image Katie M Katie M commented ·

@Cliff King Thank you! Your help was most appreciated. Thanks also for the tip on the software update; I've notified my manager.

0 Likes 0 ·

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.