Xml Formgen Problem

arnabnaha wrote on Sunday, February 27, 2011:

Hello!
Facing a problem with xml formgen…After creating a xml file when i install the form, everything works fine and the form is installed flawlessly, but when navigating to the encounters and clicking on the form name from the category, there is no form. The categories are there but only the form is not present…other forms work well. only form created with xml formgen donot work. please help…why doesnot it show even after a proper installation?

arnabnaha wrote on Sunday, February 27, 2011:

The php error log is as follows:

Sun Feb 27 13:45:41 2011]  Parent: Created child process 2660
  Digest: generating secret for digest authentication …
  Digest: done
  Child 2660: Child process is running
  Child 2660: Acquired the start mutex.
  Child 2660: Starting 250 worker threads.
  Child 2660: Starting thread to listen on port 443.
  Child 2660: Starting thread to listen on port 80.
   Session site ID has been set to ‘default’
   Session site ID has been set to ‘default’
   Session site ID has been set to ‘default’, referer: http://localhost/openemr/interface/login/login.php
   PHP Parse error:  parse error, expecting `’)’’ in C:\\xampp\\htdocs\\openemr\\interface\\forms\\surgery_notes\\new.php on line 46, referer: http://localhost/openemr/interface/patient_file/encounter/forms.php
   PHP Parse error:  parse error, expecting `’)’’ in C:\\xampp\\htdocs\\openemr\\interface\\forms\\surgery_notes\\new.php on line 46, referer: http://localhost/openemr/interface/patient_file/encounter/load_form.php?formname=communication_log

arnabnaha wrote on Sunday, February 27, 2011:

Surgery Notes is the name of the form I created.

penguin8r wrote on Wednesday, March 02, 2011:

It sounds like exactly what it’s telling you in the PHP error log, there’s a syntax error in new.php.  On line 46 you have an unclosed set of parentheses.
You might want to try looking at your new.php file with a code editing program that has syntax highlighting built in to help you see where the problem is.
Alternately, post your new.php file here if it’s not too large & maybe someone can take a look at it.
Should be a relatively simple fix, but there will probably be corresponding errors in the other .php files for the form.

vpsubramanian wrote on Thursday, March 03, 2011:

I am having problem at a earlier stage than you. I followed Dr. Arnab Naha’s instruction to install xmlformgen in my Vista macjhine as follows: To run xml form generator on windows, the following steps are to be followed: 1. First install the “make” package from sourceforge -  2. Install the make package (The downloaded file is an .exe file) 3. Install cygwin for windows -  4. While installing cygwin, first install it with the default packages available. 5. After completion of installation, run the cygwin setup again and install the “make” files from the “devel” category and “util” category. 6. Also install the “libxml2” and “libxslt” packages from the “lib” category during setup. 7. Let the cygwin install on its own. 8. After complete installation of cygwin, run cygwin by double clicking the desktop icon. 9. A command prompt like window appears. 10. cd into the openemr directory where xml formgen is. ( for example: cd c:/xampp/htdocs/openemr/contrib/forms/xmlformgen). Please mind the backslashes. They are important. 11. After moving to the xml formgen directory, please type the following command:
make INFILE=communication_log.xml.   But when I type command I get  "bash: make: command not found. So I am stuck at this point. Appreciate any help. TIA

bradymiller wrote on Thursday, March 03, 2011:

arnabnaha,
To debug this, would be helpful if you could push the collection of form files and your original xml file to your github repo (on a separate branch in either the contrib dir or interface/forms dir is fine). If don’t know how to do this, then can send me a zipped up package of all these files and I’ll put it i my repo. Then we can test it on linux and also compare it when the form is created on linux, which should help us get rid of windows specific bugs.
-brady

arnabnaha wrote on Friday, March 04, 2011:

vpsubramaniun,
Please run the setup of cygwin again. Follow the onscreen instructions and when you reach the select package page, please select the “make” packages from “Devel”, “Util” categories and select “libxml2” and “libxslt” from the “Lib” categories. These are the dependencies which must be installed for xml formgen to function. Then follow the instruction as given in the wiki.

Thank you,
Dr. Arnab Naha

arnabnaha wrote on Friday, March 04, 2011:

Thanks Brady and penguin8r,

Brady, I have mailed you the zipped files of the form folder called " Surgery_Notes" and the xml file of the same. Please checkif its ok???

Thanks
Dr. Arnab Naha

julialongtin wrote on Friday, March 04, 2011:

Sorry that I have not been able to reply to this… I’ve been quite busy.

Could you post the XML file you’re using to one of the pastebin type sites, so that we could all take a look at it?

Thanks,

Julia Longtin

bradymiller wrote on Friday, March 04, 2011:

hey,

Github is also an efficient way to debug this stuff. Placed arnabnaha’s form here:
http://github.com/bradymiller/openemr/tree/xmlformgenerator_debug

Details of commit are:
1. Original xml is contrib/forms/xmlformgen/surgery_post.xml
2. Windows forms are at contrib/forms/xmlformgen/surgery_notes_windows/
3. For comparison, Linux forms were created by myself at:
   contrib/forms/xmlformgen/surgery_notes_linux/

Initial worry is that windows and linux create different form files. However, a diff of both surgery_notes_windows and surgery_notes_linux show no differences which is good news.

When I tried the form I also got following in log:

PHP Parse error:  syntax error, unexpected T_STRING in /var/www/openemr/interface/forms/surgery_notes/new.php on line 183

Line 183 of /var/www/openemr/interface/forms/surgery_notes/new.php is:

<span class="fieldlabel"><?php xl('Today's Date','e'); ?> (yyyy-mm-dd): </span>

So the bug is that the apostrophe in Today’s Date is not being escaped (ie. needs a ‘’ in front of it).

Julia, will need to make sure apostrophes get escaped in all labels to avoid this bug.

-brady

arnabnaha wrote on Sunday, March 13, 2011:

Any updates on the debugging of xml formgen in windows brady??

bradymiller wrote on Sunday, March 13, 2011:

hi,

My debugging is done (see above). The apostrophe in Today’s Date label breaks your script. Julie should consider a mechanism to escape these labels.

Alternatively, a poor man work-around would be for you to make the label in your xml file to:

Today\'s Date

-brady

arnabnaha wrote on Sunday, March 13, 2011:

Hi Brady…
Thanks a lot…removes the apostrophies and it works smooth…

vpsubramanian wrote on Saturday, March 19, 2011:

To Arnabnaha

I have downlowed  ‘make’ package from devel category but can’t find make package in util category. I don’t know why. Do You think I should try a different mirror site.  I went to Uidaho site and then I tried 3 more sites. Still I can’t find Util category make package in any of these sites. I think this may be the problem

vpsubramanian wrote on Thursday, March 24, 2011:

Hello
I have downloaded all dependancy packages suggested. Still when I run the make program for the communication_log.xml, I get error message /usr/bin/xalan: command not found.  When i check the directory /usr/bin I do not find xalan file there. Where do I get this command file. Any help will be greatly appreciated.

TIA