ERROR: query failed: update facility

dcahoon wrote on Monday, September 26, 2011:

I cannot add patients or facilities to the database. I get errors everytime.

ERROR: query failed: update facility set name=‘Billing 1’, phone=‘9999999999’, fax=‘9999999999’, street=‘123 commerce cir’, city=‘Sacramento’, state=‘CA’, postal_code=‘95608’, country_code=‘US’, federal_ein=‘888888888’, color=’#99FFFF’, service_location=‘1’, billing_location=‘1’, accepts_assignment=‘1’, pos_code=‘12’, domain_identifier=‘UUUUUUU’, facility_npi=‘9999999999’, attn=‘IIIIIIIII’ , primary_business_entity=’’ , tax_id_type=‘EI’ where id=‘3’

rpl121 wrote on Monday, September 26, 2011:

Maybe I can offer some suggestions if you indicate what installation you have and how the installation process went.

Ron Leemhuis

dcahoon wrote on Tuesday, September 27, 2011:

I am running on a windows 7 machine, php5, mysql5.  I tried installing on an xp machine with the same results.  Let me know any other information you may need.  The installation went fine.  I can add insurances through but cannot update facility or add patients.  I turned display errors off and here is the result i get when I try to add a patient

Warning: Call-time pass-by-reference has been deprecated in C:\apache\htdocs\emr\library\freeb\xmlrpcs.inc on line 498

Warning: Call-time pass-by-reference has been deprecated in C:\apache\htdocs\emr\library\freeb\xmlrpcs.inc on line 501

Warning: Call-time pass-by-reference has been deprecated in C:\apache\htdocs\emr\library\freeb\xmlrpcs.inc on line 538

ERROR: insert failed: INSERT INTO patient_data SET pid = ‘2’, date = NOW(), `title` = ‘Mrs.’, `fname` = ‘MARMAR’, `mname` = ‘’, `lname` = ‘IOIOIOIJO’, `pubpid` = ‘OIOJOIJ’, `DOB` = ‘2011-09-05’, `sex` = ‘Female’, `ss` = ‘’, `drivers_license` = ‘’, `status` = ‘’, `genericname1` = ‘’, `genericval1` = ‘’, `genericname2` = ‘’, `genericval2` = ‘’, `street` = ‘’, `city` = ‘’, `state` = ‘’, `postal_code` = ‘’, `country_code` = ‘’, `mothersname` = ‘’, `guardiansname` = ‘’, `contact_relationship` = ‘’, `phone_contact` = ‘’, `phone_home` = ‘’, `phone_biz` = ‘’, `phone_cell` = ‘’, `email` = ‘’, `providerID` = ‘’, `pharmacy_id` = ‘0’, `hipaa_notice` = ‘’, `hipaa_voice` = ‘’, `hipaa_message` = ‘’, `hipaa_mail` = ‘’, `hipaa_allowsms` = ‘’, `hipaa_allowemail` = ‘’, `allow_imm_reg_use` = ‘’, `allow_imm_info_share` = ‘’, `allow_health_info_ex` = ‘’, `allow_patient_portal` = ‘’, `occupation` = ‘’, `language` = ‘’, `ethnicity` = ‘’, `race` = ‘’, `financial_review` = ‘’, `family_size` = ‘’, `monthly_income` = ‘’, `homeless` = ‘’, `interpretter` = ‘’, `migrantseasonal` = ‘’, `referral_source` = ‘’, `vfc` = ‘’, `deceased_date` = ‘’, `deceased_reason` = ‘’

dcahoon wrote on Tuesday, September 27, 2011:

OpenEMR v4.1.0

juggernautsei wrote on Tuesday, September 27, 2011:

Did you use the installer package or did you use the zip package to install?

Sherwin

dcahoon wrote on Tuesday, September 27, 2011:

I used the zip package. is the installer more stable?

juggernautsei wrote on Tuesday, September 27, 2011:

Yes, use the installer package not that it is more stable but that the xampp is already configured the way OpenEMR need to run properly.

