Custom good looking forms (hard-coded form registry)

Hello!

I am a clinical psychologist configuring openEMR for my independent mental health practice.

My practice workflow essentially uses a single form, which is a souped up version of a SOAP note. As such, I’d like to create a custom form that looks pretty. LBF is a bit cumbersome to use and ends up not looking too nice.

I saw this post on a topic from 2022 which mentions “doing the hard-coded forms like in the form registry.”

https://community.open-emr.org/t/creation-of-forms/17659/2

Can someone point me in the right direction to learn how to do this for myself? Searching the wiki/forum hasn’t proven fruitful.

Thank you!

There is no real documentation on creating a hard coded form. I put this link up here because this is how most people learn to create a hard coded form. The link is to a simple hard coded form. You can do anything design wise with a hard coded form. The directory structure is what you will have to adhere strictly to for it to work in the program. Below is if you want to get fancy. You can do the twig template thing and have a better code organized form. Both styles work. It just depends on how big a coder you are. I would suggest that you create an HTML of your form first. That will be your foundation. Figure out what intelligence you want your form to have aka Java Scripting for dynamic stuff (this is vary fancy foot work). Then think about what data you want to pull from other parts of the system into your form. This should get you on your way to building a nice looking form in the UI.

You can tell Grok, ChatGPT, or Gemini:
I need this OpenEMR form to be more elegant. You can use Bootstrap, JavaScript, and Twuig.

Thank you for the references gentlemen!

So to be clear, I can just add a new directory with the name of my custom form into the /forms directory? And then make sure it matches the structure of the above examples?

My plan was always to use chatgpt to help me with the coding part.

Is there any way to share whatever I create with the community so others can use it if needed? There are a lot of past posts from mental health folks trying to get OPENEMR to work for them.

So with chatGPT’s help I was able to fully hard-code the custom form with all the bells and whistles I wanted.

Since there’s so many out-of-date posts on the forum from mental health practitioners asking about using openEMR, I think it would be helpful if I could make my work accessible to other people who might want it.

Is there any place/way to do that?

For now, if anyone in the future sees this and wants the form, DM me or shoot me an email and I can send the files to you manually (in the meantime i’m also working to add it to a github repository)

2 Likes

Submit PR to add to our contrib forms or maybe a module where new form may be added over time.

Sorry, sir, I’m new to the forum/openEMr world. What does submit PR mean?

hi ben. PR stands for ‘pull request’ and is a way of asking for code you’ve written to be included in the release of openemr, so others can use it - just as you’ve suggested. You submit the PR from your github fork of openemr.

there’s a great document ‘Git for dummies’ that guides one through how to do this. Git for dummies - OpenEMR Project Wiki

Thank you for the direction!

I’ve since gotten my own github fork set up and added my own form to it. Anyone who stumbles upon this thread and wants to use it can find that here:

1 Like

Turns out I had spoken way too soon (and have since learned a lot about thoroughly testing before making changes). The form I made looked nice, but was non functional. Here’s an updated link to my github repository that contains the now actually working and better named “Psychotherapy Note”:

1 Like