Implementation of LBF visit forms in Onsite Portal

I admit, LBF can be difficult to get use to. However, many users depend on this core templating engine as their only recourse for creating encounter forms for specific uses to their discipline. Most difficult for many is the row and column layouts but, once you get by that, LBF is pretty straight forward for most forms that are mainly questionnaires which often times, end up being transcribed elsewhere.
There are other reasons for LBF in patient documents such as using existing core forms such as History:


Note the help which can be added to templates but ignored in disposition.

This form is already in core and sorely needed in portal or intake.

For pure templates it is helpful to remember that they were meant for simple, mostly legal documents and it got carried away. However, they can be versatile enough to handle many document types if you always keep in mind, templates are simply tagged directive replacement where template resides inside a form tag wrapped by a div.

<div><form>$template</form></div>

So adding an icon can be as easy as:

<span><i class="fa fa-envelope fa-2x"></i>{varTextInput:320px}</span>

or a label

<label class="fa fa-envelope">Please Enter Blah</label>{varTextInput:120px}

Another important point is text vs html. By default all templates will be cleaned up on render by replacing all “\r\n” with a <br /> tag unless the {ParseAsHTML} directive is used, where in that case, linefeeds are simply removed without any replacements allowing to format as html rendering only. Remembering one also has the <pre></pre> tags for pure text.

Concerning template repository: I’m still working out the best way to handle these in dashboard. I always try to make the UX as clean and easy as possible. Sometimes i’m lacking but, be assured it is forefront in my mind. So, i’ll come up with something!!!

A note on this project. I never accept a vendors sponsorship unless it is allowed to be put in OpenEMR core for the community use. Many times this is just token funding where I end up taking on the responsibility for the feature implementation/integration and support. This includes making sure we provide for the existing release and v6.0. I’m not crying poor me but wish to point out why I put up these forum posts. It’s to gauge if the community finds the feature useful and whether I should go through all the effort or not. In this case i’m hesitant. Six likes from three people doesn’t exactly scream let’s do this.

So, I may not go through the effort to support and patch v5.0.2 and just wait to maybe put in v6.0. It’s getting very tedious trying to support v5.0.2 while developing for upcoming v6.0 release. I may publish an unofficial patch for those that want the feature and willing to take responsibility for their own implementation.

I have no idea what you mean here!

1 Like

Sorry, never finished this. I have to get back to this. Problems with server.
I was trying to get to things like apps for apple and android phones. Having like an template download site.

But like I said. I have to get back to that.

Some more additions and improvements:

  • Changed dashboard template editor to a full dialog.
  • Added another radio group directive for true/false responses.
  • New Medical History canned template based on History LBF. Has ability to edit or add codes in review and also render to printable for document charting.
  • Items can be excluded from portal view but seen by reviewer.
  • LBF can still be included with additional template directives i.e maybe a signature or dates etc.
2 Likes

Finally a PR:Portal support for LBF template engine by sjpadgett · Pull Request #3946 · openemr/openemr · GitHub

I will do a pre-patch 5 for v5.0.2 and post here soon for those I hope will help me test. In the patch I added a new canned default template Medical_History that uses LBF with a patient signature:
Portal


In review:

Where reviewer is allowed to make edits not allowed by patient. Codes is a good example:

With History form, reviewer can then chart to demographics history, download or send printable to documents.
Flattened printable version after charting:

I think LBF is a good addition and should ease form diversity in Portal.

2 Likes

Nice work! Guessing @sunsetsystems (original dev of all this LBF stuff) will be very happy to see this template engine getting expanded to the patient portal :slight_smile: Looking forward to checking out the PR.

2 Likes

Here is patch for those wanting to try out. Remember this patches from 5.0.2(4) so previous patches are not included.
This patch includes all new fixes for patch 5 including

  • EOB bug fix
  • 2020 ICD10 code zips
  • Reworked portal custom report
  • Of course new LBF feature.
2 Likes

This is cool too! v6.0.0

2 Likes

And for v6.0.0:

1 Like

