Skip to content
Mirror of official OpenEMR Sourceforge repository
PHP JavaScript HTML XSLT CSS Perl Other
Latest commit e27386a @epsdky epsdky committed with bradymiller More recurring appointment fixes
Fix 1

For recurrtype 2 recurring appointments ("Last Saturday", "3rd Monday") set on the 29th, 30th or 31st of a particular month, and subsequently reopened for editing on this date or subsequent dates in the recurring sequence that are the 29th, 30th or 31st of a month, the "Last (weekday name)" option will not be shown (even though it is set), the default "day" option shows. If the appointment is re-saved (with "All" selected) without re-selecting the option, it will be over written by default "day" option.

The problem is related to how the option list is put together. Initially on the server side
all recurrtype 1 (rt1) options and all possible recurrtype 2 (rt2) options (including one that may not be required) are output to HTML with the appropriate option set to selected (lines 1416-1422).  Then on the client side the index of the set option is recorded in a variable (si) and all rt2 options are removed (line 1023) then one or more (required) options are written back.

Next selectedIndex needs to be reset. This is where the problem is. The index for  the set option ("Last weekday") for rt2 appoinments (29th, 30th or 31st) is not being reset. For all other possible appointments it is (line 1026). So a new line of code is needed to do this....

else f.form_repeat_type.selectedIndex = 5;

Since for these appointments the set option is written back to a new position (client side) the index on the client side (5 (<> si)) is required.

Fix 2

When recurring appointments are selected in the "Add New Event" window in a timezone with a positive UTC offset, for a date selected that is the 4th occurrence of a particular weekday that has a 5th occurrence that is the last day of the month, the "Last (weekday name)" option will appear in addition to the "4th (weekday name)" option making it possible to set an appointment not corresponding to the selected appointment date.

Line 1016 controls whether "Last weekday" option will appear for a particular date...

if (tmp.getUTCDate() - d.getUTCDate() < 7) {

The term tmp.getUTCDate() should be be giving the number of days in the month but for time zones with positive UTC offsets it is incorrect, it returns a value that is short by one.

The date object (tmp) was created with...

var tmp = new Date(d.getUTCFullYear(), d.getUTCMonth() + 1, 0);

The date is input with format (year, month, day) which the Date function  interprets as local, resulting in a date object that contains a zero time component (00:00:00). Consequently for positive UTC offset time zones when getUTCDate() is applied the date for the previous day is returned (relative to local time zone), which is the days of the month minus one.

(The term d.getUTCDate() gives the correct date, date object d is created with...

 var d = new Date(f.form_date.value);

Here f.form_date.value contains date in format "YYYY-MM-DD" which the Date function interprets as UTC, so for positive UTC offsets date object contains time component equal to the offset. Applying getUTCDate() returns the local date).
Failed to load latest commit information.
Documentation Patient Flow Board and Drug Screening modules.
Tests Code type module improvements:
accounting multiple fixes to prepay and checkout
ccr Direct Messaging Module updates for improved reliability, security, a…
contrib PHP7 Project. Commit 13. Fixed more deprecated constructors, take 4.
controllers PHP7 Project. Commit 13. Fixed more deprecated constructors, take 4.
custom Fee sheet improvements. Can set default code type. take 3.
gacl PHP7 Project. Commit 11. Removed unused adodb library from phpgacl an…
images AMC and CQM for MU2, take 6.
includes Added support for multiple sites from a single installation
interface More recurring appointment fixes
library Script encoding fixes to prior commit.
modules/sms_email_reminder 1-Fix the problem with html body showing up as attachment
myportal Care Coordination module
patients Adding HTML title tag for properly displaying the title on portal web…
phpmyadmin Upgrade phpmyadmin project (commit 4 of 3; This minor commit improves…
sites/default Dunning messages on statements, take 2.
sql removed filters from the MU2 dummy CDR testing rules for item a8
templates Expand document tree on load based on global configuration
COPYRIGHT_AND_LICENSE Second revision for copyright clarification
CategoryTreeMenu.js minor internationalization modification
DocumentTreeMenu.js Expand document tree on load based on global configuration
INSTALL updated INSTALL file
README testing commit README bug fix
acknowledge_license_cert.html updated acknowledments
acl_setup.php Fixed failure of gacl/setup.php and acl_upgrade.php when called direc…
acl_upgrade.php Modifications for module installer in openemr.
admin.php PHP7 Project. Commit 3. Mysql to Mysqli conversion, take 4.
controller.php PHP7 Project. Commit 12. Converted some split() calls to explode() an…
index.php Security fixes for pre-authentication cross-site scripting vulnerabil…
ippf_upgrade.php fixed converted visit form names
license.txt acknowledgements, licensing and certfication information update
phpMyAdmin- Upgrade phpmyadmin project (commit 2 of 3; This commits brings in php…
phpunit.xml Patch provided by Andrew Moore (acmoore)
setup.php Changed email address contact info to
sl_convert.php added logic for invoice w/o encounter, encounter w/o invoice, and fix…
sql_patch.php Patch script improvement
sql_upgrade.php Changed version from 4.2.2-dev o 4.3.1-dev
version.php minor changes to prior commit

Welcome to OpenEMR!!!

OpenEMR is a Free and Open Source electronic health records and medical practice management application. It is ONC Complete Ambulatory EHR Certified and it features fully integrated electronic health records, practice management, scheduling, electronic billing, internationalization, free support, a vibrant community, and a whole lot more. It can run on Windows, Linux, Mac OS X, and many other platforms.

The setup documentation can be found in the INSTALL file and extensive documentation and forums can be found on the OpenEMR website at:

Something went wrong with that request. Please try again.