Layout Based Encounter Forms

sunsetsystems wrote on Wednesday, July 29, 2009:

Radio buttons are just another way of implementing single-selection lists.  It’s not on my task list here, but would be straightforward for someone to do.

Rod
www.sunsetsystems.com

bradymiller wrote on Wednesday, July 29, 2009:

hey,
Just tried it out. Agree it’s very cool, loads of potential. After looking through the source will try to wrap my head around how to fit it into internationalization (will wait for code to mature a bit).
-brady

bradymiller wrote on Wednesday, July 29, 2009:

clarification:
Poor use of words with mature; it actually seems to test well. Just gonna wait a bit (hands full with trying to get a release out).

blankev wrote on Wednesday, July 29, 2009:

Radio Buttons should be about the same as YES/NO field (one of the fields that work without hesitations…, but radion buttons have some extra, the jumping around,  when used in menus. Need some good preparation before including them.

Pimm

blankev wrote on Thursday, July 30, 2009:

I just made a Layout form in OpenEMRCVSDemo. Created a form with two fields:

Listbox and choose LANGUAGE for the choices
Textbox and choose for DEFAULT text Sex

Entered from the FIELD1  LIST Spanish and got the following result:

ERROR: query failed: INSERT INTO lbf_data ( form_id, field_id, field_value ) VALUES ( ‘1’, ‘field2’, ‘Sex Field doen’t show the choices’ )

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘t show the choices’ )’ at line 1

What am I doing wrong?

Than I did the same again, to find where it could have gone wrong and everything went smooth, but the default, was in setup set to English  for Language and Sex for field2 did not show as default nor as first choice on the list.  First field showed as unasigned and field 2 as empty text field

Pimm

cfapress wrote on Thursday, July 30, 2009:

Hi Pimm,

You’re probably doing everything right. The trouble is with the SQL command and how apostrophes (’) are used and not properly encoded. This strikes to the heart of the matter when it comes time to filter all SQL commands to prevent errors like this and also potential SQL injection attacks.

Jason

sunsetsystems wrote on Thursday, July 30, 2009:

I see where the missing logic is.  Will fix it.

Rod
www.sunsetsystems.com

sunsetsystems wrote on Thursday, July 30, 2009:

I checked in a fix (to library/options.inc.php) for this case.

More generally, the problem is that various places in OpenEMR still needlessly require "magic quotes" to be set in php.ini.  I have created a module library/formdata.inc.php with a couple of functions to more easily handle this and other matters related to HTML forms.  I request that all developers take a look at it, use it where appropriate, and add more form-related features to it as appropriate.  Thanks!

Rod
www.sunsetsystems.com

blankev wrote on Friday, July 31, 2009:

Rod,

totday I made a Layout form CVSDemo and some comment about text-date:

connection between calendar Icon and input field is missing.

and

CheckboxList seems not to give the availability of INPUT.

Two remarks a day is OK with you or do you want more ??? Still 22 days to go…

Pimm

bradymiller wrote on Friday, July 31, 2009:

Pimm,
Just to clarify, this new feature is not planned to not be included in the 8/15/09 3.1.0 release (as always, this is open to discussion). So, you have much more than 22 days…
-brady

sunsetsystems wrote on Friday, July 31, 2009:

Pimm, I fixed date support but I don’t understand what you mean about CheckboxList.

Thanks for the testing help!

Rod
www.sunsetsystems.com

penguin8r wrote on Thursday, November 04, 2010:

Sorry to dredge up an old thread, but we have been working with these quite a bit lately.
Say you had many complex LBF forms you created on a test system, & you wanted to copy those forms to use on a production OpenEMR server, so you didn’t have to spend a week re-creating all the forms from scratch, how would one go about doing that?
I know some of the data is stored in   layout_options, list_options, & lists tables,  but after copying those onto system #2, the forms are not available, & it seems like there are other files/tables that would need to be replicated to the 2nd system for the forms to show up?  Anyone ever done this successfully?

sunsetsystems wrote on Thursday, November 04, 2010:

Each LBF form has an entry in list_options with list_id = ‘lbfnames’.  The form layout is stored in layout_options with form_id = list_options.option_id.  Any other relevant lists will be stored normally in list_options.  So just dump and restore accordingly.

Rod
www.sunsetsystems.com

penguin8r wrote on Monday, November 08, 2010:

