This forum is for programmers who have questions about the source code.
-
wjstarck
- Posts: 945
- Joined: Tue Jul 31, 2007 7:18 am
- Location: Keller, TX
-
Contact:
Post
by wjstarck » Thu Jul 21, 2011 8:55 am
Topaz sigs signed recently (probably since OD 11) will show, but not ones signed previously. I noticed the changes you made to rectify the 'signed with zeros' bug but adding these to my code has no effect.
Code: Select all
if (AnesthDataCur.SigIsTopaz == true && AnesthDataCur.Signature != "") {
sigBox.Visible = false;
sigBoxTopaz.Visible = true;
CodeBase.TopazWrapper.ClearTopaz(sigBoxTopaz);
CodeBase.TopazWrapper.SetTopazCompressionMode(sigBoxTopaz, 0);
CodeBase.TopazWrapper.SetTopazEncryptionMode(sigBoxTopaz, 0);
CodeBase.TopazWrapper.SetTopazKeyString(sigBoxTopaz, "0000000000000000");
CodeBase.TopazWrapper.SetTopazAutoKeyData(sigBoxTopaz, AnesthDataCur.AnestheticRecordNum.ToString());//AnesthDataCur.Notes + AnestheticRecordCur.ProvNum.ToString());
CodeBase.TopazWrapper.SetTopazEncryptionMode(sigBoxTopaz, 2);//high encryption
CodeBase.TopazWrapper.SetTopazCompressionMode(sigBoxTopaz, 2);//high compression
CodeBase.TopazWrapper.SetTopazSigString(sigBoxTopaz, AnesthDataCur.Signature);
//older notes may have been signed with zeros due to a bug. We still want to show the sig in that case.
//but if a sig is not showing, then set the key string to try to get it to show.
if (CodeBase.TopazWrapper.GetTopazNumberOfTabletPoints(sigBoxTopaz) == 0) {
CodeBase.TopazWrapper.SetTopazAutoKeyData(sigBoxTopaz, AnesthDataCur.Signature);
CodeBase.TopazWrapper.SetTopazSigString(sigBoxTopaz, AnesthDataCur.Signature);
}
//If sig is not showing, then try encryption mode 3 for signatures signed with old SigPlusNet.dll.
if (CodeBase.TopazWrapper.GetTopazNumberOfTabletPoints(sigBoxTopaz) == 0) {
CodeBase.TopazWrapper.SetTopazEncryptionMode(sigBoxTopaz, 3);//Unknown mode (told to use via TopazSystems)
CodeBase.TopazWrapper.SetTopazSigString(sigBoxTopaz, AnesthDataCur.Signature);
}
sigBoxTopaz.Refresh();
}
How to fix?
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
-
jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
-
Contact:
Post
by jordansparks » Fri Jul 22, 2011 5:46 am
The "signed with zeros" issue was from last year and is almost certainly unrelated.
The Topaz programmers are complete idiots. They added an encryption mode to the existing enumeration, but failed to add it to the end and instead inserted it in the middle of their enumerated types. This is programming 101. Anyway, we are left cleaning up the mess. The strategy they suggested, and which seems quite easy, is to first try to decrypt it with one encryption mode. If it doesn't work (0 tablet points), then try another encryption mode. Under the new dll number scheme, some of the sigs will have been signed with encryption mode 2, and some with encryption mode 3. So look at how we did our minor rewrite, and follow the same strategy in your code.
-
wjstarck
- Posts: 945
- Joined: Tue Jul 31, 2007 7:18 am
- Location: Keller, TX
-
Contact:
Post
by wjstarck » Fri Jul 22, 2011 7:32 am
Got it, thanks.
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA