We have a provider who is going on a year long leave. We want to move all of her future appointments to a new provider, but leave her on the schedule so appointments can be booked for after she returns (we commonly book appointments more than a year in advance). I haven’t seen anything in the GUI for this… Would the best way to go about this to run a SQL statement that changes the PID to the new provider?
My bet would be to make two Calendars next to each other. HolydayDokter and NewDoctor.
Only the scheduling will be a problem. Schedule in the HolydayDoctor and once the appointment is there, schedule for the NewDoctor.
There might be an option through phpMyAdmin and take the correct tables and rename the KeyID of HolydayDoctor to the ID of NewDoctor for future dates, but programmers-help would be another option with some kind of script. I never heard anything alike or seen anything within OpenEMR forums or read in the manuls.
You should not worry too much about appointments. In medical records and EMR what counts is the encounter. That can always be set correctly on encounter summary screen. In any case, here is what we do:
Even if new md has not been hired, create a placeholder. The name can be changed later.
Start assigning future appointments to new md.
On the given transition date, run the following query :
UPDATE openemr_postcalendar_events SET pc_aid= {new md’s user id} WHERE pc_aid={old md’s user id} AND pc_eventDate>{Last working date of old md e.g. ‘2014-07-30’}
We don’t use them but recurring appointments could be bit more complicated.
Once {old} md comes back, run the same process except the id numbers would be reversed and the date will be different.
Running a query in openemr_postcalendar_events for pc_aid (leaving physician’s user #) with pc_eventDate (actual time of the appointment) is the first step.
There needs to be a safeguard not to double book for the physician assuming the extra appointments. The Calendar does have the open slot feature (available appointment dialog). If this feature can be leveraged to structure the second query, this would very helpful.
Once it known where to put the patients, the pc_aid can be changed accordingly.
If step 2 is exceedingly difficult because we are talking about a whole year’s worth of appointments, the alternative is to randomly change the pc_aid; then while viewing the actual Calendar, make adjustments a month in advance. That should provide enough time for patient reminders.
If you’re brave, maybe try a MySQL command something like this (don’t trust
me – test it yourself):
update openemr_postcalendar_events set c_aid = X where c_aid = Y;
X and Y are just the provider IDs you want to exchange. You can further
limit this by date of the event if you wish. You can accomplish all in a
fraction of a second command if you do it right, I think.
Thanks so much for all of your responses everyone! I figured a SQL query would be the easiest, but just wanted to check if there was another way. We have a test server setup that mirrors our main server, so I’ll check the query on that one first.