Hook Request - Practice Genius

This forum is for programmers who have questions about the source code.
Post Reply
msneen
Posts: 4
Joined: Wed Feb 08, 2017 10:42 am

Hook Request - Practice Genius

Post by msneen » Fri Mar 10, 2017 1:19 pm

Hi,
We're writing a plug-in for Open Dental to integrate with our Rewards Program and would like to request some hooks

FormApptEdit After Line 3696

Code: Select all

Plugins.HookAddCode(null, "FormApptEdit.butDelete_Click_end", AptCur);
FormApptEdit After Line 3801, add 2 parameters

Code: Select all

Plugins.HookAddCode(this,"FormApptEdit.butOK_Click_end",AptCur, [b]AptOld, pat[/b])
FormPatientEdit After Line 5452, add 3 parameters ( or add PatOld and make the checkboxes public on the form)

Code: Select all

Plugins.HookAddCode(this,"FormPatientEdit.butOK_Click_end",PatCur, [b]PatOld, checkSame.Checked, checkEmailPhoneSame.Checked[/b]);
ContraAppt after Line 3302

Code: Select all

Plugins.HookAddCode(this, "ContrAppt.OnDelete_Click_end", apt, PatCur);
ContraAppt after Line 4062

Code: Select all

 Plugins.HookAddCode(this, "ContrAppt.ContrApptSheet2_MouseUp_end", apt, aptOld);
ContraAppt after Line 5529

Code: Select all

Plugins.HookAddCode(this, "ContrAppt.OnUnsched_Click_end", apt, PatCur);
ContraAppt after Line 5705

Code: Select all

Plugins.HookAddCode(this, "ContrAppt.OnBreak_Click_end", apt, PatCur);
ContraAppt after Line 5790

Code: Select all

Plugins.HookAddCode(this, "ContrAppt.OnComplete_Click_end", apt, PatCur);
ContraAppt after Line 5883

Code: Select all

Plugins.HookAddCode(this, "ContrAppt.OnDelete_Click_end", apt, PatCur);

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

Re: Hook Request - Practice Genius

Post by cmcgehee » Mon Mar 13, 2017 9:01 am

We will get these added to the program shortly. My only comment is that using line numbers for where you want the hook is not always sufficient. Some of our files change quite frequently so line numbers are always in flux. Including a little snippet of where you want the with a few lines of surrounding code or a short description ("the last line of FormApptEdit.butOK_Click before the DialogResult is set") will help us ensure we put the hook exactly where you want it.

Edit: I removed my second comment about adding an additional hook method where one already exists.
Chris McGehee
Open Dental Software
http://www.opendental.com

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

Re: Hook Request - Practice Genius

Post by cmcgehee » Tue Mar 28, 2017 2:52 pm

These hooks have been added to 16.4.30 and 17.1.1.

I changed

Code: Select all

Plugins.HookAddCode(null, "FormApptEdit.butDelete_Click_end", AptCur);
to

Code: Select all

Plugins.HookAddCode(this, "FormApptEdit.butDelete_Click_end", AptCur);
in case someone comes along later and wants to use fields on FormApptEdit.

In FormPatientEdit, I only added PatOld to the hook. Because FormPatientEdit is passed in you can access all the controls like so:

Code: Select all

ODtextBox textTreatmentNotes=(ODtextBox)sender.Controls.Find("textTreatmentNotes",true)[0];
See the PluginExample solution for more examples like this.

You had two requests for "ContrAppt.OnDelete_Click_end". One of them was about at the end of pinBoard_MouseUp() based on your line number, so I added a hook there. Let me know if that's not what you intended.
Chris McGehee
Open Dental Software
http://www.opendental.com

Post Reply