A user was comparing two patients on the same machine and used a second login ID to view a second patient’s info for comparison. The user has dual displays and finds it convenient for analysis of patient details. The user was composing SOAP notes for the first patient under one login ID and used a second login ID to compare the details of another patient. The user mentioned that one of the notes they composed for the first patient was not showing up in the patient chart so they created a second SOAP note thinking that the first SOAP note was not saved.
I investigated the database for the encounter the user had created. I noticed in the forms table that there were two SOAP notes created by the user for given encounter. However the first SOAP note that the user reported missing had the PID of the second patient the user was comparing under the user’s second login instance of OpenEMR. Some how the PID of the second patient was inserted into the PID column of the forms table for the first patient.
Should two logins be permitted on the same machine at the same time?
Simultaneous login by more than one user on the same machine is supposed to work. The “top.restoreSession” calls scattered throughout the code are part of that mechanism. There is obviously a bug somewhere. Curious what browser this was on.
Right. Suggest you try to figure out how to reliably reproduce this bug (on the development demo site would be nice), and if you can then please open an item in the bug tracker for it.
The browser was Safari 5.0.5 on Snow Leopard. Before I add it to the tracker, is it still considered a bug if it did not occur on an OpenEMR recommended browser like Firefox? I will try to replicate the issue on the demo site with the latest version of Firefox.
Okay, I just tested this with Safari 5.1 on demo site. I logged in as Admin and Physician on same machine in two separate browser windows. I opened patient chart for “Juana Juana” (PID = 4) under Physician login and created SOAP for Steven Milnore (PID = 1) under Admin login. Forms table is showing a PID = 0 (there is no patient with PID = 0) for encounter number 22. Going to download latest Firefox and test Firefox next.
Safari under windows? or OSX?
After you log in with the seperate browser windows, if you hit view page source in each of the separate windows, do you see two different session IDs?
var oemr_session_name = 'OpenEMR';
var oemr_session_id = '2drbb5lte7ksekgdone2fe2kr0';
var oemr_session_name = 'OpenEMR';
var oemr_session_id = '10dbb969b6b2ef69c62a16050be761bd';
var oemr_session_name = 'OpenEMR';
var oemr_session_id = '2102fb846c35ef29b40aa98769adf921';
I am also experiencing the “white screen of death” when creating an encounter with 2 different logins and 2 different browser Windows.
Any ERROR messages in your PHP log when you try the multi-browser thing that results in white screen? Where in your sequence of events of opening the patient charts/logging in do you create the encounters?
Had a thought about top.restoreSession. The general approach is to add a call to restoreSession when a link is clicked to go to another page. Would it work properly if we instead hooked the call to the window unload event? If we only have to handle the call to top.restoreSession in one place per page instead of on every link, that might eliminate some potential errors. Not sure if that would address this particular problem, but it’s a more general thought.
Interesting idea, but I’m not sure it would work. That would require the window being unloaded before the HTTP request to the server is constructed, which I suspect does not happen. And if it does it may be browser-specific. Could try it though.
It needs to happen in the same execution thread as the one that sends the outgoing request, otherwise another session on the machine can replace the session ID that will be sent with the request. So no, document.load will not work.
Note that restoreSession is required before anything that sends a request to the web server, including AJAX calls.
Any ERROR messages in your PHP log when you try the multi-browser thing that results in white screen?
This was on the OpenEMR 4.0 demo website.
Where in your sequence of events of opening the patient charts/logging in do you create the encounters?
After entering the patient chart from the main patient list, I used the Encounter History drop down list in the top menu and chose “New Encounter” from the drop down.
If you do this, the dialog box comes up before the log entry gets generated. The log entry (signifying that the request was made) doesn’t get generated until after you hit ok in the dialog. So it’s clear that the onbeforeunload event gets fired before the request is made.
I tested this with firefox 5, IE 9, Chrome12, Safari 5.1
There is definitely a bug with the encounter drop down, where it doesn’t call top.sessionRestore before changing encounters.
I didn’t get the white screen when I tested like you Mike, but it was definitely for the wrong patient. (my old patient’s problem list showed up on my new patient.)
I guess another way to fix this is to change toencounter so that it call top.restoreSession, but this was the easiest place for me to find to add the call.
Test case here. create this file named testUnload.php on your server.
If you do this, the dialog box comes up before the log entry gets generated. The log entry (signifying that the request was made) doesn’t get generated until after you hit ok in the dialog. So it’s clear that the onbeforeunload event gets fired before the request is made.
I tested this with firefox 5, IE 9, Chrome12, Safari 5.1
I see what you mean. Here is my Apache error log.
[Wed Aug 03 19:39:19 2011] [error] [client 192.168.1.71] testing time stamp
[Wed Aug 03 19:40:13 2011] [error] [client 192.168.1.71] testing time stamp, referer: http://192.168.1.22/testUnload.php
There is definitely a bug with the encounter drop down, where it doesn’t call top.sessionRestore before changing encounters.
I also noticed that after using the Encounter drop down a few times, it becomes unresponsive - when you click on it nothing happens.