When creating a new Appointment for a Patient using the Standard API I am getting a 500 error with a strange HTML response:
<h2>
<font color='red'>Query Error</font></h2><p> <font color='red'>ERROR:</font> insert failed: INSERT INTO openemr_postcalendar_events SET uuid=? pc_pid=?,
pc_catid=?, pc_title=?, pc_duration=?, pc_hometext=?, pc_eventDate=?, pc_apptstatus=?, pc_startTime=?, pc_endTime=?,
pc_facility=?, pc_billing_location=?, pc_informant=1, pc_eventstatus=1, pc_sharing=1, pc_aid=?
</p><p>Error: <font color='red'>You have an error in your SQL syntax; check the manual that corresponds to your MariaDB
server version for the right syntax to use near 'pc_pid='1', pc_catid='5', pc_title='Office Visit',
pc_duration='9...' at line 1</font></p><br />/var/www/localhost/htdocs/openemr/src/Services/AppointmentService.php at 297:sqlInsert<br />/var/www/localhost/htdocs/openemr/src/RestControllers/AppointmentRestController.php at 78:insert(1,Array)<br />/var/www/localhost/htdocs/openemr/_rest_routes.inc.php at 5161:post(1,Array)<br />/var/www/localhost/htdocs/openemr/src/Common/Http/HttpRestRouteHandler.php at 91:{closure}
If anyone has any suggestions on how to get around this please let me know.
Any help would be appreciated. @Param_CapMinds - not sure what the PHP error would be? Seems like the values are not getting passed through properly from the request body but request body follows documentation. @openemr
openemr_postcalendar_events table does have a uuid column. It was added in patch 2 here:
I would suggest checking that your database is up to date (using sql_upgrade.php). If your database is missing a uuid column for the table then your database is not running the latest patch and the code is out of sync.
Looking at the source it looks like there is a comma missing after the question mark on the uuid param in the insert function on line 277 of AppointmentService.php.