# Fix for recurring appointment bugs in the Appointment Report

**URL:** <https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990>\
**Category:** OpenEMR Development\
**Created:** [June 3, 2015, 8:53pm UTC](https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990 "2015-06-03T20:53:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 3, 2015, 8:53pm UTC](https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990/1 "2015-06-03T20:53:08Z")

</div>

**[epsdky](https://sourceforge.net/u/epsdky/)** wrote on [Wednesday, June 03, 2015](https://sourceforge.net/p/openemr/discussion/202506/thread/1ac2e134/#edcc):

Hello Brady,

I have put a fix for the recurring appointment bugs in the Appointment Report on GitHub [here](https://github.com/epsdky/openemr/commit/842e00d8ab58b99f428ebc0cd3e524df054bf951)

It fixes both the duplicate and missing appointment problems.

Regards,

epsdky.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 4, 2015, 7:43am UTC](https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990/2 "2015-06-04T07:43:09Z")

</div>

**[bradymiller](https://sourceforge.net/u/bradymiller/)** wrote on [Thursday, June 04, 2015](https://sourceforge.net/p/openemr/discussion/202506/thread/1ac2e134/#5dc4):

Hi epsdky, Rod, and Ken,

Awesome. Testing well for me!

Ken and Rod,

Can you both look at this since it will be replacing the getRecurringEvents function, which you have both worked on. Especially Rod, whom added some more recurring appt options. My assumption is that epsdky’s code is now mimicking what the PostCalendar is doing to calculate the appointments, so should be the most accurate. Thoughts?

-brady  
[OpenEMR](http://www.open-emr.org/)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 4, 2015, 1:07pm UTC](https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990/3 "2015-06-04T13:07:18Z")

</div>

**[sunsetsystems](https://sourceforge.net/u/sunsetsystems/)** wrote on [Thursday, June 04, 2015](https://sourceforge.net/p/openemr/discussion/202506/thread/1ac2e134/#7dc9):

Hey epsdky, could you explain in a bit more detail what the problems are that are being fixed?

If it’s testing well for all types of recurring appointments then I don’t see a problem. It’s nice to see this contribution.

Rod  
[http://www.sunsetsystems.com/](http://www.sunsetsystems.com/)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 4, 2015, 1:23pm UTC](https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990/4 "2015-06-04T13:23:08Z")

</div>

**[sunsetsystems](https://sourceforge.net/u/sunsetsystems/)** wrote on [Thursday, June 04, 2015](https://sourceforge.net/p/openemr/discussion/202506/thread/1ac2e134/#ad98):

Oh never mind the explanation, I see there’s another thread for that.

Rod  
[http://www.sunsetsystems.com/](http://www.sunsetsystems.com/)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 6, 2015, 8:56pm UTC](https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990/5 "2015-06-06T20:56:55Z")

</div>

**[epsdky](https://sourceforge.net/u/epsdky/)** wrote on [Saturday, June 06, 2015](https://sourceforge.net/p/openemr/discussion/202506/thread/1ac2e134/#49f1):

Hello Brady,

I have made the changes to the include files as you suggested. The updated file is [here](https://github.com/epsdky/openemr/commit/9ed81a5779cb2b321e2a6544bd96c9285334474d)

Regards,

epsdky.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 7, 2015, 7:59pm UTC](https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990/6 "2015-06-07T19:59:27Z")

</div>

**[epsdky](https://sourceforge.net/u/epsdky/)** wrote on [Sunday, June 07, 2015](https://sourceforge.net/p/openemr/discussion/202506/thread/1ac2e134/#8e86):

Hello Brady,

Please disregard the above link, I made a mistake updating the include file line  
("/library/encounter\_events.inc.php" should have been “/encounter\_events.inc.php”).

An update is [here](https://github.com/epsdky/openemr/commit/4eecb8fe2f5e56c9cc1b197761305a5771a80f92)

Regards,

epsdky.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 9, 2015, 6:58am UTC](https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990/7 "2015-06-09T06:58:27Z")

</div>

**[bradymiller](https://sourceforge.net/u/bradymiller/)** wrote on [Tuesday, June 09, 2015](https://sourceforge.net/p/openemr/discussion/202506/thread/1ac2e134/#75d8):

Hi epsdky,

Was about to commit this with a couple very minor fixes:

> <https://github.com/bradymiller/openemr/commits/appt-reccurent-fix_1>

  
(note I rebased all your commits into one)

But noted the following bug:  
Create new patient  
Create new recurrent appointment “every 2nd Monday” until about a year away  
Go to Reports-\>Appointments  
The appointment does not show up if do TO and FROM date for the day of visit.  
It does show up if change the FROM date to about year away.

Let me know if you need more detailed information to recreate the bug.

thanks,  
-brady  
[OpenEMR](http://www.open-emr.org/)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 9, 2015, 8:50pm UTC](https://community.open-emr.org/t/fix-for-recurring-appointment-bugs-in-the-appointment-report/4990/8 "2015-06-09T20:50:57Z")

</div>

**[epsdky](https://sourceforge.net/u/epsdky/)** wrote on [Tuesday, June 09, 2015](https://sourceforge.net/p/openemr/discussion/202506/thread/1ac2e134/#9b4d):

Hello Brady,

$occurance was not being set before “case ‘2’” code which matters here.

Regards,

epsdky.