Thanks Rod!  I’ll try that out this week, seemed like I was missing something but if that’s all there is to it then so much the better.

penguin8r wrote on Wednesday, November 10, 2010:

Another question, we keep finding new ways to use LBF, it’s very powerful but also confusing at the same time.
In the layout editor, there is a data type called “Exam results”, it’s also know as data type 23, but I have not been able to figure out the significance of “23”.  It doesn’t seem to refer to any db tables that describe what “Exam results” consists of, & repeated searching through the corresponding .php files only shows me things related to language translation.
What I’d like to do is clone & then slightly modify this data type to meet the needs of a physical therapy practice, basically I need another group of 3 possibility fields to use, like the “Abn” , “N/A” , and “Nor” options provided by the “Exam results” data type.
Where does one go to define & add entries to the available options for the “Data Type” field in the Layout Editor?
It seems like this should be relatively simple, but after much searching through the database tables & perusing the php files, I’m finding nothing other than the mysterious data type 23.
If someone can point me to the right place I’d greatly appreciate it.

TIA!

sunsetsystems wrote on Thursday, November 11, 2010:

All the field types and their behaviors are defined in library/options.inc.php.

Rod
www.sunsetsystems.com

penguin8r wrote on Thursday, November 11, 2010:

Thanks again Rod!  I’ll start going thru there & see where it takes me.

penguin8r wrote on Monday, November 29, 2010:

Where might I look to see about the formatting for the display of LBF forms?
When you build a form, say with a question or descriptive sentence, & then a list of fields that go with it, when you open the new form to fill it out, it looks like this:

Question or descriptive text here :  Checkbox & text field 1
                                                        Checkbox & text field 2
                                                        Checkbox & text field 3
                                                        Checkbox & text field 4
                                                        Checkbox & text field 5

However, after you save the form, then go back & view it, it displays like this:

                                                        Checkbox & text field 1
                                                        Checkbox & text field 2
Question or descriptive text here:   Checkbox & text field 3
                                                        Checkbox & text field 4
                                                        Checkbox & text field 5

Basically, the caption for the fields always ends up halfway down the list, which makes the forms look funny to the doctors when they refer to them.  We have some forms that have field lists with 50+ items on them, so when you pull up the form, you may see a list of fields but have no idea what they belong to because the question or label text is 25 lines down centered in the list.

The view.php file in /openemr/interface/forms/LBF is basically empty, so no clues to the formatting there.  Is there an HTML stylesheet for LBF forms hiding somewhere that I haven’t found yet?  Or does this need to be addressed somehow in the actual layout of the form itself?

sunsetsystems wrote on Monday, November 29, 2010:

Table cell styles are up to the individual top-level scripts that display forms based on layouts.  In this case it looks like the label is vertically centered (as in valign=‘middle’).

If you are using Firefox and want to determine which script is presenting a frame that you see, right-click that frame and select This Frame -> View Frame Info (or View Frame Source).

Also when you post about a question or problem, be sure to indicate which OpenEMR release is concerned.

Rod
www.sunsetsystems.com

leecrites wrote on Saturday, January 15, 2011:

Rod;

I’m a new OpenEMR user, and just started trying to get some customized forms and reports working. I tried the “standalone” perl script, and it seemed to work okay. I could go in and update the report.php to make it look like I wanted. So that was okay. But I stumbled on the form-based deal, and thought I’d tinker it with as well. What I found is that it makes a form that I like MUCH more. So that’s cool (Thanks, Rod - it really looks cool!).

I have a couple of issues that I need to get fixed/addressed/whatever.

1) Medicare demands a timestamp on the records, not just the date. So I need something that can handle entering the time. I can forsee needing the date/time when the record was generated and when it was printed.

The full date and time timestamp is a larger issue than the LBF routine, but I really dont’ think I’ll get the whole system changed just to include a real timestamp. We have a rather limited number of forms and reports we need, so I figured that I could make them here.

2) Each of the hospitals and clinics want a unique format the the printed report. So I need to generate a customized report. I liked the “standard” format alright, but they didn’t. I’ll need to pull in information from multiple databases (clinic name, address, etc; patient name, address, etc; doctor name, address, etc).

I know that I’m pushing the envelop with that OpenEMR is designed for, so some of my requirements are probably outside the scope of the project as a whole. When I found this option, I realized it was something I could potentially use to fix some of the holes we have found.

Thanks muchly,

Lee