"add_sms_email_reminder.sql" Script Error

mike-h30 wrote on Saturday, August 16, 2008:

I ran the 2_8_3-to-2_9_0_upgrade.sql file and conducted some preliminary testing with OpenEMR 2.9.0.  I attempted to run the add_sms_email_reminder.sql script and received the error below ( I ran both scripts by choosing the import option in phpMyAdmin ).

-----------------------------------------------------------------------------------
Error

SQL query:

ALTER TABLE `patient_data` ADD `hipaa_allowsms` VARCHAR( 3 ) NOT NULL DEFAULT ‘NO’ AFTER `hipaa_message` ,
ADD `hipaa_allowemail` VARCHAR( 3 ) NOT NULL DEFAULT ‘NO’ AFTER `hipaa_allowsms` ;

MySQL said: Documentation
#1060 - Duplicate column name ‘hipaa_allowsms’

-----------------------------------------------------------------------------------

Please advise.

-Mike

gutiersa wrote on Monday, August 18, 2008:

I think this means that a column named ‘hipaa_allowsms’ already exists.

for some reason when I did this I had a similar message. It turns out the patient_data had already been updated with these new fields. I think when you update your version of openemr and follow all the instructions these fields are already included.

anyway, sounds like you don’t need to make any more changes to your table.

mike-h30 wrote on Tuesday, August 19, 2008:

I noticed that from a fresh install of OpenEMR-2.9.0 there are 76 tables created.

When upgrading from 2.8.3 to 2.9.0 with the "2_8_3-to-2_9_0_upgrade.sql" upgrade script, 4 tables are added for a total count of 73 tables in OpenEMR-2.9.0 (upgraded from 2.8.3).

The 4 new tables are:

1. fee_sheet_options
2. layout_options
3. list_options
4. prices

The three tables remaining to complete a total of 76 tables ( from a clean install of OpenEMR-2.9.0) are:

1. automatic_notification
2. notification_log
3. notification_settings.

Perhaps the "ALTER TABLE" command should be removed from the "add_sms_email_reminder.sql." 

-Mike

gutiersa wrote on Tuesday, August 19, 2008:

I’m not sure, but the field that’s causing you the problem: `hipaa_allowsms` belongs in patient_data. the point is that the table is probably already updated and you need not run the update statement: ALTER TABLE `patient_data` ADD `hipaa_allowsms`    anymore.

check pt demographics under choices and see if the field is already there.

mike-h30 wrote on Tuesday, August 19, 2008:

Yes the field "hipaa_allowsms" is there.  I should have clarified that I understand the error message but was wondering if the "ALTER TABLE" statement should be omitted from the "add_sms_email_reminder.sql" script.

ALTER TABLE `patient_data` ADD `hipaa_allowsms` VARCHAR( 3 ) NOT NULL DEFAULT ‘NO’ AFTER `hipaa_message` ,
ADD `hipaa_allowemail` VARCHAR( 3 ) NOT NULL DEFAULT ‘NO’ AFTER `hipaa_allowsms` ;

Also, why does the upgrade SQL script "2_8_3-to-2_9_0_upgrade.sql" not add the 3 tables below?  A fresh install of OpenEMR-2.9.0 includes the 3 tables for a total OpenEMR DB table count of 76.

1. automatic_notification
2. notification_log
3. notification_settings.

-Mike