Forms Development: Best Practices

tekknogenius wrote on Friday, March 25, 2005:

Lets get a running list of “Best Practices” for forms. This should help developers until we get some more documentation. What I’m looking for are both functional and technical tips to be used when developing forms. I have a couple to start the list off (gleaned from another topic).

1. Correct spelling
2. Should have a "did not ask" option default for questions (like radio buttons).
3. Checkboxes should have other values for printing other than "on" and null

jknapp wrote on Friday, March 25, 2005:

Is there a form generation tutorial anywhere? I am very interested in this, but have just started with openemr so I have no tips.

drbowen wrote on Saturday, March 26, 2005:

As noted by Dr. Roller the null choice or "did not ask" should not print.

Forms should be based on recognized best practices.

There should be context sensitive help for the physician such as recent treatment guidelines.

Text entry areas should have spell checking.

Ability to let the physician set their own defaults.

Sam Bowen, MD

drbowen wrote on Sunday, April 03, 2005:

Avoid using SQL reserved words.

SQL reserved words are called reserved for a reason:  They are to be used for the SQL engine.

Use of the reserved words is a sloppy practice. 

Mysqldump in particular does not distinguish between normal column names and reserved words.  This is’nt discovered until you try to recover the database  and the tables with reserved words won’t load.

The names have to be repaired by hand.  This gets progressively more difficult as the database gets larger.  If the database gets very large, a typical PC may not be able to open the mysqldump file to make these modifications.

There are two reserved words being used in the table structure already.

Sam Bowen, MD

drbowen wrote on Sunday, April 10, 2005:

Does anybody know what are the critical fields necessary to add to the forms to allow them to interact with the billing module?

Or, how do we fix the broken forms?

markleeds wrote on Tuesday, April 12, 2005:

What are some SQL reserved words that have been used or might be accidently used?

I am rewriting my form generating perl script and I am about 80% done.  It’s not really difficult, just hard to find a free minute to think quietly.

I don’t know if anyone ever used it or found it useful.

The new version will be a single, self contained, executable script with the code cleaned up a little.

When it’s done, I’ll post a link to it.  Let me know if it is at all useful to anyone.

Mark

drbowen wrote on Tuesday, April 12, 2005:

"The following words are explicitly reserved in MySQL. Most of them are forbidden by SQL-92 as column and/or table names (for example, GROUP).":

http://dev.mysql.com/doc/mysql/en/reserved-words.html

andres_paglayan wrote on Tuesday, April 12, 2005:

this link was posted in another  open source health related list, some of you may already have it.
the title is:
Medical Usability: How to Kill Patients Through Bad Design

drbowen wrote on Tuesday, April 12, 2005:

A useful and thought provoking article Andres.

drbowen wrote on Tuesday, April 12, 2005:

Incorporating a reiterative cycle of feedback from real users on usability and "Perceived practicality" would be an  excellent addition to our "best practices" list.

markleeds wrote on Tuesday, April 12, 2005:

Thanks for list of reserved words.  It will be easy to put into script to prevent use of any of them by accident.

Taking a little longer than expected, but will likely be ready by tomorrow afternoon if the office is not too busy in the morning.

Mark

drbowen wrote on Wednesday, April 13, 2005:

Long forms should have a save button at the top and the bottom of the form.

markleeds wrote on Friday, April 15, 2005:

Working version of new form generating script done.

Not tested within OpenEMR yet.

It does check for use of reserved SQL words before generating the form.

http://drleeds.com/files/formscript.pl

No template files required for this one, it is completely self contained.

I will get around to testing within OpenEMR this weekend.  I am concerned about the checkbox groups particularly.  I know how to work with them better in Perl than PHP.

I will also look at fixing the processing of data, particularly empty fields in the save.php file.

you can run the script at the command line with no arguments to get a help printout.  It will also generate a sample data file ‘sample.txt’ to work with.

try:

perl formscript.pl

markleeds wrote on Friday, April 15, 2005:

I cannot download script from my site for some reason.

Maybe security to prevent downloading of .pl files?

Try this instead:

http://drleeds.com/files/formscript.tar.gz

and you will have to extract first.

mark

markleeds wrote on Sunday, April 17, 2005:

There are a few minor bugs to work out and I should have no problem implementing the other features requested here.  Much of it is just putting a little preprocessing of POST variables in the save.php file.

Mark