Image Canvas Does Not Save in LBF

I created a Layout Based Form that uses the Image Canvas. The functionality allows me to place an image in the Image Canvas and draw on the image, which is great.

I can bring the form up and draw on it in the Encounter, which is expected.

When I click Save, a warning pops up (This page is asking you to confirm that you want to leave - data you have entered may not be saved).
image

If I choose to continue (Leave Page), the next page shows the form text, but does not capture the image.
image

And the print out does not capture the image either.

Any thoughts on what I could do to capture the image when saving the form?

-Erik

Hi @sunsetsystems,

Can you tell me if I am implementing the Image Capture functionality correctly on the LBF? I would like to capture the image after I draw on it, but don’t see it after I attempt to save it.

-Erik

Save should not cause that error. Sounds like some javascript on that page is broken.

Suggestion: Try it with a layout that just has your image canvas on it and nothing else, and see if you still get the stay-or-leave message. If not, add the other fields one at a time until the message occurs. That will help to narrow it down.

Also which OpenEMR version is this?

Thanks Rod @sunsetsystems,

Thanks for suggesting starting simple. Makes sense.

I am using v5.0.1 (6)

I did a bit of troubleshooting. Here’s what I found. If there is an image included it gives me this error.

I tried it with a few different size images, just to make sure.
image
image
image
image

Then I removed the image from the form.

I then drew on the blank Image Canvas and saved it, but nothing showed up.

I will do some more digging, but if you have some additional suggestion I am listening.

-Erik

Perhaps the image is too big for your php.ini settings. Check post_max_size and upload_max_filesize in whatever php.ini file your web server is using. After fixing these be sure to restart the web server.

Hi Rod @sunsetsystems,

I updated the php.ini but I still got the same error.
image

So I went through the Apache error.log I saw the error ModSecurity: Request body no files data length is larger than the configured limit. When I increased the size of SecRequestBodyLimit and SecRequestBodyNoFilesLimit in the modsecurity.conf, the layout that has just the Image Canvas, now works!
image

Thanks for the help with this.

When I go back and use the layout I first created, I get the same error as before.
image

As you suggested, I am now going to add the fields one at a time. Let me know if you have any additional suggestions on where I might look. Thanks for your help.

-Erik

Rod @sunsetsystems,

Here is what I found. A combination of the following produces the error for me:

  • UOR = Required
  • Data Type = Radio Button
  • List = yesno

If I set the UOR = Optional, the error goes away.

If you have any thoughts on how I might solve this so I can Require the Radio Button Data Type, let me know.

-Erik