How to save signatures in open dental PDF forms ?

This forum is for programmers who have questions about the source code.
Post Reply
nanwar
Posts: 16
Joined: Thu Dec 15, 2016 5:27 am

How to save signatures in open dental PDF forms ?

Post by nanwar » Wed Oct 04, 2017 6:25 am

Hi All,
We are integrating open dental in our iOS application but we got stuck while saving signatures in patients forms in open dental local database.

Firstly, I was sending base64 string and OD considering it as an invalid signature as per OD documentation encrypted string with hash of all other fields values in need to be send in order to save the signature.

“A signature box, either Topaz pad or directly on the screen with stylus/mouse. The signature is encrypted based an a hash of all other field values in the entire sheet, excluding other SigBoxes. The order is critical.”

I am not sure which encryption algorithm technique should be used for getting hash all values and in what order?

I’ll be very grateful to you for this great favour, Thanks.

User avatar
cmcgehee
Posts: 711
Joined: Tue Aug 25, 2015 5:06 pm
Location: Salem, Oregon

Re: How to save signatures in open dental PDF forms ?

Post by cmcgehee » Wed Oct 04, 2017 10:26 am

Here are the basic steps to save a signature for a sheet:
SignatureBoxWrapper sigBox;
Sheet sheetCur;
//Later once the user has signed the signature box on the sheet
string keyData=Sheets.GetSignatureKey(sheetCur);
string signature=sigBox.GetSignature(keyData);
//signature can now be saved to the database

You can see an example of this in FormSheetFillEdit.SaveSignaturePayPlan().
Chris McGehee
Open Dental Software
http://www.opendental.com

nanwar
Posts: 16
Joined: Thu Dec 15, 2016 5:27 am

Re: How to save signatures in open dental PDF forms ?

Post by nanwar » Fri Oct 06, 2017 5:02 am

Thanks for the reply. The code snippet you shared is in C# and I need to implement in iOS application (ObjC or Swift implementation). We have to send patient data along with signature to open dental database using iOS app. So if someone can provide any example or reference in swift/ObjC, it will be really helpful.

I tried to encypt data using AES technique in the same pattern as the above example is interpreted but it’s not converting it in desired format.

Can you please let me what encryption algorithm should we consider in encrypting signature? Any code reference for Open Dental desktop app for saving signature will be good as well.

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: How to save signatures in open dental PDF forms ?

Post by jsalmon » Fri Oct 06, 2017 12:35 pm

nanwar wrote:I tried to encypt data using AES technique in the same pattern as the above example is interpreted but it’s not converting it in desired format.
Odds are if that didn't work then the office you are working might be signing with Topaz signature pads? We do not have access to their encryption algorithm so you might have to get in touch with them for help on that front.
If the office / you aren't using Topaz pads then you might not be hashing your data in the same way that the Open Dental program is expecting the hash to be in? This of course is assuming your AES technique is in fact using the same pattern as the example code Chris gave.
See SignatureBox.SetAutoKeyData() for what I am referring to.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: How to save signatures in open dental PDF forms ?

Post by jsalmon » Fri Oct 06, 2017 12:42 pm

nanwar wrote:I am not sure which encryption algorithm technique should be used for getting hash all values and in what order?
The hash will be using MD5 and the order of values for creating the hash greatly depends on what you are making a signature for. In this example you seem to be signing sheets, therefore our sheet field "order" can be found in Sheets.GetSignatureKey()
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

nanwar
Posts: 16
Joined: Thu Dec 15, 2016 5:27 am

Re: How to save signatures in open dental PDF forms ?

Post by nanwar » Thu Oct 12, 2017 10:29 pm

Finally did it, thanks a lot guys for your kind suggestions.

Post Reply