Using the Signature Pad in Custom Forms Example

Hello @jerry,

I am having a problem. Once i sign the form and save it in the database, the signature doesnt show up. Please find the image below.

and the code,

<img class="signature" id="adminSignature" style="cursor:pointer;color:red;height:65px;width:auto;" 
            data-type="admin-signature" data-action="fetch_signature" alt="<?php echo xla("Click in signature"); ?>" 
            data-pid="<?php echo attr((int)$pid); ?>" data-user="<?php echo attr($user); ?>" 
            src="<?php echo $obj["signature"]?>"
            >

Thanks in advance!

Fixed!

The solution was to change the database field type from text to mediumtext.

After, i cleared my cache, signed a new form and it shows up.

I am using OpenEMR with patch [7-0-0-Patch-2.]

The signature field works great in my form, displays perfectly. The issue I have is that when you print to PDF it does not read the image into the PDF.

Is there a solution to this?

hi @J_R,

are you using it as an encounter form? If yes, it works fine in my case.

There’s one known issue when the portal templates do not show the signed signature on PDF.
That hasn’t been fixed yet.

Hi Kofi, Thanks for responding my form has a category of ‘Clinical’ and is selectable in an encounter, if that makes sense.

I fixed this and posted links here Adding Patient Portal Document Templates to OpenEMR Patient Documents - #22 by sjpadgett

1 Like

Thank you, I will upload the php files and let you know how it goes. Whilst it is a steep learning curve, I am loving OpenEMR and the community

At the risk of looking a complete numpty, I have uploaded the two php files:

download_template.php
doc_lib.php

to the /portal/lib folder I am using multi site, so I presume it is just in the root:

On the encounter pdf print view I get no signature:

Just to be clear this is the print function in the Encounter area. I created an LBF just for the signature.

I also note that when you delete a ‘Clinical’ form here it does not clear the ‘lbf_data’ table and will leave a lot of orphaned records, potentially.

The patch was for portal and not anything dealing with encounters. I really don’t want to support this feature but I put it in LBF so I may look into.
I need your exact workflow.
As for encounter forms when adding the signature tag I use for image, that was never meant by me to be fully supported and I showed how to do because several folks requested it.

I’m not trying to be an a*# I simply haven’t time to address currently. I had hoped that others( those able of course) would do some follow up development on many of the feature I develop for OpenEMR.

So, that’s enough rant by me JR!:wink:
I’ll see what I can do for the LBF at least. Just make it easy for me, an ABC, to follow the workflow you’re seeking.

Thank you. Ranting is fine. I am a delphi developer and have literally no experience of php. Maybe later… I will do a workflow and post asap.

1 Like

Essentially it is very simple.(They all say this!).

We need to send various pre-op, consent and assessment reports to different hospitals, independent consultants by email.

Therefore, the LBF forms seem to be the way with the signature fields of user or patient. Printing them to pdf with the signature is critical. This is the only bit that fails.

OpenEMR with patch [7-0-0-Patch-2.]
Linux emr 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64
PHP Version 8.1.2-1ubuntu2.9

1 Like

Alright @J_R ,

looks like you used LBF for creating your form.

So as Jerry said, it’s a bug he has fixed but the fix doesnt work for me.

How complicated and involving is your form?

Maybe i can help you create a php encounter form.

Hi Kofi,

That is a very kind offer. Jerry is going to try and have a look at this at some point, I fully get that he is overloaded with demand.

I have no idea how PHP Encounter forms work. I have no experience of using PHP, just Delphi (Pascal).

Our ‘Clinic’ is virtual, we hire rooms for consults, treatment, dressings etc in different hospitals/clinics and we employ independent anaesthetists and clinicians. So using OpenEMR in the cloud and having no paper is essential. We want to be able to store all the data in one place and email, reports, , consents etc, with signatures as PDF’s.

Eventually I would like to do the reverse read PDF’s into OpenEMR… but I am getting ahead of myself.

If you are willing to give me some guidance on creating a simple PHP Encounter form with with patient name, DOB, and a simple consent. It would help me get going. I am prepared to learn PHP, but it is going to take some time.

This is simplified idea for the form, It is a big task. Any help, guidance you can give me would be much appreciated. Having the ability to do this within LBF forms would be amazing and allow people to do this sort of form without PHP skills.

CONSENT FOR (Procedure)

( First Name ) ( Surname ) DOB:

I consent to (Surgeon) as my surgeon and such associates, technical assistants and other health care providers as they deem necessary, to carry out the following surgery:

(Procedure) under (Anaesthetic Type )as a (Admission Type)

I have explained the procedure to the patient, in particular, I have explained: The intended benefits:
(Free Type)

The significant, unavoidable or frequently occurring risks:
(Free Type)

I confirm that I have been informed of the risks and side-effects associated with my planned surgical procedure(s) (Patient Initial)

I understand that (Surgeon) will strive to give me my desired result however cannot guarantee this outcome. (Patient Initial)

I understand and agree that any other procedure or the use of blood products will only be used in a medical emergency or to save my life. (Patient Initial)

I understand that complications can arise from my surgery and the need for further surgery/revision.
(Patient Initial)

General anaesthesia should be avoided during pregnancy, whenever possible. I hereby state that I am not pregnant and accept the responsibility for making this determination.
(Patient Initial)

I confirm that I have informed , (Surgeon) of my full medical and psychological history and understand that withholding any such information could cause risk or complications during or after your surgery.
(Patient Initial)

I confirm that following my surgery I have arranged for somebody to collect and accompany me to my next destination and that someone will remain with me overnight. (Patient Initial)

I confirm that neither myself or anybody I have had direct contact with within the past 14 days has had COVID19. (Patient Initial)

I confirm that I have this consent form has been fully explained to me and confirm that I fully understand its content. (Patient Initial)

PLEASE DO NOT SIGN THIS FORM UNLESS YOU HAVE READ IT AND FEEL THAT YOU UNDERSTAND IT.

(Patients Name)

(Date)
(Patients Signature)

I hereby certify that I have discussed all the above with the patient. I have offered to answer any questions regarding the procedure and believe the patient fully understands the information provided.

(Surgeon Signature)
(Surgeon) (Date)

Alright @J_R ,

you’re welcome.

Will get back to you hopefully by tomorrow.

@J_R
I’m going to have a look at the LBF print today but be aware of the new questionnaire/assessment feature started in patch 2. I’d bet many forms to meet your requirement could be designed using the questionnaire form builder or could already be available as LOINC panels.

@kkappiah
For using signature in custom encounter forms as you know you need to handle the image disposal.
Same goes for reporting in custom patient report or however you want to print.
You could probably track this down and put up a PR where I’ll help get into core.

1 Like

Thank you Jerry. I will have a look the patch 2 features. I really appreciate you take time on this.

1 Like

This works for me! Have you tried on one of our demos?
I’m using LBF for signature then the LBF form Print. Am I missing something?
PDF after download

I don’t know what to say! It is not working for me! I can try the demos! I will now.

It works on the demo. Now what do I do? But not on my system. I have just checked the Version.php and it is $v_major = ‘7’;
$v_minor = ‘0’;
$v_patch = ‘0’;
$v_tag = ‘’; // minor revision number, should be empty for production releases

// A real patch identifier. This is incremented when we release a patch for a
// production release. Note the above $v_patch variable is a misnomer and actually
// stores release version information.
$v_realpatch = ‘2’;

Do an About page. I assume you’ve been running sql_upgrade!

btw your signature should be blue if my changes took effect