Skip to content

Fix for Patient Report not showing all document forms - #377

Closed
juggernautsei wants to merge 1 commit into
openemr:masterfrom
juggernautsei:patient_report
Closed

Fix for Patient Report not showing all document forms#377
juggernautsei wants to merge 1 commit into
openemr:masterfrom
juggernautsei:patient_report

Conversation

@juggernautsei

Copy link
Copy Markdown
Member

https://sourceforge.net/p/openemr/discussion/202505/thread/9958e95e/

These are the changes that were made to fix the error that was being experienced.

@epsdky

epsdky commented Dec 8, 2016

Copy link
Copy Markdown
Contributor

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.

@juggernautsei

juggernautsei commented Dec 8, 2016

Copy link
Copy Markdown
Member Author

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.

@epsdky

epsdky commented Dec 8, 2016

Copy link
Copy Markdown
Contributor

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)).

@bradymiller bradymiller changed the title Signed-off-by: Sherwin Gaddis <sherwingaddis@gmail.com> Fix for Patient Report not showing all document forms Dec 9, 2016
" class='encounter_form' ".
">" . xl_form_title($result{"form_name"}) . "<br>\n");
*/
echo "<input type='checkbox' name='".$result['formdir']."_".$result['form_id']."'".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@juggernautsei juggernautsei Dec 9, 2016

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@bradymiller

Copy link
Copy Markdown
Member

To provide more context, the original code block was added to support CAMOS:
juggernautsei@4f1f38a

@bradymiller

Copy link
Copy Markdown
Member

per @juggernautsei , will close this PR for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants