I am completing some model logic and need to find a better solution for something.
Currently, at registration/triage, my patients get a list of the imaging types that they will need. Once they get to the imaging process group they go through a sequence of Decide components that checks whether they need certain imaging processes.
- 1.1 They check to see if they need an imaging step.
- a. If they don't need that one, they will proceed to check the next imaging process
- b If they do need that one they branch off
- i. If they succeed at acquiring the resource, they go through the process and the imaging tyoe is removed from their list
- ii. If they fail at acquiring the resource, they bounce back out and move to check for the next process. (2.1, 3.1...)
- 2. If they do not need any or fail to acquire all imaging, they check to see if they still need any imaging.
- a. If they do, they go back through this loop
- b. If they don't (imaging all complete), they exit the loop.
What I need is a way to have a patient who needs an imaging process but fails to acquire it to remain in the queue (but still advance to check for the next imaging. If Xray is backed up but CT is free, we need to have the patient do CT while waiting for xray)
I would think that this is managed in a list for each imaging room... on a failed acquire, the token is pushed to the list. At the same time, all attempts to acquire can only succeed/be made by the person who is last on the list. (It has to be their turn)
I think I could make that logic, but I think it's odd that I can't push to the end of a list with built in components and I wonder if it's a signal that I'm thinking about this wrong.
- I'd rather say: if patient == list[1]
- than: if patient == list[list.length]
--
Would a global list be the correct way to manage this? Do I need to create a child token to sit in the queue?
Thanks!