Using the Signature Pad in Custom Forms Example

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

I started with Ver 7. Anyway I have just run the script:

OpenEMR Database Upgrade

If you are unsure or were using a development version between two releases, then choose the older of possible releases.

Server Status

  • Start watching server processes for upgrade version 6.1.0
  • 12/28 16:51:56 6.1.0 COMMIT
  • 12/28 16:51:56 6.1.0 SHOW * TABLES * LIKE *
  • 12/28 16:51:56 6.1.0 INSERT * INTO * VALUES *
  • 12/28 16:51:56 6.1.0 INSERT * INTO * VALUES *
  • 12/28 16:51:56 6.1.0 SHOW * COLUMNS * FROM * LIKE *
  • 12/28 16:51:56 6.1.0 SHOW * TABLES * LIKE *
  • 12/28 16:51:56 6.1.0 SELECT * FROM * WHERE * AND * IN * SELECT * FROM * WHERE *
  • End watching server processes for upgrade version 6.1.0
  • Start watching server processes for upgrade version Patch
  • 12/28 16:51:58 Patch SELECT * FROM * LEFT * OUTER * JOIN * ON * AND * AND * WHERE * IS * NULL * OR * OR * AND * IS * NOT * NULL * AND * AND * LIMIT *
  • End watching server processes for upgrade version 6.1.0
  • Start watching server processes for upgrade version UUID
  • 12/28 16:51:58 UUID SELECT * FROM * LEFT * OUTER * JOIN * ON * AND * AND * WHERE * IS * NULL * OR * OR * AND * IS * NOT * NULL * AND * AND * LIMIT *
  • End watching server processes for upgrade version UUID

Processing Details

100% UUID Update

Processing 6_1_0-to-7_0_0_upgrade.sql…

Skipping section #IfNotRow2D layout_options form_id DEM field_id prevent_portal_apps

Skipping section #IfMissingColumn clinical_rules bibliographic_citation

Skipping section #IfMissingColumn clinical_rules linked_referential_cds

Skipping section #IfMissingColumn clinical_rules amc_2015_flag

Skipping section #IfMissingColumn clinical_rules amc_code_2015

Skipping section #IfMissingColumn patient_access_onsite date_created

Skipping section #IfNotRow clinical_rules id patient_access_amc

Skipping section #IfNotRow2D list_options list_id clinical_rules option_id patient_access_amc

Skipping section #IfRow2D list_options list_id lists option_id ecqm_2021_reporting

Skipping section #IfNotRow2D list_options list_id lists option_id ecqm_2022_reporting

Skipping section #IfNotRow2D list_options list_id discharge-disposition option_id home-hospice

Skipping section #IfNotRow2D list_options list_id clinical_rules option_id send_sum_2015_amc

Skipping section #IfNotRow clinical_rules id send_sum_2015_amc

Skipping section #IfNotRow2D layout_options form_id LBTref field_id billing_facility_id

Skipping section #IfMissingColumn report_itemized rule_id

Skipping section #IfMissingColumn report_itemized item_details

Skipping section #IfMissingColumn ccda transaction_id

Skipping section #IfMissingColumn form_care_plan date_end

Skipping section #IfNotColumnType insurance_companies ins_type_code int(11)

Skipping section #IfUpdateEditOptionsNeeded remove DEM C street, street_line_2, city

Start Layouts Edit Options add U update.

Setting new edit options city to [“U”]
Setting new edit options street to [“U”]
Setting new edit options street_line_2 to [“U”]

Layout Edit Options add U done.

Skipping section #IfNotRow3D layout_options form_id DEM field_id postal_code fld_length 8

Skipping section #IfNotColumnType form_observation date datetime

Skipping section #IfMissingColumn form_care_plan reason_status

Skipping section #IfNotColumnType lists begdate datetime

Skipping section #IfMissingColumn form_observation date_end

Skipping section #IfNotColumnType form_care_plan date datetime

Skipping section #IfMissingColumn api_token context

Skipping section #IfRow2D list_options list_id language notes eng

Skipping section #IfNotRow3D list_options list_id language option_id malay notes ms

Skipping section #IfMissingColumn form_encounter date_end

Skipping section #IfMissingColumn procedure_order_code date_end

Skipping section #IfNotColumnType procedure_order_code procedure_code VARCHAR(64)

Skipping section #IfNotColumnType procedure_order date_ordered DATETIME

Skipping section #IfMissingColumn immunizations reason_code

Skipping section #IfMissingColumn categories codes

