4.1.1 - Use of '?' in SQL Data

mdsupport wrote on Wednesday, September 05, 2012:

Not sure if this is a 4.1.1 issue.  It looks like sqlStatement function is not able to handle the ‘?’ as appointment status. 

To reproduce the error :
1. Create an appointment.
2. Try to set the status to ‘? - No Show’.

This results in the following error on the demo site (and our practice as well) -

Notice how the pc_apptstatus is set to 23 and 'WHERE pc_eid = ’ cannot be set correctly.

Input Array does not match ?: UPDATE openemr_postcalendar_events SET pc_catid = '5', pc_aid = '1', pc_pid = '5', pc_title = 'Office Visit', pc_time = NOW(), pc_hometext = '', pc_informant = '1', pc_eventDate = '2012-09-05', pc_endDate = '0000-00-00', pc_duration = '900', pc_recurrtype = '0', pc_recurrspec = 'a:6:{s:17:\"event_repeat_freq\";N;s:22:\"event_repeat_freq_type\";N;s:19:\"event_repeat_on_num\";s:1:\"1\";s:19:\"event_repeat_on_day\";s:1:\"0\";s:20:\"event_repeat_on_freq\";s:1:\"0\";s:6:\"exdate\";s:0:\"\";}', pc_startTime = '9:30:00', pc_endTime = '9:45:00', pc_alldayevent = '0', pc_apptstatus = ''23'', pc_prefcatid = '0' ,pc_facility = '3' ,pc_billing_location = '3' WHERE pc_eid =
ERROR: query failed: UPDATE openemr_postcalendar_events SET pc_catid = '5', pc_aid = '1', pc_pid = '5', pc_title = 'Office Visit', pc_time = NOW(), pc_hometext = '', pc_informant = '1', pc_eventDate = '2012-09-05', pc_endDate = '0000-00-00', pc_duration = '900', pc_recurrtype = '0', pc_recurrspec = 'a:6:{s:17:\"event_repeat_freq\";N;s:22:\"event_repeat_freq_type\";N;s:19:\"event_repeat_on_num\";s:1:\"1\";s:19:\"event_repeat_on_day\";s:1:\"0\";s:20:\"event_repeat_on_freq\";s:1:\"0\";s:6:\"exdate\";s:0:\"\";}', pc_startTime = '9:30:00', pc_endTime = '9:45:00', pc_alldayevent = '0', pc_apptstatus = '?', pc_prefcatid = '0' ,pc_facility = '3' ,pc_billing_location = '3' WHERE pc_eid = ?

bradymiller wrote on Thursday, September 06, 2012:

Hi mdsupport,

Thanks for the bug report. Committed a fix for this to sourceforge(master branch):
http://github.com/openemr/openemr/commit/880132cc459e5e495d2556a6407a712a884e0ffb

Will include this fix in the next 4.1.1 patch.

-brady
OpenEMR

mdsupport wrote on Thursday, September 06, 2012:

Thx Brady.