Read about OpenEMR's Response to the COVID-19 Pandemic at https://www.open-emr.org/covid19/

OpenEMR Frames 404 error main window with patient search

I am in my first week into investigating this for a clinic I plan to open and need a cost effective but functional EMR. I set up a command line Ubuntu server, latest release. Installed OpenEMR 5.0.2 from the tar.gz file, and installed patch4. Browser is latest Chome.

There are several errors I am working through.

The first two errors I have parked, by un-checking allergy checking and disabling whatever associated function was giving me the problems, I will go back them later.

The next error was “incorrect DATE Value” that I fixed by editing clinical_rules.php at line 305 and removing (OR enddate=’’)

My current problem is that when style is set to frames, there is a 404 error that develops in the main window when searching a patient from the left frame pull down menu, this is reportedly reproduced in one of your older demo versions ( https://six.openemr.io/c/openemr/interface/main/main_screen.php?auth=login&site=default ) . The popup shows the appropriate Pt as a search result, but when the Pt is selected I get 404 in the main window. Interestingly, there is a small widget at the bottom of the left frame that allows a search by several criteria and it works fine, placing the patient search result in the main window instead of a popup, and then populating demographics in the frame as expected.

The problem seems to be an incorrect href in the srchDone(pid) function around line 393 of new_comprehensive.php.

The original code was this:

function srchDone(pid){
top.restoreSession();

<?php if($GLOBALS['new_tabs_layout']) ?>

document.location.href = “./…/…/patient_file/summary/demographics.php?set_pid=” + encodeURIComponent (pid);

Proposed fix for the error was this:

function srchDone(pid){
top.restoreSession();

<?php if($GLOBALS['new_tabs_layout']) ?>

document.location.href = “…/…/patient_file/summary/demographics.php?set_pid=” + pid;

<?php else ?>

document.location.href = “…/patient_file/summary/demographics.php?set_pid=” + pid;
}

I entered the proposed fix and saw no change. There was another post in the same feed that someone indicated they “removed a …/ and it worked” but that has not worked either with many iterations of ./ to …/ in several combinations.

When I run the F12, I see the error is coming from an incorrect link looking for demographics.php.

The small search widget in the left pain returns a file location of

<www.local_IP_address>/openemr/interface/patient_file/summary/demographics.php.

The pull down menu and popup returns a file location of

<www.local_IP_address>/openemr/patient_file/summary/demographics.php.

This of course is the wrong location for demgraphics.php.

I have edited interface/new/new_comprehensive.php to reflect the “…/…/patient_file/summary/demographics” location which is the same as the widget, but the error persists. When I look at the F12 function, it is still calling for “./…/…/patient_file/summary/demographics.php”

I am editing the new_comprehensive.php file with nano, saving and closing. I expected that I could edit, save and either refresh the openEMR page, or log out and in, and I have also rebooted the server to no avail and this would refresh to the edited version of the file, but is doesn’t change anything. I understand the srchDone function is referencing relative a local file path to the demographics.php file, but I don’t understand how the …/ compares to …/ and ./ and I don’t understand why it doesn’t seem to change after I edit the new_comprehensive.php file. Perhaps I am editing the wrong file? I can’t seem to find that function anywhere else after having searched through numerous files.

Any advice on what I am doing wrong?

hi @jvanark, sorry frames was dropped from the codebase over a year ago so would focus on tabs for future proofing, thank you

Are you telling me they removed frames or just stopped supporting them? I just downloaded 5.0.2 and the two layout options are tabs and frames, and frames seemed much cleaner.

@jvanark
The following link may help to fix the issue.
Link:https://forum.visolve.com/t/redirection-issue-in-search-option/26/3

Thanks
Visolve

this is a screenshot of the current 5.0.2 demo with information filled in, and is the same response I get on my installation.

No matter how I edit the new_comprehensive.php file, even with the proposed fix, the patient search function still returns that same file path.

So my questions are:

  1. Am I wrongly expecting this function to change by simply editing and saving new_comprehensive.php then reloading the page? (Notably, even rebooting server does not change it either).

  2. Is it possible the script is coming from other location?

  3. Are frames not supported any longer even though they are still an option on the current distribution or is the link from a year ago referring to “frames” related to some other frames / frame design that was on previous versions? I don’t understand how it was removed if it is still there.

hi @jvanark, that fix should work for this line

    document.location.href = "./../patient_file/summary/demographics.php?set_pid=" + encodeURIComponent(pid);

I’ve edited the original code to reflect the fix in the link visolve suggested, I’ve also edited it to reflect the filepath Steve suggested, but the program continues to show the 404 error and the troubleshooting function in the browser indicates the code of the original version of the function is still being used. Is it cached somewhere? I’ve cleared browser cache and the resulting filepath remains the same as circled in the above photo is this function cached on the server?

hi @jvanark, shouldn’t be, mind pasting your code here? thank you

Here is the code from new_comprehensive.php:

function srchDone(pid){
    top.restoreSession();
    <?php if($GLOBALS['new_tabs_layout"]) ?>
    document.location.href = "./../patient_file/summary/demographics.php?set_pid=" + pid;
<?php  } else {?>
    document.location.href = '../patient_file/summary/demographics.php?set_pid=' + pid;
<?php  }?>

I also edited it to this:

function srchDone(pid){
    top.restoreSession();
    <?php if($GLOBALS['new_tabs_layout"]) ?>
    document.location.href = "../patient_file/summary/demographics.php?set_pid=" + pid;
<?php  } else {?>
    document.location.href = '../patient_file/summary/demographics.php?set_pid=' + pid;
<?php  }?>

The error persists, and the output of a search from she left panel is still the same as the posted screenshot above, no matter what I change in the new_comprehensive.php file.

Ok, so I am trying to paste this code and it is being changed to three dots. Each file path is currently edited to dot-dot-/patient_file, when I paste them it is converted to dot-dot-dot-/. Either way, the search result still shows dot/dot-dot/dot-dot/patient_file.

@jvanark
It may be editor problem.Try typing the code manually which is mentioned in screenshot given in this link.

Hope this may fix the issue.

Thanks
Visolve

I did, I typed in the code from that link first, then edited it 6 different ways changing how the filepath was coded and it continues to fault to the exact same filepath as is circled in the above screenshot no matter how I edit it.

My above reference was regarding my attempt to copy and pate the code here. In my browser it was showing three dots after I submitted the comment even though I was posting code with 2 dots.