I am working on an Emergency Department model, and I need to get the results of the average length of stay of patients inside the emergency department which means in my model: (average time the entity spends during its workflow from source to drain). I thought at the beggining that this is the mean life time, but it turns out to be completely different.
Do I need to write a code to get the length of stay? and how can I customize my simulation results?
Thanks in advance
Solved! Go to Solution.
Thanks for the information. I beleive it is all I need, but do I have to do it through a method and can you help me with the method outline and table format. I am sorry I am not proficient in software.
You should create a table like this :
Create a method call Update_Tab_Entrance :
is do local myPatient : string := to_str(@) ; local index : integer := tab.indexydim + 1 ; tab["Patient",index] := myPatient ; tab["Entrance_Time",index] := EventController.Simtime ; end;
and an other method called Update_Tab_Exit :
is do local myPatient : string := to_str(@) ; tab["Exit_Time",myPatient ] := EventController.Simtime ; tab["DT",myPatient ] := tab["Exit_Time",myPatient ] - tab["Entrance_Time",myPatient ] ; end;
Now with this you record the time every patient spend between t0 and t1.
Then you can geat the meanvalue of the column DT easily !
Thanks for Information
but the code is not working I tried several times. Should I define the entity name or any other variable in this code? and Is there any thing missing?
I am sorry not much proficient with the software
I can't open your model (because of a non commercial licence problem).
Anyway, I created a new model the works like I explained before.
There you go. When you click on the button " Waiting Time" you get how long a patient was waiting.