I just installed the 4.1.2 upgrade and I am now receiving the following error on the bottom half of a patient’s home screen in the “Past Encounter and Documents” section. Any help offered would be greatly appreciated. Thank you. - Michael
Error
Past Encounters and Documents (To Clinical View) Results per page:
1-7 of 7
ERROR: query failed: SELECT a.code_type, a.code, a.modifier, a.memo, a.payer_type, a.adj_amount, a.pay_amount, a.reason_code, a.post_time, a.session_id, a.sequence_no, a.account_code, s.payer_id, s.reference, s.check_date, s.deposit_date ,i.name FROM ar_activity AS a LEFT OUTER JOIN ar_session AS s ON s.session_id = a.session_id LEFT OUTER JOIN insurance_companies AS i ON i.id = s.payer_id WHERE a.pid = ? AND a.encounter = ? ORDER BY s.check_date, a.sequence_no
Error: Unknown column ‘a.reason_code’ in ‘field list’
Hmmm… I upgraded from 4.1.0 (11) to 4.1.2 so I definitely skipped a step. If I backed up my database and reinstalled 4.1.2 as if starting from scratch would that fix the issue or could that further mess up how the queries view the database?
Can’t really predict what’s going on with your system.
If you haven’t already backed up your system, do it now before doing anything else!
If you are starting from 4.1.0, that column should already be part of your database.
Why that column would be missing is a bit of a mystery given the information you’ve provided thus far.
When the upgrade scripts are run, they check the status of the existing tables to reduce the chance of problems, but of course there are no guarantees. As I said, suggest that if you don’t already have a good recent backup (and restore plan) you do that immediately.
Leapfrogging works just fine on the database end, because the sql_upgrade.php script runs through all the required sql upgrade scripts (you just need to ensure you select the correct current version (note that a nice quick feature to add for any developers is to grab the version from the database version table rather than request manual selection)). It’s the file upgrade end that you may run into issues in some versions (for example, in 3.2.0 to 4.0.0 some directories need to get moved around). This is one of the huge advantages of using the Ubuntu/debian package; it will do the upgrade automatically when you install a newer version openemr package: http://www.open-emr.org/wiki/index.php/Ubuntu_Package_Upgrade_to_4.1.2
(note it will upgrade any version 3.0.1 or later to the current version)
i’d probably suggest going to a backup prior to your failed upgrade and try it again ensuring you selected the correct version on the sql_upgrade.php script. Usually these strange things happen if you initially started from a development version (ie. 4.1.0-dev), so suggest selecting 4.0.0 on the sql_upgrade.php script if that is the case.