Add Problem SQL bug after 4.1 upgrade

penguin8r wrote on Friday, April 13, 2012:

System was previously running version 4.0.0, upgraded to 4.1.0, then applied patch 9.
Now, when attempting to Add Medical Problem, receive the following SQL insert error:

ERROR: insert failed: INSERT INTO lists ( date, pid, type, title, activity, comments, begdate, enddate, returndate, diagnosis, occurrence, classification, referredby, user, groupname, outcome, destination, reinjury_id, injury_grade, injury_part, injury_type, reaction ) VALUES ( NOW(), ‘1098’, ‘medical_problem’, ‘asthma’, 1, ‘’, ‘2012-04-11’, NULL, NULL, 'ICD9:493.82 ', ‘1’, ‘0’, ‘’, ‘’, ‘’, ‘5’, ‘’, ‘0’, ‘’, ‘’, ‘’, ‘’ )

It appears that there is no field named “reaction” in the lists table in version <=4.0.0, it appears in the create tables routine for version 4.1, but it’s not in the 4.0.0 to 4.1.0 SQL upgrade routine.
Once you insert the field, all is well.  Just wanted to put this out there in case anyone else does an update & runs into this.

bradymiller wrote on Friday, April 13, 2012:

Hi,
This was brought in the 3.2.0 to 4.0.0 upgrade script and is in the 4.0.0 database.sql script. Perhaps you were running a 4.0.0 developer version in which case you may of never fully ran the 3.2.0 to 4.0.0 upgrade script?
-brady
OpenEMR

penguin8r wrote on Monday, April 16, 2012:

Well, this system started life back at version 2.8, something around version 2.83 or so if I remember right.  It’s been upgraded to 2.9, to 3.0-dev, to 3.2, from 3.2 to 4.0-dev, to the 4.0 release version, & now finally to 4.1.  All the upgrades were done by the book, & all those SQL upgrades should have been run, but maybe something errored along the way & it slipped through the cracks.
On the other hand, this makes for a fairly impressive display of OpenEMR’s ability to be up upgrade & updated & just keep on going!

Thanks brady.