I am stuck on the use of github. Can you recommend a YT video that can help me understand github?
Thanks
I would like to work toward catching up such that I can document. It is hard for me to document if I don’t understand or apply the information.
Is ports applications like in freebsd or is it short for portal?

Hi Sandra, Sorry for misunderstanding. By port I’m talking about porting code i.e making v5.0.2 version of feature compatible with v6.0.
I merged the PR into master(v6.0) so it’s just a reference in this thread so I can show off! :slight_smile:

If you want to test the new feature in v5.0.2(4) then apply the patch from here: Implementation of LBF visit forms in Onsite Portal
Else install v6.0 dev from master or downloads(I believe)

1 Like

I see, I did install master today, actually, I could not install it, check this out:

BTW, you should show off :slight_smile: it’s a lot of work

@sjpadgett Hi Jerry, Getting an error in the admin panel using this whenever I try to visit the Portal Audits page from the portal alerts menu.

Oh Snap!
Unauthorized

You may want to try returning to the the previous page and verifying that all fields have been filled out correctly.

If you continue to experience this error please contact support.

Stack Trace:

#0 /var/www/portal/patient/fwk/libs/verysimple/Phreeze/Dispatcher.php(90): GenericRouter->GetRoute(‘GET:onsiteactiv…’)
#1 /var/www/portal/patient/index.php(52): Dispatcher::Dispatch(Object(Phreezer), Object(SavantRenderEngine), ‘’, NULL, Object(GenericRouter))
#2 {main}

Does portal patient documents work?
Sounds like ya don’t have php RewriteEngine On in php.ini or redirect module is not installed or enabled.
sudo a2enmod rewrite
sudo systemctl restart apache2

1 Like

This might be a chrown issue, i’ll come back to it tomorrow now.

@sjpadgett Edit: My issue was a mix of apache chrown permission issues or cached data from 5.0.2 (4) - after using ccleaner with all browsers closed it all seems to be working fine :slight_smile:

Are you going to add nation notes support? Or maybe for fields with that give the patent a basic text editor?

The portal LBF will the same in portal as an encounter visit form so nation notes would confuse patient for sure. Hell, it confuses me still after six years!:slight_smile:

A html text area should be more that sufficient where I gave a configurable text area with directive {TextBox:rrbyccc} e.g {TextBox:04by120} for 4 rows of 120 chars.

I have no plans to add an editor though I could at some point.

Right now if i use nation notes it just appears as a white box, if the patient clicks it nothing appears.

Just noticed, I can see an error popping up in firefox console on nation notes field every time I click.
“Uncaught TypeError: top.restoreSession is not a function” [dialog.js:341:9]

=====================

Drop downs dont seem to be saving into the PDFs either, for example if i use a custom list from an LBF (Listbox w/add) the option saves and appears when being reviewed, however It does not get saved into the PDF.

When i use the chart to category onsite portal reviewed, I then check by going into the patient / documents and open the PDF, the Label Testing from the LBF form appears but not the content from the drop down box below it.

okay thanks Mark for bringing up. I’ll have to figure out a way around the session restore error and it will definitely cause probs in many places with LBF.

I’ll have to look into pull downs. Works with medical history template.

umm may take me a couple days to get to. ONC api auth is my focus now and need to get to a PR.
I’ll post back here when I figure it out

2 Likes

Sounds good, looking forward to what you find on this :slight_smile:

@madmax and All,
Here are some new fixes to portal LBF: Fix some LBF issues by sjpadgett · Pull Request #3972 · openemr/openemr · GitHub

Also i’d like to point out that the same/all templates are available from demographics patient documents.

New testing patch for patch 4:

1 Like

I think there may be a bug here. The save and the send for review buttons are not working in patient documents in the patient portal.
The Signature button shows at the bottom “#openSignModal
but the save and send for review buttons show only # at the bottom.

Sorry but that is what is happening at my end. I am using only the patient portal to enter new patients. BTW, I am happy to share my new patient forms. they are not perfect, also they are pain management based. But I will send them if anyone wants them.

I did install the prepatch above 5_2