Not getting scanned notes to work

@toddmleleux @vicron
First on xampp I use a virtual host file but you can also add where ever your host config is at. On xampp you can access in control panel apache->config
Add

<Directory "/xampp/htdocs/openemr/sites/*/documents/*/encounters">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

Change path if needed!

I modernized the form and fix things like

  • After Save new image not showing on a new scanned note. Formid was being reset.
  • Fixed Delete to do a graceful exit and reload encounter to show current forms.
  • Modified Back to reload encounter to show newly saved forms.
  • Completely restyled to use bootstrap 4 plus center image in view.

Iā€™ve attached new.php for those whom want to test. Remember to backup old first as Iā€™ve not fully tested but existing form data and images should be fine.
Let me know. Once you test Iā€™ll put up PR for it.
BTW: I have a webcam capture script I wrote a couple years ago for a telehealth example. If anyone wants to sponsor me to add email me. Iā€™ve already spent too much time on this but I got interested!:slight_smile:

Thanks Jerry.

So far I have did some initial tests and working great. Much appreciated.

Just hoping we can get a sponsor to the upload from scanner and webcam.

Thanks.

I got it working.

My permission issues were solved w adding the edits to my vhost as below

<Directory ā€œ/xampp/htdocs/openemr/sites//documents//encountersā€>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted

Todd

@toddmleleux @vicron
Merry Christmas:
Iā€™ve not fully tested but seems to work okay. Give a try but backup first. If missing a webcam then capture form is hidden. You can do picture in picture. Let me know.
Removed New for latest

Upload or Capture both allows preview before save.


@vicron

Hi Guys, I decided to go ahead and donate my time for this contribution. It appears this form is important to some of our users. Please let me know soon how it is working.

I also think that I may just create a new encounter form from this newly enhanced scanned notes.
By doing so I could add new columns for images/paths to the table and stop the file system management and having to have file names with embedded parametersā€¦

latest attached

Re:

  • Let me know if the images dimensions are okay. Webcam can be popped out.
  • I also added a test for both ImageMagick command line and/or extension is available.
  • Remember command line requires exec to be allowed in php.ini and in path.
  • I added a feature that if exec magick fails for an image save or is not installed, the app will go ahead and save the image as previewed. Modern scanners generally create higher density images so ImageMagick may not even be needed.
  • Currently for Delete user needs to be super admin. Should this be relaxed?

Removed sjp

Hi Jerry

Happy Holidays and I must thank you for the hard work.
I tried to test the new script but apparently the script is not detecting my webcam on the client machine. So there is no capture button being displayed. I not sure what it is I am missing. My webcam is working and works with all other apps like xoom, whatsapp etc.

