Utilization For Location Chair

Utilization For Location Chair

rajankur6494
Advocate Advocate
15 Views
11 Replies
Message 1 of 12

Utilization For Location Chair

rajankur6494
Advocate
Advocate

[ FlexSim 21.1.2 ]

I have a schedule of patient arrival from 8 AM to 2 PM daily basis. That is the working hours of clinic. But while calculating utilization of clinic, it is showing chart based on 24 hours a day. How can we change it based on working hours? Also, is there any way to make this option dynamic so that depending on working hours, utilization can be calculated?

0 Likes
Accepted solutions (1)
16 Views
11 Replies
Replies (11)
Message 2 of 12

rajankur6494
Advocate
Advocate

Please find model attached here.Test1.fsm

0 Likes
Message 3 of 12

moehlmann_fe
Observer
Observer
Accepted solution

One possible way to achieve this would be to set the state of the location to some value that is not normally within the range of the HC states. For the chair this could be state "3" for example. The time spend in such a state will not appear in the person tables and as such also not count towards any statistics derived from them.

The issue however is that you would have to account for the possibility of the location state changing after the shift has ended (a patient only leaving some time after the shift ends). This would cause the state to be updated to a "normal" state again.

The, in my opinion, better solution is to customize the state chart instead. As a first step, select "Compare hours of the day" in the options. This will make the following changes easier. Next "install" the charts components. This will create a statistics collector and a calculated table in the toolbox.

1650365885278.png

1650365900149.png

Open the calculated table and navigate to the "Calculations" tab. Because we changed the chart to "Compare hours of the day", a lot of the needed syntax is already in place in the query. Click on the "Enable direct editing" button. This allows you to directly edit the SQL query the table is performing, though it will also disable the interface to automatically generate the query based on menu options.

Then make the following changes:

- Replace the "toString()" part in the first row with "hour".
Instead of taking the current datetime of the model and converting it to text that displays the full hour, this will convert the time into a numerical hour value.

- Add the clause "WHERE Hour >= 8 AND Hour < 14"
Because "Hour" is now a numerical value, we can apply a condition that it has to be equal or larger than 8 but smaller than 14. In other words, only data from the active shift will be used.

- Remove the last line ("GROUP BY")
The calculated table should only have a single row, not be split by the hour value.

1650366698125.png

Instead of writing the shift start and end time directly into the query, you can also read them from somewhere else in the model by enclosing the necessary flexscript code in curly braces. In the picture below I read them from the parameter table for example.

1650366682875.png

The calculated table (and with it the connected chart) will now only take into account the active hours.

shiftStats_fm.fsm

0 Likes
Message 4 of 12

rajankur6494
Advocate
Advocate

Hi Felix,

Thank you for your answer!

I would like to ask one more question if I may.

I have schedules for multiple providers in clinic. For eg:

8:00 AM - 8:30 AM Provider-1 Chair-1

8:30 AM - 9:00 AM Provider-1 Chair-1

8:00 AM - 8:30 AM Provider-2 Chair-2

8:30 AM - 9:00 AM Provider-2 Chair-2

I tried entering same schedule in date time source activity in process flow. But it is not generating tokens. Only working with different source activity for each provider.

Can you help me out how we can enter this schedule at one place and generate tokens for multiple providers?


0 Likes
Message 5 of 12

moehlmann_fe
Observer
Observer

Your method should normally work. Once reset the model once the schedule rows should re-order themselves in ascending order based on the arrival time and create the specified quantity of tokens for each row.

1650434529336.png

1650434574736.png

It's difficult to say what might be going wrong in your case without seeing your model. Could you maybe share it or at least a screenshot that shows the settings of your source activity?

0 Likes
Message 6 of 12

rajankur6494
Advocate
Advocate

Thanks Felix! It is working now. I think there was some other issue when it was not working.

I am facing one more issue if you can help in that. While writing TimeIn and TimeOut in global table "TrackTime", I am using Model.dateTime since I want the date and time both. But It is not giving the time with right result. Can you help me to find what is going wrong here?

I have attached model for your reference.

Thank you!Test1.2.fsm

0 Likes
Message 7 of 12

moehlmann_fe
Observer
Observer

FlexSim stores the datetime as seconds since 01.01.1601, which is what gets returned when you call Model.dateTime. To convert it into a readable format, use the "toString()" method (Model.dateTime.toString()). If you don't pass in any parameters the time is returned in the format specified in the model settings, but you can customized what exactly the commannd should return.

For more information see the relevant section in the FlexSim manual.

https://docs.flexsim.com/en/22.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/DateTime.html...

0 Likes
Message 8 of 12

rajankur6494
Advocate
Advocate

Thank you Felix! Appreciate your quick response.

0 Likes
Message 9 of 12

rajankur6494
Advocate
Advocate

Hi Felix,

I would like to substract also (OutTime - InTime) to get exact process time. But it is not possible in this format. What else I need to do to get accurate results in calculated table?

Please find model attached for your reference.

Thank you!

0 Likes
Message 10 of 12

rajankur6494
Advocate
Advocate
0 Likes
Message 11 of 12

moehlmann_fe
Observer
Observer

To subtract the times from each other you have to convert them back into number values.

1650608979181.png

Are you using a calculated table because you want to use the data in a dashboard chart? Because if not, adding the process time in a fourth column to the TrackTime table, together with the OutTime, might be easier.

test16.fsm

Note: In future, please create a new post for questions that don't directly belong to the original topic of the current one. Otherwise it's difficult for other users to find answers to these questions if they are buried in comment chains.

0 Likes
Message 12 of 12

rajankur6494
Advocate
Advocate
Thank you Felix!
0 Likes