Having to save encounters twice

farloc wrote on Monday, January 05, 2009:

We recently recovered from a crash and had to backup the database from bin-log files. All seemed to backup quit nicely but some save encounters are not registering the first time but they will the second.

Do not see any specific errors popping up that would clue me into what is going on.

After the crash the bin-log files were moved to another server and replayed to catch the database back up to snuff. mysqlcheck openemr returned no major issues other then a metadata table needing upgraded. So that seems totally unrelated.

Server version: Apache/2.2.9 (Unix)
mysql  Ver 14.12 Distrib 5.0.70, for pc-linux-gnu (x86_64) using readline 5.2

OpenEMR v2.8.2-dev

Could this be an issue from updating from an older version of the EMR… I am sorry cant remember that version.

Also no real errors in mysql logs and a few warnings in php logs, so not much to work off of.

php.log warning…
PHP Warning:  Invalid argument supplied for foreach() in /var/www/localhost/htdocs/openemr/interface/patient_file/history/encounters.php on line 170

PHP Warning:  session_start() [<a href=‘function.session-start’>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /var/www/localhost/htdocs/openemr/interface/forms/note/save.php:9) in /var/www/localhost/htdocs/openemr/interface/globals.php on line 51

Thank you,
Stan

cfapress wrote on Wednesday, January 07, 2009:

Stan,

You listed your OpenEMR version as 2.8.2-dev but then said something about upgrading. Can you clarify? Are you running a newer version of OpenEMR than what was on the crashed machine?

Jason

farloc wrote on Wednesday, January 07, 2009:

I made reference to mysqlcheck only refrencing a database table that isnt being used and has no relation to the encounters.

The machines database was copied safely onto a external drive and after reinstalling the system using the original OpenEMR version we began to have the saving twice on encounters issue.

OpenEMR is the same. Apache/PHP/Mysql are updated to the newest versions. That is the reference of updating the system I was making.

farloc wrote on Wednesday, January 07, 2009:

I made reference to mysqlcheck only refrencing a database table that isnt being used and has no relation to the encounters.

The machines database was copied safely onto a external drive and after reinstalling the system using the original OpenEMR version we began to have the saving twice on encounters issue.

OpenEMR is the same. Apache/PHP/Mysql are updated to the newest versions. That is the reference of updating the system I was making.

cfapress wrote on Thursday, January 08, 2009:

Well… this is just a shot in the dark but… Your original error showed a problem with the PHP SESSION. Have you seen other strange behavior within OpenEMR or other web-apps on the same server? Does the session error show up for every OpenEMR page load?

There might be something goofy with the upgraded Apache or PHP config. Personally I never tweaked those config files to make OpenEMR work for me but it’s not out of the question with this odd behavior.

Have you considered upgrading OpenEMR to a newer version too? I don’t know if would solve your problem or make it worse.

Jason

drbowen wrote on Tuesday, January 13, 2009:

Dear Jason,

This happened on my production server.

We had to move all the files to a temporary server and reformat and reinstall the production server.

After restoring all the backup data we noticed that when we first open the form_dictation which is /forms/dictation/new.php  whenever we click the save button:

javascript:document.my_form.submit();

all of the data gets dumped / not saved.

But the form itself is saved and recorded in the table "forms".

I can then reopen the form which is /forms/dictation/view.php

clicking the the save button:

javascript:document.my_form.submit();

works correctly every time.

Unfortunately there was a lot of howling from my medical practitioners (x 6 practitioners) because they frequently forget and lose a lot of typed data.

I have replaced the folder /forms/dictation with a new folder off CVS but this did not correct the problem.

I am skeptical that the "save" function is broken since it works fine on the second save.

Something got corrupted, but I don’t get any error messages at all.

Apache 2.2.9
mysql 5.0.70
PHP 5.2.8
OpenEMR v2.8.2-dev

I am planning on upgrading but haven’t had the time yet.  I lost a lot of configuration on other programs and necessary subsystems when the main server went down. (fax, accounting, etc.)

My database has outgrown my hard drive space on the back up server so am waiting for a twin of my main server to arrive before upgrading.

Sam Bowen, MD

drbowen wrote on Tuesday, January 13, 2009:

I have the following set in my php.ini:

error_reporting  =  E_ALL & ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
error_log = /var/log/php.log

Sam Bowen, MD

drbowen wrote on Tuesday, January 13, 2009:

I’m sorry.  There is a warning that is occurring:

PHP Warning:  session_start() [<a href=‘function.session-start’>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /var/www/localhost/htdocs/openemr/interface/forms/note/save.php:9) in /var/www/localhost/htdocs/openemr/interface/globals.php on line 51

Sam Bowen, MD

cfapress wrote on Wednesday, January 14, 2009:

Hi Dr. Bowen,

I’m stumped on this. Since you’re using a much older version of OpenEMR I can’t match the line numbers of your errors with anything meaningful in my installations. For example, the session_start inside interface/globals.php is on line 81 in my code, not line 51.

I think your time would be better spent upgrading OpenEMR to v2.9.1 instead of tracking down the source of this problem. You could go around in circles for many more hours. Or spend those hours in doing an upgrade.

I can only think the trouble lies with some old code not working well with PHP5.

Sorry I can’t help you more.
Jason

drbowen wrote on Wednesday, January 14, 2009:

Dear Jason,

I am thinking the same thing.  It is curious that it only happens with this one form. (The one that we use the most often of course.)

The SOAP note saves the info correctly the first time but then you can’t make changes.

All the other functions appear to work normally.

*****code snippet from globals.php******
// Default category for find_patient screen
$GLOBALS[‘default_category’] = 5;
$GLOBALS[‘default_event_title’] = ‘Office Visit’;

// The session name appears in cookies stored in the browser.  If you have
// multiple OpenEMR installations running on the same server, you should
// customize this name so they cannot interfere with each other.
session_name("OpenEMR");

session_start();  //line 51
*****code snippet from globals.php******

My new server has been shipped and will likely be here on Thursday of Friday.

Sam Bowen, MD

gutiersa wrote on Wednesday, January 14, 2009:

I had this problem once and it was an issue with a language error in the form itself. Unfortunately I cannot remember the specific line. It had to do with the saving line vs updating line for the database. I debugged it with php-eclipse.