Nation Notes LBF report loses formatting

Just upgraded from 4.1.2 (7), and there’s something different with the way Nation Notes data is displayed in LBF reports. I have no clue where to look here.

First screenshot is the text/tags as they’re saved in the form. Second screenshot (to follow, new users allowed only one img per post) is how the text is being displayed upon report generation.

Any ideas as to why this may be happening?

There seems to be closing span tags throughout the report. And now another one I tried to check came out looking like this:

Question:
Is the HTML manually entered into the ROS?

Nope. Formatting is handled by Nation Notes.

Maybe I could start by figuring out which related files have changed since 4.1.2 (7). But I can’t even find the code that handles this stuff…

These are the LBF revisions I made to options.inc.php, but they’ve been in effect since early 4.0.

Rogue span tags may be coming from a spellcheck.

Just reproduced the issue in current dev demo, ruling out my changes in options.inc.php. I unfortunately went live with this upgrade before properly testing, and this is a show stopper for us. I’m desperate for help right now.

@frankie, I know the feeling. Been there done that twice. Did you upgrade to 5.0.0(3)?

Forgive me for stating the what may be obvious to you. You can run a diff to find out what changed in Nations Notes.

When you said you recreated the issue, what steps did you take?

Which OS, PHP, MySQL, and Apache are you using?

Can you post a screenshot of your Nations Notes?

@juggernautsei, I appreciate you helping me look into this. Upgrade is complete, and all of my customizations have been ported over. That was a hell of a project, and was the reason I stayed back on 4.1.2 for so long.

But I’ve recreated the issue a couple times on the dev demo, so I have to assume it’s not because of my tinkering. Issue only appears when generating the report, not when viewed on the encounter screen.

Steps to recreate are as follows:

I’m using TextExpander to expand a “normal” exam template in that particular field, which calls a ton of extra tags, but I’ve also recreated it with a simple underline/bold pattern on dev demo.

New forum is awesome btw. Kudos to those who made this place happen.

I think I may have found the culprit, but there are a lot of functions responsible for opening and closing those LBF tags.

@frankie
What you possibly have run into is the security that was put in place since 4.1.2. You want to be looking at the interface>LBF>report.php

This is the file that is responsible for the reports display.

Look in your table for the Nations Note. If there is stored HTML in the database table. What could be happening is the tags are being converted and not processed. That could be the reason they are showing up on screen.

So, post back if there is HTML in the database table.

Great troubleshooting.

Fixed. Found the issue being discussed here:

https://sourceforge.net/p/openemr/discussion/202505/thread/7fba7698/

My fix is below. I believe the wordwrap function, which was introduced to fix another issue, is responsible.

/interface/forms/LBF/report.php

Regarding forum(and the chat), all the kudos goes to @robert.down for creating these awesome spaces.

I think a good way to fix this would be skipping the wrap if $frow[‘data_type’] == 34:
if ($no_wrap || $frow['data_type'] == 34) ...

Regarding above fix, if that works for you, then will be good to get it into the codebase (and next 5.0.0 patch).

Works perfectly. Thanks Brady!

Placed a PR (Pull Request) for this fix here:

1 Like