The zip package is more if you have already setup your wamp or xampp install the way that the OpenEMR configurations need. I have done a configuration of WAMP on my own to get OpenEMR to run froom the zip package then it ran right.

Sherwin

dcahoon wrote on Wednesday, September 28, 2011:

I am not sure where to get the installer.  I found an xamp download that had loads of files and a few batch files that did very little other than start the xamp control panel.  If you can give me the install download path and maybe some step by steps that would be great.  The weird part is it does work for the most part, however, it seems the insert and update commands are not formatted properly. Even if i copy and paste them into an SQL browser i have to modify them to work.

bradymiller wrote on Wednesday, September 28, 2011:

Hi dcahoon,

Sorry for the confusion. I am assuming you downloaded the xampp/openemr zip package:
http://open-emr.org/wiki/index.php/OpenEMR_Downloads

The installation instructions for this are here:
http://open-emr.org/wiki/index.php/OpenEMR_4.1_XAMPP_Package_Installation

Is this package not working correctly?

thanks,
-brady

apdkmel wrote on Tuesday, November 29, 2011:

Hi, I know this is an old topic, but I wanted to add that we came across the same issue just now using the Windows zip file.
( I have various other websites on xampp and had  previously a working version of HMIS, so didn’t want to reinstall xampp.)

There seem to be errors in the generated sql statements for facilities and new patients in the zip package files.

- Running the generated  UPDATE/INSERT facilites statements through PhpMyAdmin, the problem seems to be that integers are expected for several values, but the statement tries to set them to blank ( =’’ ). In particular applies to primary_business_entity = ‘’. When I changed the value to ‘0’, the statement worked.

- Similarly when INSERTing a new patient, the issue seems to be ProviderID, Deceased_date and Financial_review. The statement worked in PHPMyAdmin, after I changes these 3 fields to NULL rather than ‘’ (or gave the date fields a proper date value).

Regards,
Melanie

bradymiller wrote on Wednesday, November 30, 2011:

Hi,

I am guessing this was related to your SQL_MODE setting in mysql. See bottom of this section in the wiki:
http://www.open-emr.org/wiki/index.php/OpenEMR_4.1_Windows_Installation#Required_Software_Installation

Sounds like it may make sense to add you changes to the codebase to hopefully fix this issue (I am guessing there will also be other queries that will break, so let us know if you find any other places that need fixing).

thanks,
-brady

apdkmel wrote on Wednesday, November 30, 2011:

Thanks Brady! Indeed, that was it.
And today I used the same zip package to upgrade OEMR on a different test machine and it worked absolutely fine as the MySQL settings were already configured as per requirement.

Melanie

xband wrote on Saturday, September 15, 2012:

Hello,

I am new to OpenEMR and just setup my first installation. I am running Windows 7 x64, IIS 7.5 and MySQL Server version: 5.5.27. Shortly after completing my first successful web install utilizing the OpenEMR utility I attempted to setup my first facility and received “ERROR: query failed”.

I also could not add new users or patients to the system. After reading this post, I verified my .htaccess files were in the correct directories as described during the installation and also disabled Strict Mode also described in the installation guide.

Here is a detailed procedure for those running Windows 7 and IIS (most posts I found are specific to Apache). Use notepad or notepad++ and open the my.ini file located in the root directory of where you installed MySQL. Here is an example:

C:\Program Files\MySQL\MySQL Server 5.5

Find:
Code:

# Set the SQL mode to strict
sql-mode=“STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

Replace with:
Code:

# Set the SQL mode to strict
sql-mode=“NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

Or, you can run an SQL query within your database management tool, such as phpMyAdmin:

Code:

SET @@global.sql_mode= ‘’;

Remember to stop and restart your MySQL Server instance or the infamous Windows reboot. This should solve your problem and now you can edit your facility, add users and patients to your system.

To your success!

-Ahmed

bradymiller wrote on Tuesday, September 18, 2012:

Hi,

I think this may be the first report of somebody getting OpenEMR to work with IIS.

-brady
OpenEMR