Multiple windows

drroller wrote on Friday, June 24, 2005:

Rod asked about multiple windows in the Forms and Billing Thread.

I know Gatman was working on adding this option to OpenEMR before he left to work on something else.

Multiple windows are extremely useful, when I was using FreeMED I would often have multiple patient encounters open in different tabs, this allowed me to see one patient after another and finish the soaps when there was a break.

markleeds wrote on Friday, June 24, 2005:

What if when you look up a patient and you are about to click on the name, just hold shift when you click to open in a new window?  When your done with that patient, make sure you close the window so you don’t get confused with a bunch of open OpenEMR windows.

sunsetsystems wrote on Friday, June 24, 2005:

You would expect that to work, but it does not.  OpenEMR keeps track of your current patient and a few other things on the server side, as session variables.  Because your session is identified via a cookie, you only get one set of session variables.  So if your current patient is changed in one window, it’s changed for all windows.

In my view this is a bug.  Session state should be stored at the client.

– Rod <rod at sunsetsystems dot com>

markleeds wrote on Tuesday, June 28, 2005:

It looks like in patient_file.php, setpid sets the patient id from the url

setpid($_GET["set_pid"]);

which comes originally from the patient name you click on.  This should make it so if you shift-click on the patient name, while you are still logged in as the same user in the same session, you should be able to work on different patients in different tabs or windows.  If there is anywhere where the setpid gets its argument from the session variable and not the url, this would need to be fixed to make it work.

sunsetsystems wrote on Tuesday, June 28, 2005:

Yes, there are quite a few places where the pid is not available from a URL or form field, and so is taken from the session variable.  There are probably other session variables with a similar problem.

Would you like to take an inventory?  :slight_smile:

– Rod <rod at sunsetsystems dot com>

markleeds wrote on Tuesday, June 28, 2005:

I’ll get to work on it.

markleeds wrote on Friday, July 01, 2005:

The problem is extensive.  I added some code to globals.php to log to a file where pid was coming from with each page loaded (each screen loads many pages with the frames setup).  In almost every case, POST and GET were empty, so the session variable was used.

I also used grep to search through the files and could not find any exceptions to this except where you first choose the patient by link.