Skipping section #IfMissingColumn form_vital_details reason_code

Skipping section #IfNotRow2D list_options list_id lists option_id encounter-types

Skipping section #IfNotRow2D list_options list_id immunization_refusal_reason option_id financial_problem

Skipping section #IfNotRow2D list_options list_id Plan_of_Care_Type option_id planned_medication_activity

Skipping section #IfNotRow2D list_options list_id Plan_of_Care_Type option_id medication

INSERT INTO list_options (list_id, option_id, title, seq) VALUES (‘issue_subtypes’,‘assessment’,‘Assessment’,20)
INSERT INTO list_options (list_id, option_id, title, seq) VALUES (‘issue_subtypes’,‘concern’,‘Concern’,30)

The above statement failed: Duplicate entry ‘issue_subtypes-concern’ for key 'PRIMARY’
Upgrading will continue.

Skipping section #IfNotRow2D list_options list_id Observation_Types option_id assessment

Skipping section #IfNotRow2D list_options list_id Plan_of_Care_Type option_id intervention

Skipping section #IfNotTable valueset_oid

Skipping section #IfNotRow code_types ct_key OID

INSERT INTO list_options (list_id, option_id, title, seq) VALUES (‘issue_subtypes’,‘diagnosis’,‘Diagnosis’,40)
SET @currentSQLMode = (SELECT @@sql_mode)
SET sql_mode = ‘’
UPDATE patient_data SET deceased_date = NULL WHERE deceased_date = ‘0000-00-00 00:00:00’
SET sql_mode = @currentSQLMode

Skipping section #IfMissingColumn insurance_companies cqm_sop

Skipping section #IfNotRow2D list_options list_id order_type option_id order

Skipping section #IfNotColumnType procedure_type procedure_code varchar(64)

Skipping section #IfNotRow2D categories name CCD codes LOINC:34133-9

Skipping section #IfNotRow2D list_options list_id lists option_id ccda-sections

Skipping section #IfRow3D list_options list_id immunization_refusal_reason option_id parental_decision seq 10

Skipping section #IfMissingColumn procedure_result date_end

Skipping section #IfNotRow3D layout_options form_id DEM field_id title title Title

Skipping section #IfNotRow3D layout_options form_id DEM field_id fname title Name

Skipping section #IfMissingColumn addresses district

Skipping section #IfNotTable contact

Skipping section #IfNotTable contact_address

Skipping section #IfNotRow2D list_options list_id lists option_id address-uses

Skipping section #IfNotRow2D list_options list_id lists option_id address-types

Skipping section #IfNotRow2D layout_options form_id DEM field_id additional_addresses

Skipping section #IfNotColumnType form_vitals weight DECIMAL(12,6)

Skipping section #IfNotColumnType form_vitals height DECIMAL(12,6)

Skipping section #IfNotColumnType form_vitals temperature DECIMAL(12,6)

Skipping section #IfNotColumnType form_vitals pulse DECIMAL(12,6)

Skipping section #IfNotColumnType form_vitals respiration DECIMAL(12,6)

Skipping section #IfNotColumnType form_vitals BMI DECIMAL(12,6)

Skipping section #IfNotColumnType form_vitals waist_circ DECIMAL(12,6)

Skipping section #IfNotColumnType form_vitals head_circ DECIMAL(12,6)

Skipping section #IfNotColumnType form_vitals oxygen_flow_rate DECIMAL(12,6)

Skipping section #IfNotColumnType form_vitals oxygen_saturation DECIMAL(6,2)

Skipping section #IfNotColumnType form_vitals ped_weight_height DECIMAL(6,2)

Skipping section #IfNotColumnType form_vitals ped_bmi DECIMAL(6,2)

Skipping section #IfNotColumnType form_vitals ped_head_circ DECIMAL(6,2)

Skipping section #IfNotColumnType form_vitals inhaled_oxygen_concentration DECIMAL(6,2)

Skipping section #IfNotRow2D layout_options form_id DEM field_id provider_since_date

Skipping section #IfNotIndex patient_history pid_idx

Skipping section #IfNotIndex contact_address contact_address_idx

Skipping section #IfUpdateEditOptionsNeeded add DEM J additional_addresses

Skipping section #IfUpdateEditOptionsNeeded add DEM SP additional_addresses

Skipping section #IfNotRow3D list_options list_id drug_route title IM codes NCI-CONCEPT-ID:C28161

Skipping section #IfRow2D list_options list_id drug_interval option_id WK

Skipping section #IfRow2D list_options list_id drug_interval option_id MO

