Is anyone working on FreeBSD port for OpenEMR?

Hello:

I learned about OpenEMR when I was on the FreeBSD website reading the porter’s handbook. There was a list of requested applications for which a FreeBSD port currently does not exist, and OpenEMR was on that list. I said, “what is that?” and discovered OpenEMR…

I am currently a practicing optometrist in rural NW Missouri, USA and I am evaluating whether OpenEMR would / could be a viable replacement for our current EHR (Revolution EHR). Optometry is my 2nd career – prior to this I had 12 years experience working as a software engineer. My first job was working with Medical Manger software, after that, I had data warehouse experience at Sprint PCS. The first versions of Linux were posted when I was a college student, and I’ve used FreeBSD for one reason or another at least since FreeBSD version ~6. Furthermore, my brother may or may not be a FreeBSD developer with 30 years experience…

I have Open EMR running successfully on my FreeBSD 14.0BETA4 box with Apache 2.4 ; MariaDB 10.11 ; php 8.2, and before I started working on making a FreeBSD port for OpenEMR, I thought I’d reach out to ensure I’m not duplicating efforts, etc…

hi @DrBassmanOD , neat background, thanks for sharing.

There used to be a debian package but OpenEMR is now either installed as you have done or run as a docker.

@gutiersa do you still run OpenEMR on your BSD machine? You may be interested in connecting with @DrBassmanOD

2 Likes

I took some time today to try the docker method – it is much easier than trying to make sure I have all the correct software installed, etc. The only drawback is docker doesn’t run on FreeBSD – it is possible to run OpenEMR in a docker which is running on a linux VM inside of FreeBSD as I discovered.

In the process, I think I’ve verified a bug in OpenEMR…

  1. login to OpenEMR
  2. hover on the current user icon in the upper right corner → MFA Management.
  3. click the Add new… → TOTP Key
  4. type the password and press the <ENTER> key on your keyboard.
  5. Enjoy the blank screen… (this is the bug)

Repeat all the above steps, only after typing your password, use the mouse to click the <Submit> button, and NOW you see the QR code to set up your authenticator…

This bug was DRIVING ME CRAZY when I was trying to install everything by hand on my FreeBSD box. I could replicate the same behavior on my Windows 10 box under XAMPP.
The behavior is the same when running in docker.

How do I report this?

Can also see if you can replicate the error on one of the demos.

Yes. I just verified the demo behaves the same way, even from my iPhone.

hi @DrBassmanOD, what browser?

can’t reproduce it with firefox or chrome

1 Like

I have replicated this with multiple browsers: Firefox, Edge, Safari, Vivaldi. I do not run Chrome. Multiple operating systems: FreeBSD, Linux, Windows, MacOS, iPhone

Are you pressing <tab> AFTER you type your password and BEFORE you hit <ENTER>? It does not work if you leave the cursor in the password field and hit your <ENTER> button. It DOES work if you tab to the “SUBMIT” button and then hit your <ENTER> button.

i’ve replicated it as well: firefox on opensuse linux - running with docker - latest development files 7.0.2-dev. clicking ‘submit’ works ok - and in this case i happened to have typed in the wrong password.

1 Like

I see where the problem is in the code…I’m not ‘up to speed enough’ with git and the OpenEMR development environment to submit a CR…

In the file interface/usergroup/mfa_totp.php it creates that form:

  • On line 99, the <form> is set for onsubmit=‘return top.restoreSession()’ (this is what happens when you press<Enter>)

  • On line 129, the Submit <button> is set with onclick=“doregister(‘reg2’)”

Thus, when you press <Enter> the behavior is different from when you click the button.

Also, there is no closing </FORM> tag for that form…

I will see if, later today, I can get up to speed and submit my first CR…

1 Like

For this simple change, you could do following:

  1. On your site, change line 99 of mfa_totp.php onsubmit to match submit click - doregister(‘reg2’).
    Since doregister calls restoreSession before dom submit, this will sync event actions.
  2. If it works, create github account.
  3. Fork the project repository
  4. From branch dropdown, create a new branch
  5. Edit mfa_totp.php line 99 and save.
  6. Follow PR prompts and submit.

think you have to leave that line alone since it has to monitore the different actions with reg1 and reg2

how about adding a keypress eventlistener to the password input?

Turns out you remove the “type=button” from the Submit button, you also remove the onclick="" from the submit button. This turns that button into the Submit for the form, you then put the function call that was in the onclick="" part of the button – move that up to line 99 for the onsubmit="", and that fixes everything…

I think I’ve opened a Pull Request #6916. (first time). Can someone let me know if I did it correctly?