Skip to content

Latest commit

 

History

History
17 lines (8 loc) · 3.9 KB

ThirdNextAppointment.md

File metadata and controls

17 lines (8 loc) · 3.9 KB

The algorithm used to determine the third next available appointment is based on source code from the Oscar EMR code base. This code can be executed within the Oscar EMR by clicking on the Admin tab and selecting under oscarReport the Report by Template option provided that the "Time to 3rd Appointment" template has been installed. If the template is not already installed, a copy is available in this directory.

For the purposes of the PDC Attachment Prototype project, the Oscar EMR source code was converted to a stand-alone application. Like the report by template, the application requires the Oscar provider numbers of the physicians for which the calculation is to be done. The application also needs the length in minutes of the required appointment, the schedule template symbols to search in and the date that the appointment is requested.

To determine provider numbers for physicians, use the Admin tab and the "Search/Edit/Delete Provider Records" link. Clicking "Search" creates a table of all the Oscar provider numbers (the ID field of the table).

The length of the appointment is arbitrary but it should be consistent between clinics. A default value of 15 minutes is being used but this default value could be adjusted by setting different configuration parameters.

There is a configuration issue with the set of schedule template symbols to search. The OscarEMR provides an initial set of codes in the scheduletemplatecode table but they can be modified at the clinic. New codes can be added and the purpose of existing codes can be changed. There is no provision within the OscarEMR database to record when such updates have occurred. One way to inspect the set of existing codes and what they might be used for is to click on the Admin tab, select "Schedule Setting" and click on "Template Code Setting". This brings up a form with the template codes at the top, in a drop down menu. The code(s) used for the third next appointment application should be present in the drop down menu.

The schedule template symbols actually present in a doctor's scheduletemplate may not be present in the scheduletemplatecode table since no constraint exists to force agreement. This has been found to be the case for some clinics. The symbols actually present in the doctor's scheduletemplate will appear beside the time in the OscarEMR appointment view. The symbols present in the doctor's scheduletemplate are those that need to be specified for calculation of the third next available appointment.

The final parameter is the date when the request is made. For the purposes of this attachment prototype project, this request date has been set to Tuesday morning before the clinic opens. The application code will find the third next available appointment from that point in time for each physician. It is possible to calculate third next available appointment times for past dates but the OscarEMR tables related to scheduling don't record when changes have been made. The schedule template to be used on specific days is specified in the scheduledate table. This table can be modified without the date of modification being recorded so the schedule template actually used on a past date is not well determined. If the correct schedule template is known, a search can be done on the appointment table to find timeslots that are free, for doctor's using that schedule template. The results of doing this calculation will be most accurate when they are done using data that is up to date as of the time the clinic opens on the request date rather than retroactively, because of the possibility that changes to the scheduledate table have occurred.

The results of the third next available appointment calculation have been compared to SQL queries and they appear to be consistent with what is present in the database. The code actually used in the calculation has been present in the Oscar EMR code base for several years and has been used by others.