Skipping section #IfNotRow2D list_options list_id drug_interval option_id 19

Skipping section #IfMissingColumn history_data created_by

Skipping section #IfMissingColumn patient_data created_by

Skipping section #IfNotColumnType patient_data regdate DATETIME

Skipping section #IfMissingColumn patient_data updated_by

Skipping section #IfMissingColumn patient_history created_by

Skipping section #IfNotColumnType prescriptions date_modified DATETIME

Skipping section #IfNotColumnType prescriptions date_added DATETIME

Skipping section #IfMissingColumn prescriptions created_by

Skipping section #IfMissingColumn prescriptions updated_by

Skipping section #IfMissingColumn module_configuration created_by

Skipping section #IfMissingColumn module_configuration updated_by

Skipping section #IfUpdateEditOptionsNeeded remove DEM K birth_fname, pubpid, name_history

Updating CPT4 Mappings
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-10', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-15-29', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-30-44', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-45-59', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-60-74', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'established-patient-10-19', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'established-patient-20-29', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'established-patient-30-39', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'established-patient-40-54', ))

Processing patch.sql…

Skipping section #IfNotColumnType prescriptions route VARCHAR(100)

Skipping section #IfNotRow4D supported_external_dataloads load_type ICD10 load_source CMS load_release_date 2022-10-01 load_filename 2023 Code Descriptions in Tabular Order.zip

Skipping section #IfNotRow4D supported_external_dataloads load_type ICD10 load_source CMS load_release_date 2022-10-01 load_filename Zip File 3 2023 ICD-10-PCS Codes File.zip

Skipping section #IfNotRow2D list_options list_id drug_route option_id bymouth

Skipping section #IfNotTable questionnaire_repository

Skipping section #IfMissingColumn questionnaire_response response_id

Skipping section #IfMissingColumn questionnaire_repository lform

Skipping section #IfMissingColumn registry form_foreign_id

Skipping section #IfNotTable form_questionnaire_assessments

Skipping section #IfNotTable questionnaire_response

Skipping section #IfMissingColumn form_questionnaire_assessments response_id

Skipping section #IfNotRow2D list_options list_id Document_Template_Categories option_id questionnaire

Skipping section #IfRow2D categories aco_spec patients|docs name Patient Information

Skipping section #IfRow2D categories aco_spec patients|docs name Patient ID card

Skipping section #IfRow2D categories aco_spec patients|docs name Patient Photograph

Skipping section #IfMissingColumn openemr_postcalendar_events uuid

Skipping section #IfNotIndex openemr_postcalendar_events uuid

Skipping section #IfMissingColumn layout_group_properties grp_unchecked

Skipping section #IfNotColumnType audit_details field_value LONGTEXT

Skipping section #IfMissingColumn audit_master is_unstructured_document

Skipping section #IfNotColumnType ccda ccda_data LONGTEXT

Updating CPT4 Mappings
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-10', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-15-29', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-30-44', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-45-59', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'new-patient-60-74', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'established-patient-10-19', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'established-patient-20-29', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'established-patient-30-39', ))
(sql="UPDATE list_options SET codes=CONCAT('CPT4:', ?) WHERE list_id=? AND option_id=?, values=array ( 0 => NULL, 1 => 'encounter-types', 2 => 'established-patient-40-54', ))

Updating UUIDs (this could take some time)
Did not need to update or add any new UUIDs

Updating global configuration defaults…

Updating Access Controls…

DONE upgrading access controls

Updating version indicators. Patch was also installed, updating version patch indicator…

Database and Access Control upgrade finished.

Clear browser cache and try. Otherwise we’d need to find out why you!:slight_smile: I know for me it’s automatic the world is against me!:slight_smile:

1 Like

Ah! A kindred spirit, I am thinking of changing my name from Jason to Jonah!!

Call me Jonah!! Cleared cache No joy. I have no idea where to start looking.

You can try to export the LBF and send to me. I’ll see if I can get imported w/o blowing up mt vertical tables!

You export from backup. Ensure you have the Config set for Configuration Export/Import

1 Like

I have done a backup and extracted all the files. Because this is a multi-site and the signature test stuff is not the default site I have done a backup of each. They are both just under 280mb. What am I looking to give you out of the backups? Or would you like them both I can file share them?

You can use Export Configuration in Backup to export LBFs etc

Select your LBF from right panel then continue to download the LBF form.
Remember my note above on setting up Export Configuration in Config/globals.
The email me the download.

2 Likes