Page 1 of 1

How to save signatures in open dental PDF forms ?

Posted: Wed Oct 04, 2017 6:25 am
by nanwar
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.

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

Posted: Wed Oct 04, 2017 10:26 am
by cmcgehee
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().

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

Posted: Fri Oct 06, 2017 5:02 am
by nanwar
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.

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

Posted: Fri Oct 06, 2017 12:35 pm
by jsalmon
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.

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

Posted: Fri Oct 06, 2017 12:42 pm
by jsalmon
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()

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

Posted: Thu Oct 12, 2017 10:29 pm
by nanwar
Finally did it, thanks a lot guys for your kind suggestions.