Fix for Patient Report not showing all document forms - #377
Conversation
|
Hello Sherwin, In an effort to replicate your problem I embedded the data from here (link in your post) in... interface/patient_file/report/patient_report.php so that it would be used with the relevant code but everything displayed properly. All forms were present. |
|
I don't know what to tell you but I will ask are you testing with Windows 2012 server, PHP 7.0.4, apache 2.4.18 and mysql 5.7.11? The dashes where for my troubleshooting purposes. Forgot to remove them. |
|
No, I tested on XAMPP version 5.6.20 with recent OpenEMR dev code. (Noticed form names with "-" added in last two images in your thread (first image not clear)). |
| " class='encounter_form' ". | ||
| ">" . xl_form_title($result{"form_name"}) . "<br>\n"); | ||
| */ | ||
| echo "<input type='checkbox' name='".$result['formdir']."_".$result['form_id']."'". |
There was a problem hiding this comment.
This script is called in several contexts and relies heavily on using arrays for multiple uses.
Obviously someone went thru the trouble of collecting stuff in an array and now you would just print it.
Some functionality is getting lost here that deals with processing of array. Better approach would be to capture the array and see where it is being echoed. Either some issue with form_name, form title translation values or in the echo statement itself. Could be related to your data? Is it happening for all encounters of that specific form?
There was a problem hiding this comment.
I went back into the program and randomly selected patients from the calendar. It is across the board that the first encounter does not display any form that was filled out on that visit.
Yes, I agree that they original writer went through a lot of hoops to make sure that the form name matches the registry.
The thing that bothers me now that I am taking a second look past the point of change is that the next foreach loop has if ($toprint = isset($html_strings[$var])) shouldn't it be a == instead?
But after testing the == it had no affect on the out come.
I went for just echoing it out because the loop above does the the same thing and simply prints to the screen the information. I think what the author was trying to avoid in the array has passed and that the form name will always match in the registry. There are other precautions in the code base to warrant not needing the array in the else statement.
In my opinion.
Also, I tried var_dump toprint and it is null even with original code and the changes that I made to the code. Which means in the original code the if statement is setting $html_strings[$var] to an empty value thus not being executed?
I did go ahead and went the rest of the way to see if the change would affect the next screen where the report is generated. And the report is generated with no errors to my knowledge.
There was a problem hiding this comment.
I have this same code running on another server and the only difference between the two is one is on PHP 7.0.4 and the other is on PHP 5.6.16. The code that is on the php 5 does not have this issue. However I can say that the code on the php 5, we down graded it from php 7 because we were having more problems than I could fix fast enough.
The multiple issues when away after the down grade to php 5.x.x.
There was a problem hiding this comment.
This could be an isolated case.
I have the latest code dev 5.0.0 running and I added multiple encounters to a patient chart and all forms show even the first encounter forms show as suppose to be shown.
I would suggest closing this pull request. It can be revisited of this happens for anyone else.
In my opinion. (too many court shows)
|
To provide more context, the original code block was added to support CAMOS: |
|
per @juggernautsei , will close this PR for now |
https://sourceforge.net/p/openemr/discussion/202505/thread/9958e95e/
These are the changes that were made to fix the error that was being experienced.