Merge branch 'master' of git://github.com/openemr/openemr
[openemr.git] / contrib / forms / formmaker / README
blob09f2df5d02e6fc5a221f8a560abf5ac0fd434b8a
2 *************************************
3 *      Form Generating Script 4.0   *
4 *************************************
6 To run at the shell command line, type:
8 perl formscript.pl [filename]
10 where filename is a text file with data relating to your form.  If you run
11 without a filename argument, a sample data file will be created in the same
12 directory named 'sample.txt' that you can use to see how to create your own.
14 The first line you enter in your textfile is the name of the form.
15 In the example this is "physical_sample"
17 Basically you enter one database field item per line like this:
19 Social History::popup_menu::smoker::non-smoker
23 Social History::radio_group::smoker::non-smoker
26 where the first item is the field name, the second item is the widget type, and Nth items are values.
27 spaces within the name will convert to '_'
28 for the sql database field name.  If you use a SQL reserved word, the form generation
29 will fail and this program will notify you of the word(s) you used.
31 The '::' is the standard delimiter that I use between items.  The second item on the line
32 is the form widget type.  You can choose from: 
34 textfield
35 textarea 
36 checkbox
37 checkbox_group
38 radio_group
39 popup_menu
40 scrolling_list
41 scrolling_list_multiples
42 date
44 Putting a '+' at the beginning of the field name will let the form know that you want to
45 report negatives.  This means the following:
47 +cardiac_review::checkbox_group::chest pain::shortness of breath::palpitations
49 creates a group of checkboxes where if the user chooses the first two boxes, the database will
50 have the following line entered:
52 chest pain, shortness of breath.  Negative for palpitations.
54 The remaining items after the fieldname and the widget type  are the names for 
55 checkboxes or radio buttons or default text
56 for a textfield or text area.  You can also start a line with a '#' as the first character and this
57 will be an ignored comment line.  If you put html tags on their own lines, they will be integrated
58 into the form.  It will be most helpful to look at 'sample.txt' to see how this works.
60 By default now, the xl function which is for performing language translation is used.  To disable this feature in creating a form, use the commandline option -noxl as in:
62 ./formscript.pl --noxl sample.txt
64 The bigtable option.  This commandline option ignores anything in the template file that is not a field and creates the form layout in one tidy table.  This may look nicer.  You can rebuild the form with and without this option without breaking anything even after the form is installed and in use.
66 ./formscript.pl --bigtable sample.txt
68 Redirect option.  This option is set within the template file by defining a redirect field just like any other field.  The redirect keyword is followed by the redirect keyword again and then by the table name to submit data to.  That is followed by the database column name to save data to.  All form data will be combined into one string and submitted to this table.  Optionally, you may then list other columns and a string to submit for each as a constant.  Example:
70 redirect::redirect::CAMOS::content::category::exam::subcategory::by_dx::item::bronchitis
72 Please send feedback to drleeds@gmail.com.