New Patient/New Encounter apostrophe issue

mvarelas wrote on Thursday, October 12, 2006:

Hello all, and many thanks to all the contributors/devs for making this fantastic software what it is today. I recently setup and installed oemr in a small practice completely replacing their existing(read: useless) springcharts and medisoft solution. Everything has worked great. The one issue I’ve had recur is if I try to add a patient with an apostrophe in the name: I.E. Leslie O’Banion it causes it to spit out the following error:

"
Warning: Missing argument 2 for helpfuldie() in C:\xampp\htdocs\openemr\library\sql.inc on line 120

ERROR: insert failed: replace into patient_data set id=’’, title=‘Mr.’, fname=‘Leslie’, lname=‘O’banion’, mname=’’, sex=’’, DOB=‘0000-00-00’, street=’’, postal_code=’’, city=’’, state=’’, country_code=’’, ss=’’, occupation=’’, phone_home=’’, phone_biz=’’, phone_contact=’’, status=’’, contact_relationship=’’, referrer=’’, referrerID=’’, email=’’, language=’’, ethnoracial=’’, interpretter=’’, migrantseasonal=’’, family_size=’’, monthly_income=’’, homeless=’’, financial_review=’’, pubpid=‘6’, pid = 6, providerID = ‘’, genericname1 = ‘’, genericval1 = ‘’, genericname2 = ‘’, genericval2 = ‘’, phone_cell = ‘’, hipaa_mail = ‘’, hipaa_voice = ‘’, date=NOW() (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘banion’, mname=’’, sex=’’, DOB=‘0000-00-00’, street=’’, )
"

And it will spit out a similar error if I try to enter an encounter with an apostraphe in it- THe error is as follows-

"
new Your Clinic Name Here This is an apostraphe’s test. 10 11 2006 10 11 2006
Warning: Missing argument 2 for helpfuldie() in C:\xampp\htdocs\openemr\library\sql.inc on line 120

ERROR: query failed: insert into form_encounter set date = ‘2006-10-11’, onset_date = ‘2006-10-11’, reason = ‘This is an apostraphe’s test.’, facility = ‘Your Clinic Name Here’, pid = ‘2’, encounter = ‘90’ (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘s test.’, facility = ‘Your Clinic Name Here’, pid = ‘2’, encount)
"

I’m assuming at has something to do with the mysql field not accepting the apostraphes?
Anyway if anyone could please advise me on what to  here, or if theres a quick fix- it would be greatly appreciated.

Thanks again and heres my machine specs-

XP SP2
MySQL 4.1.11
PHP Version 4.3.11

duanemorrow wrote on Thursday, October 12, 2006:

The problem is that strings are passed into a database typically using either quotes i.e. “string” or ‘string’. When you pass it “my string’s” it gets confused. The way to store a single or double quote in a database is by using a escape character i.e. “my sting’s”. This would need to be checked in each entry field by php before it is passed to the database.

sunsetsystems wrote on Thursday, October 12, 2006:

Hi Matt, welcome to OpenEMR!

Try turning on magic_quotes_gpc in php.ini.  Then you’ll need to restart the web server.

Rod
www.sunsetsystems.com

mvarelas wrote on Thursday, October 12, 2006:

Thanks for the quick responses! When I turned the magic_quotes_gpc to ON it solved this problem, but it created another. Now when I upload a document the path is messed up. for example-

A document I uploaded will now show a path of:

"
The requested document is not present at the expected location on the filesystem or there are not sufficient permissions to access it. C:xampphtdocsopenemrdocuments/6/stmnt.pdf
"

Any ideas?

sunsetsystems wrote on Thursday, October 12, 2006:

OpenEMR on Windows is not so well supported, but I’ll take a stab anyway.

This looks like a problem of putting backslashes in the value for $webserver_root in globals.php.  Backslashes in PHP literals generally start an escape sequence, so if you really want a backslash you need to put in two of them.  But try using forward slashes instead as path separators – those should work as well and are not quite so ugly.

Rod
www.sunsetsystems.com

drbowen wrote on Thursday, October 19, 2006:

In general we have being requiring to have magic quotes turned off by default.

Some areas of OpenEMR have been fixed to accept apostrophes but not all.

If I need an apostrophe in a section that I know does not accept apostrophes I use a back-quote symbol.  While not technically an apostrophe most users read through and read this as an apostrophe without ever realizing the difference.

Of course the more elegant solution would be for the code originator to patch there code to allow apostrophes in any user data entry field.

Sam Bowen, MD

nightwolf76 wrote on Wednesday, November 22, 2006:

Was following up to see if anyone figured this out. I have tried turning magic quotes off and also placed two forward slashes in the webserver root.