Problems Creating Custom Forms

(Acs5071) #1


I am a developer for a small medical practice that uses OpenEMR version 5.0.1 patch 7 and am trying to create a custom form. I found the following links:

I tried following the steps for the LBV Forms and the Nation Notes instructions and found that the instructions did not match up with the the current layout of the portal. Both pages say to go to Administration -> Lists -> Edit Lists -> Layout-Based Visit Forms, but “Edit Lists” is not an option under Administration -> Lists. Is there an updated instruction set for these pages?

I also ran into issues with the XML and Perl form creation tools. When I tried to run ./ sample.txt I get the following error
Can’t locate in @INC (you may need to install the CGI module) (@INC contains: /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at ./ line 6.
BEGIN failed–compilation aborted at ./ line 6.
I tried installing by running perl -e shell -MCPAN then install CGI, but the installation failed because make is missing from the docker container.

I ran into a similar issue trying to follow the tutorial for the XML Form Gen, getting the error sh: make: not found. I tried running sudo apt-get install build-essential, but the command was not found. What should I do to get make into the docker container so I can use one of these tools?

Thank you for your help!

(MD Support) #2

Looks like the documentation is lagging. Previously you had to manually create an entry in that list. Now go to Admin -> Layouts and add a new layout.

(Brady Miller) #3

hi @acs5071 ,

I just tried xmlformgen on the 5.0.2 dev docker and worked:

cd /var/www/localhost/htdocs/openemr/contrib/forms/xmlformgen
make INFILE=communication_log.xml

mkdir communication_log
/usr/bin/xsltproc  xslt/info.txt.xslt  communication_log.xml > communication_log/info.txt
/usr/bin/xsltproc  xslt/table.sql.xslt  communication_log.xml > communication_log/table.sql
/usr/bin/xsltproc  xslt/style.css.xslt  communication_log.xml > communication_log/style.css
/usr/bin/xsltproc  xslt/new.php.xslt  communication_log.xml > communication_log/new.php
/usr/bin/xsltproc  xslt/print.php.xslt  communication_log.xml > communication_log/print.php
/usr/bin/xsltproc  xslt/report.php.xslt  communication_log.xml > communication_log/report.php
/usr/bin/xsltproc  xslt/view.php.xslt  communication_log.xml > communication_log/view.php
/usr/bin/xsltproc  xslt/save.php.xslt  communication_log.xml > communication_log/save.php
/usr/bin/xsltproc  xslt/show.php.xslt  communication_log.xml > communication_log/show.php

There should not be much difference between the 5.0.2 dev docker and the 5.0.1 docker (I’ll test out 5.0.1 docker if below doesn’t work for you).

Note you need to run these commands within the docker. Are you sure you are logging into your 5.0.1 docker via a command like below before running the commands:

docker exec -it <the-docker-name> sh

(Acs5071) #4

docker exec -it <docker-name> sh is the exact command I use to access the docker container. In the container, I have run which make, which returns nothing, and make --version which returns “sh: make: not found”. I’ve also navigated to /usr/bin and make is not there. The two commands work outside of the docker container when I am ssh’d into the server and I found make in /usr/bin. I decided to try copying make into the container with docker cp /usr/bin/make <docker-name>:/usr/bin/make. After doing this which make returned “/usr/bin/make”, but make --version still returned “sh: make: not found”. I have been doing all of this on our test server, but our production server is missing make as well.

(Brady Miller) #5

hi @acs5071 ,

I just tested this in the 5.0.1 docker and confirmed your issue. Within the docker, enter the following commands:

apk update
apk add build-base

Then should be able to build the xml forms:

cd /var/www/localhost/htdocs/openemr/contrib/forms/xmlformgen
make INFILE=communication_log.xml


(Acs5071) #6

Thank you so much for your help Brady! I got it working. One more question: if I use the xmlformgen, will it stay in my openemr after an update is installed?

(Brady Miller) #7

Hi @acs5071 ,
The database changes will stay, but you will need to add back the code to interface/forms/<dir-with-your-form> after you do an upgrade.