Not getting scanned notes to work

windows server 2019
xampp
open emr 7.0.2 patch 3

Since I have been using openemr I have never gotten scanned notes to work. I have searched the forum and google but nothing to avail. I keep getting this message

ERROR: The following variable contains invalid characters: 0

note : I have disabled logging.

Any help will be appreciated.

Topic edited by @sjpadgett 12/27/24 to give download link to newly fixed form see: Not getting scanned notes to work - #39 by sjpadgett

Also, can you clarify what you mean by “scanned notes”? Attach a screenshot of what you’re trying to do.

Can you get us specific logs from the php error logs?

It would give us an indication of the actual problem.

Hi Kofi.

I am referring to the scanned notes form.
When I enabled it and try to access it I am getting the error

ERROR: The following variable contains invalid characters: 0

I have seen other posts that the scanned notes form doesn’t work properly under windows. So I was wondering if there is something I am doing wrong or there is a fix.

It may very well be an issue specific to Windows/XAMPP, I’ve never heard of a problem with this form on a correctly provisioned Linux server. It may be there is a potential resolution, but there won’t be any way to gather information or debug without some kind of error logging in place to find out exactly what part of the form itself is throwing the error message that you’re seeing in the UI. Suggest enabling error logging, even if only temporarily , to get some insight into what’s going on behind your browser.

Thanks for your reply. I will enable logging temporarily and post the results.

These are the errors from the log file that I am getting for different patient and different encounters when trying to use scanned notes

[Fri Dec 13 11:13:59.699472 2024] [php:notice] [pid 4672:tid 1960] [client 1xx.1xx.45.2xx:64306] ERROR: The following variable contains invalid characters:0, referer: http://xxx.xxx.net//interface/patient_file/encounter/encounter_top.php?set_encounter=20

[Fri Dec 13 11:15:40.314240 2024] [php:notice] [pid 4672:tid 1960] [client 1xx.1xx.45.2xx:20397] ERROR: The following variable contains invalid characters:0, referer: http://xxx.xxx.net/interface/patient_file/encounter/encounter_top.php?set_encounter=2

Just an update. I have been doing some more research apparently the scanned notes form works under linux. In windows there is a problem and the scripting needs rework. There was a reworked script many years ago but I cant seem to find it.

It’d be nice if when asking for help to give enough information like asked by Kofi. I have no clue what scanned notes form is or how to enable and use. I have in the past done some work with Hylafax Support.
If I can get a more detailed report on how to reproduce, I’ll take a quick look at.

Hi Jerry.

If you look in the /contrib/forms/ folder there is the scanned_notes folder with the scanned notes files.

If you copy those files to /interface/forms/ folder you will then be able to install db and enable it (from admin - forms-forms administration). You will then see it available as scanned notes in a patient encounter.

I hope this helps.

Okay @vicron I was able to setup. The issue from form not loading is due to a sanitize of formid with value ‘0’ fails on windows. Any other numeric works so just a weird issue with windows I guess.

Use below file library/sanitize.inc.php which will at least allow form to load.
sanitize.inc.php (7.3 KB)

1 Like

HI Jerry.

Thanks a lot. The form is loading. I am getting a different error now

convert -density 96

when trying to upload a document. I will will do further investigations and report back.
I appreciate your help.

1 Like

Had to modify line 83 in new.php from

$cmd = "convert -density 96 " . escapeshellarg($tmp_name) . " " . escapeshellarg($imagepath);

to

$cmd = "magick -density 96 " . escapeshellarg($tmp_name) . " " . escapeshellarg($imagepath);

Apparently in version 7 of imagemagick you need to include the magick statement for it to run properly.

Now its uploading the file and converting it. Now the image is not showing up in the encounter just an image placeholder.

Will update as soon as I figure it out.

1 Like

Now I am seeing the image in the encounter. Had to modify the http-vhosts :

<Directory  " XXXXX/htdocs/xxxxx">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>
1 Like

This is good work and the closest I have come to using this. I am on Ubuntu and can scan in but the images just still display icons. I tried the vhost edit to all my directories but I still get a permission denied when I try to manually right click and load or open that image in a new window.

Can you expound on how you configured the vhost and which directory.

Todd

Furthermore,

If I use the download pdf in reports section of the dashboard it works.
In same location if i click generate report, the images are broken and only exist as icons with permission denied issues.

Todd

Hey guys,
What is file type of scanned documents? jpg, tiff etc

In the end I’ll put up a PR to get these changes in master for next release.

I have been working this form with mixed results. It certainly has issues including allowing to upload new note though one is already residing in form. So I will hide upload if edit.
So initial restyle is attached. What I need from everyone is to describe what is needed and/or required for this feature such as edit existing note and so forth.
I’ll try to get this form as the most useful according to your needs.
First up is ensuring ability to display image.

I tried it with jpg and pdf. For it to work with pdf I had to install ghostscript. But it converts the pdf to jpg so it can be displayed in the encounter.

You know what will be great, if we can have a button to scan straight from a twain scanner or get a pic from a webcam.

Hi Todd.

I am using xampp in windows so the vhost file is in xampp\apache\conf\extra
It may different in ubuntu. Maybe someone with ubuntu experience could point Todd in the right direction.

Hi Todd

I think you need to modify the file
/etc/apache2/sites-available/000-default.conf

under virtual hosts section