I am working on a urgent care simulation that has six beds and either 2 or 3 providers working, each provider “owns” 2 or 3 beds accordingly. When patients arrive the nurses room them to keep the providers even (first patient goes to Provider 1, second to Provider 2, third to Provider 3, fourth to 1 and so on). I expect that determining all of this will come down to FlexScript which is where I’m running into challenges.
How would I do this? My current model assigns providers based on the room so I am trying to build the logic into the patient destination of the rooming step. My pseudo code is below:
Global Variables: Provider1Count, Provider2Count, Provider3Count
If (getgroupstat(MDs, 1) == 2)
{
If (Provider1Count <= Provider2Count)
{
Provider1Count ++
Return (ExamTable1 || ExamTable2 || ExamTable3) \\ how is this done? What type of variable am I returning?
}
Else
{
Provider2Count++
Return (ExamTable4 || ExamTable5 || ExamTable6)
}
}
Else if (getgroupstat(MDs, 1) ===3)
{
If (Provider1Count <= Provider2Count)
{
Provider1Count ++
Return (ExamTable1 || ExamTable2)
}
Elseif (Provider2Count <= Provider3Count)
{
Provider2Count++
Return (ExamTable3 || ExamTable4) \\ how is this done? What type of variable am I returning?
}
Else
{
Provider3Count++
Return (ExamTable5 || ExamTable6) \\ how is this done? What type of variable am I returning?
}
}
Finally, are there any guidelines around the necessary headers?
Thank you!