The Patient Waiting Time Simulator is an attempt to model the effects of patient referrals and clinic appointment availability on the patient waiting time for an out-patient department. The primary focus is on showing the effect on breaching the maximum waiting time permitted.
The simulator uses a queue to simulate appointments for patient referrals, that is on a first-come, first-served basis.
The simulator presentation consists of four panels:
- Entry of simulation parameters (yellow)
- Display of simulation result statistics (blue)
- Control of the simulator (magenta)
- Graphics representation for the display of simulation results and clinic slots
The parameters that can be specified are as follows:
The defines the number of periods the simulation should run. Periods are whatever time interval makes sense for the simulation you are running; they could be hours, days, weeks...
This sets the average number of referrals to the clinic every period (.e.g every week). This is used during the simulation run to add new patients to the waiting list. If you change this value, be sure to click on the "Reset Slots" button for the change to take effect.
The number of patients queued (i.e. on the waiting list) at the start of the simulation run. If zero (the default) then there are no patients queued at the beginning of the run. Queued patients are assumed to have been referred in the past (before period 0). The number of patients referred per past period is based on the # Referrals and Distribution settings.
This defines the maximum number of clinic appointment slots per period you intend to offer during the duration of the simulation. It is used to size the display of slots and appointments in the display panel.
This defines the average number of clinic slots per period for the duration of the simulation run. The exact number of slots for each period can be set from the display panel, by clicking on the appropriate location. For more details, please see the description of the simulation results panel. If you change this value, you will need to to click on the the "Reset Slots" button to effect the change.
This defines the maximum number of periods that a patient have to wait to avoid breaking the waiting time threshold. Appointment slots are coloured to indicate if an appointment breached the maximum waiting time (red) or was within the limit (green).
This setting controls how many new patients are referred during any one period. If Uniform, the every period has exactly the same number of new patients referred, that is the the number of referrals you defined (see # Referals). If set to Normal, then the number of new patients is randomised, based on a normal distribution, using the number of Referals as the mean. Therefore the number of patient referrals could be much higher, or lower, than the the number of referrals you have set. This setting is probably more realisitic than Uniform, but no more accurate.
This displays the total number of patients who were not seen within the breach threshold at the end of the simulation run.
This displays the average waiting time for all patients, both those breaching the threshold and not.
This displays how many clinic slots were available but never actually used to see a patient.
When clicked, the appointment slots defined for each period are displayed on the graphics panel. These are shown as blue rectangles. The number of slots available for any period can be modified by clocking on the graphical display panel.
When clicked, this clears any changes you have made to the number of available slots for specific periods and returns the number of slots for each period to the average number of slots defined.
When clicked, this will run the simulation. Appointment slots are coloured green for patients seen within the breach threshold, red for outside the threshold and blue for an unused clinic slot.
When clicked, this will clear the graphics display. The statistics while remain until a new simulation is run.
This button does nothing (yet).
This button does nothing (yet).
The graphics panel has two functions:
- Display of simulation results
- Display and editing of clinic appointment slots
The graphic panel is of a fixed size. If the number of slots and/or duration will not fit into the panel display, scroll bars will appear to allow viewing the whole of the results.
After clicking the Run button in the Controls section, the simulation results are displayed in this area. Each period is numbered on the X-axis at the foot of the panel starting from 0, which is the current period. Slots are number on the left of the panel, the Y-axis. Positions with no appointment slot are shown with a + character. Appointment slots are coloured green for patients seen within the breach threshold, red for outside the threshold and blue for an unused clinic slot.
By clicking the "Show Slots" button, the number of slots available will be displayed, appearing as blue squares. The initial display is based on the average number of slots you have defined. It is possible to change the number of slots for any period by clicking on the appropriate location on the graphics panel. The number of slots selected will be then be replicated into the future until either the maximum duration is reached, or a previously adjusted slot count is found, whichever is encounted first. It is probably best to experiment with this to get a feel for the process (you can't do any harm!).
You can reset the slots counts back to the default setting by clicking on "Reset Slots". You will lose any changes you have made to the slot counts for individual periods, so don't click this button unless you are sure you no longer need the slot settings.
The simulation is written in ClojureScript, using the HTML5 Canvas object for the graohics display, and runs entirely in the browser. Not all browsers support the Canvas object (although all recent ones should). If your browser does not support the Canvas object, the simulation will refuse to run.
If the simulator will not run, I recommend upgrading to the latest version of Chrome, Safari, Firefox, Opera or IE (9 or later).
A presentation for the simulator can be found in pat/resources/public/pat.html. This hooks up the gui code at appropriate places.
Copyright © 2013, 2014 Mark Willson
Distributed under the Eclipse Public License, the same as Clojure.