What browser? Is it same computer form is run from i.e. or network camera?
I only tested on FF.
Iā€™m trying to only use native navigator.mediaDevices.getUserMedia({video: true}
I may have to use a library for webcam management and search for installed camera.

@vicron looks like I sent wrong file. give me a little time for a new app.

I have tested it on both Firefox and Edge.
My client machine is different from the server. The webcam is on the client machine.

Again I appreciate what you are doing and giving up your time for the good of all. I am not a programmer but I can navigate around code to a certain extent so once I can contribute I will.

Make sure you allow camera from browser when asked.
Looks like it works on all browsers however if any other browser or app is using camera then it wonā€™t work.
I have to reengineer and get back to ya but should work if only active on one browser or app(zoomā€¦).

I am getting this error. I just blocked out the server address in the error message.
i dont know if its trying to access a webcam from my server and not my client machine.

I dont know if someone else can try and see if it works for them.

I am getting this error now. Even when I click the Int button I get this error.

Unexpected error: navigator.mediaDevices is undefined. Please try refreshing the page or using a different browser

Also I tried it on another laptop and its the same error.

OK I found the issue. I had to change these settings in FF in about:config

set to true media.devices.insecure.enabled and media.getusermedia.insecure.enabled

Note from the internet :slight_smile:

getUserMedia() is a powerful feature that can only be used in secure contexts; in insecure contexts, navigator.mediaDevices is undefined, preventing access to getUserMedia(). A secure context is, in short, a page loaded using HTTPS or the file:/// URL scheme, or a page loaded from localhost.

Use https and not http if it is the case. Anyway Iā€™m tired and quitting for the night.
Make comments if you think we need changes.
Night!

Hi Jerry Thanks so much.

So far I have found this.

  1. The webcam is enabled as you enter the form. Its kinda distracting if you just want to upload a document and not use the webcam. The webcam should be enabled only when you click the capture button.

  2. You cannot attach an uploaded document and a webcam image at the same time. Only the uploaded document is saved. This is useful if you want to upload lets say a document that relates to someones swollen hand (eg) and you want to take a picture of the actual swollen hand. (just a scenario)

  3. If you have a document already uploaded and want to replace it with an image captured from the webcam it doesnt allow you to over write it or even attach the webcam image. Same scenario as above.

  4. I maybe asking too much, can we do an upload from scanner as well? This way instead of scanning and saving then uploading, you can upload to the scanned notes in one shot. (In fact this maybe also useful in the Documents form (under patient dashboard).

1 Like

Excellent work. I had made a crutch application to capture images and then import them via the miscellaneous fax/scan function of openemr. I didnā€™t have the coding knowledge to integrate my work as a module or core feature. So I really appreciate the work as it saves time and streamlines documentation. I practice in the dermatology world and images are very important.

Todd

2 Likes

For 2 and 3:

  • Only one image is allowed per note.
  • For any saved image you may capture a web frame and save or upload a new image. Whatever is shown in preview is saved. However there is a caching problem( I believe) that the recalled image is showing the previously saved image. This is a bug Iā€™ll need to solve.

For 1 and 3:

  • 1: Will add button to hide and show webcam preview default hidden.
  • 4: Thatā€™s a lot of work and could run into scanner driver issues. Sorry for now!

Thanks Jerry.

I think I speak for everyone who uses scanned notes, we appreciate all your help.

@toddmleleux @vicron
Hi Guys,
I think I have all requests fulfilled with this last version(unless need more).

  • Default webcam off.
  • New button to toggle webcam enabled or disabled.
  • New Exit button for convivence.
  • New Capture by clicking the webcam Preview image.
  • Moved Capture button to below webcam preview.
  • Better webcam state alerts.
  • Bug fix for images being cached and shown and new images not showing after save.

Let me know if this version is suitable soon so I can commit for release 7.0.3 due around Jan 19, 2025.

new.php (20.3 KB)

1 Like

ThanKs Jerry

I like the new setup. I have tested it and so far its working.
So from my end its ok to proceed.

1 Like

Sorry for delayed response

On the system i had created i used the following to get the camera to snap from forward cam and not the self cam on notpads and smartphones.

    Webcam.set({
	facingmode: "environment",
        width: 790,
        height: 550,
        image_format: 'tiff',
        tiff_quality: 100,
	constraints: {
		facingMode: 'environment'
	}

Also, It would really be helpful to allow for more than one photo per ā€˜scanned noteā€™. For instance, if somone has three skin lesions, iā€™d have to take 3 different photos and need 3 different notes. The application would need to snap images to an alblum and then save those to the encouter note. There is code that does part of this already in the system under miscellaneous fax/scan where you select which images you would want to ā€˜importā€™. Could use that function and only need to modify the image snap to alblum/gallery, and save that to the encounter (not docs) and delete the non used images excluded from the alblum selection.

Id donate for this also. I owe a donation for the invoice pdf format. So please lmk the best way to do that before the end of the year on my end. I researched and saw online for donate but the url errors 404 for https://www.open-emr.org/foundation/donate

Cheers and Happy Holidays,

Todd