question

Jose_andres Ca avatar image
0 Likes"
Jose_andres Ca asked Felix Möhlmann commented

Patient to Nurse Ratios

I have different shifts, many of them staggered. I want to calculate the ratios of different types of patients and nurses working at that time. How can I get only number of nurses that are working at that time and not the total nurses and then divide it by each of the different patients I have? Should I do them all on the same table or do one for working nurses and then use the patient census and use the calculated tables to divide them?

FlexSim 21.2.4
statistics collector
· 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.

Nathan B14 avatar image Nathan B14 commented ·
@Jose_andres Ca Was Felix's answer helpful to you? If so please be sure to "accept" the answer. If not, please let us know how else we can be of assistance.


If we haven't heard from you in three business days, we will auto-accept the answer. You can reopen the question at any time by commenting or replying back. Thank you.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

To get the number of active nurses I'd write some code that loops through the respective group and counts how many members are currently not in the "Off Schedule" state.

In the attached model I build a user command from this, that let's the user define the group they want to count in.

Then, as you suggest, use the census calculated table to the number of patients of each type.

Finally, a statistics collector reacts to patients being added and removed from the model (as well as a on minute timer) and calculates the ratio by first running the user command to get the number of nurses and then updating the respective row of the added/removed patients' type. If the number is zero, it writes a null variable, rather than divide by zero and return "inf".

NursesPerPatient.fsm


nursesperpatient.fsm (680.4 KiB)
· 3
5 |100000

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

Jose_andres Ca avatar image Jose_andres Ca commented ·
Thank you, this is exactly what I needed.
0 Likes 0 ·
Jose_andres Ca avatar image Jose_andres Ca commented ·

nurse_to_patient.JPG

The solution works but it has a simple problem. In my model patient types have different arrival rates and I rarely get ESI 1. This causes the census calculated table to never show a row for ESI 1 until I get the first one, so my data on the ratios statistics collector shift up. I attached a screenshot of bot tables to show what happens.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Jose_andres Ca commented ·

Sorry, I totally missed that case despite it also occuring in my model. The code for the "NursesPerPatient" column in the statistics collector has to be changed to look for the correct type value, rathen than assume that row == type.

Table result = Table.query("SELECT Census FROM [Census CalculatedTable] WHERE Type = $1", data.rowValue);

if(result.numRows && result[1][1] > 0)
{
    return data.activeNurses/result[1][1];
}
return nullvar;

"Type" would of course be changed to "ESI" in your case.

NursesPerPatient_1.fsm

0 Likes 0 ·