OpenEMR Formscript Form Creation Tool
From OpenEMR Project Wiki
Form Tool is the tool created by Mark Leeds to assist creation of html forms for OpenEMR. The script does require you to have PERL working on your system. It is now included with OpenEMR, and the most recent version of script can be found in openemr directory at /openemr/contrib/forms/formmaker/formscript.pl .
First, change it to an executable program. In linux:
shell> chmod +x formscript.pl
The Form Tool now has its own updated documentation on use, for further information, run formscript.pl at the command line without any arguments after it. For example: ./formscript.pl or perl formscript.pl. This will display the documentation and create a file named sample.txt if it does not already exist. Look at this sample file to see how to create a template file to create a form. You can start with this file and alter it. Create your form by executing with the template file name: ./formscript.pl sample.txt (or whatever your template file is named). Save this template file for later use. You will need it to apply changes to your form or updates to formscript.pl in the future. As long as you do not alter the field data, you can do this. Copy your newly created form directory to /openemr/interface/forms/ and go into OpenEMR to register the form.
The quick, dirty way to generate a form is as follows:
- 1. Write out your field names one per line, with headers or group names as desired.
- 2. After each of the fields place a double colon "::"
- 3. Put the variable type for each, choosing from the following list:
- 4. After this place a second double colon after fields that require names for the variable choices (everything excluding textfield, textarea, checkbox). Now put all the variable options in a list seperated by "::".
- 5. Now save your file and run #formscript.pl [filename]