We are currently updating the OP Help Center content for the release of OP 14.19 or OP 19. OP 19 is a member of the certified OP 14 family of products (official version is 14.19.1), which you may see in your software (such as in Help > About) and in the Help Center tabs labeled 14.19. You may also notice that the version number in content and videos may not match the version of your software, and some procedural content may not match the workflow in your software. We appreciate your patience and understanding as we make these enhancements.

SQL: Appointment Waiting Time

About

This reports indicates the elapsed time spent in all statuses for all appointments between two dates that you specify.

A sample image of this SQL report run in the Database Viewer is shown below:

Caveats

  • This report can be modified so that you can determine your average wait time by provider, by appointment type, by phase, etc.  Alternatively you can export the raw data to Excel and manipulate it that way.
  • This report takes a long time to run.  Do not run it for more than a 2-week period (unless your practice is very small).

Code

To highlight and copy the code below to your clipboard, simply click the Copy button.

select patno, appt_date,schedule.code1,schedule.uniqkey as appointment_number,description, activity_starttime, activity_endtime, (activity_endtime - activity_starttime)*24*60 as nettime, appt_type.description, staffinit as provider_seen

from schedule inner join schedule_pat_trak on (schedule.uniqkey = schedule_pat_trak.schedule_pk_uniqkey ) inner join appt_type on (appt_type.appt_type_id = schedule_pat_trak.activity_status) inner join staff1 on (schedule.addr_id = staff1.staffid ) where schedule.visit_status='Completed' and activity_starttime between :start_date and :enddate