Page 1 of 1

Help with Plugins

Posted: Thu Feb 18, 2010 6:01 am
by drtech
Jordan,

yes, the example posted does help a little, but I just can't quite figure out how to graphically place things easily in the designer, do I have to manually figure out the coordinates by first modifying the existing form and then transferring that whole object (eg panel) over to a new form? ...kind of like the example? It just seems like a lot of figuring, etc...

Also, if you could give another example of a hook and modification of display on an existing form like most of my modifications that would help. The other problem (which is good overall, but not for the example) you actually have the included example of the drop down ins info in the account in the program now, so it is hard to tell what is already there and what is changed. Not a new form, but display changes to existing forms.
Thanks.
I haven't spent a huge amount of time on it, but each time I try I have given up so far....

Re: Help with Plugins

Posted: Thu Feb 18, 2010 10:11 am
by jordansparks
Give me one example with one change that you feel represents a typical change. I will add that change to the posted sample.

Re: Help with Plugins

Posted: Sat Mar 20, 2010 12:14 pm
by drtech
How about adding "Referral To" list to the Patient Info section of the Chart instead of just Referred From?

Re: Help with Plugins

Posted: Sat Mar 20, 2010 2:54 pm
by jordansparks
OK, I'll add that to the plugin example as well as make sure the plugin example isn't broken.

Re: Help with Plugins

Posted: Sat Mar 20, 2010 7:29 pm
by jordansparks
Done. Please note that to get it to work, you would have had to ask us for one method hook for ContrChart.FillPtInfo. And then, after you realized that ContrChart.TreatmentNoteChanged needed to be made public, you would have needed to ask for that, too. I have not tested to see that the treatment note part of it works. So after thorough testing, there might be some other quirk.

Re: Help with Plugins

Posted: Sat Mar 20, 2010 9:34 pm
by drtech
great...i will try it out as soon as I can and look it over.

Re: Help with Plugins

Posted: Sun Mar 21, 2010 6:09 pm
by drtech
I can't seem to find the plugin page...the link on the developers page is wrong http://www.opendental.com/manual/programmers.html --> it goes to http://www.opendental.com/manual/developers.html

Re: Help with Plugins

Posted: Sun Mar 21, 2010 9:55 pm
by jordansparks
Link fixed.

Re: Help with Plugins

Posted: Sat Mar 27, 2010 4:24 pm
by jordansparks
jordansparks wrote:Done. Please note that to get it to work, you would have had to ask us for one method hook for ContrChart.FillPtInfo. And then, after you realized that ContrChart.TreatmentNoteChanged needed to be made public, you would have needed to ask for that, too. I have not tested to see that the treatment note part of it works. So after thorough testing, there might be some other quirk.
The above statement is wrong. I now know that ContrChart.TreatmentNoteChanged could have wrapped up and passed in as an object in the parameter list. Since it's a value type, there's a little more work involved; it can't be passed directly in. So I'll be adding to the example at some point to show how to pass in a value type to simulate by ref. In summary, it did not need to be made public in the main program.

Re: Help with Plugins

Posted: Tue Mar 30, 2010 2:19 pm
by drtech
so, I can't get it to compile now w/o commenting out

sender.TreatmentNoteChanged=false;

not quite figuring out what I need to do...is it not public now?

Re: Help with Plugins

Posted: Tue Mar 30, 2010 7:46 pm
by drtech
every time I try to test out my plugin, it says "Version of plug-in may not be newer than version of Open Dental."...which I know is coming from the convertplugindatabase.cs file, but don't know what I am doing wrong!

I am trying to run it on the head alpha version and beta versions but they both give me the same error, what am I doing wrong?

Re: Help with Plugins

Posted: Tue Mar 30, 2010 8:00 pm
by drtech
ok, nevermind...i had to change the version in the assembly info....loads now...

Re: Help with Plugins

Posted: Wed Mar 31, 2010 8:13 am
by drtech
can you add the plugin project to your normal open dental solution and include it to debug? I tried, it but it doesn't seem to build the dll when I do that...Otherwise I cannot figure out how to debug my plugin with the program.

Re: Help with Plugins

Posted: Wed Mar 31, 2010 8:42 am
by drtech
when i have the dll enabled, I am getting an error after login

Value cannot be null.
Parameter name:type

but I can't debug when the dll is already built and running...how do I figure this out?

Re: Help with Plugins

Posted: Wed Mar 31, 2010 9:21 am
by jordansparks
I listed it out in 9 steps. I guess what I didn't list was how to copy the solution folder to a new location so that you can start making it different than the example.
1. Copy and paste the example solution to a new location.
2. Fix the references, by dropping and readding projects, readding references, etc. Already explained on that page in the manual.
You can see in step 8 that the OD project is already part of the solution. That's how you run it.

Re: Help with Plugins

Posted: Wed Mar 31, 2010 9:59 am
by drtech
k...didn't know if it was a simple as that...thanks

duh..i completely missed: 8. Set the Open Dental project to be the startup project (right click).

what about
"sender.TreatmentNoteChanged=false;" I still can't seem to build it w/o commenting out because this is not accessible..

Re: Help with Plugins

Posted: Wed Mar 31, 2010 1:03 pm
by drtech
yes! i got the statement change it to work with my 1st plugin! (using your example of changing the statement!)

Re: Help with Plugins

Posted: Wed Mar 31, 2010 1:21 pm
by jordansparks
I just committed making TreatmentNoteChanged public. But I have this nagging feeling that there was a reason I didn't do it earlier. So if it works with 7.1, but still not with 7.0 for some reason, then let me know. I'll try to put in better documentation about the version number for other people getting started.

Re: Help with Plugins

Posted: Wed Mar 31, 2010 1:24 pm
by drtech
Now, I need the data I want.

How can I get the total balance left for a payment plan (not what is due)?

if (tableMisc.Rows[m]["descript"].ToString() == "Balance")
{
pplanTotal += PIn.Double(tableMisc.Rows[m]["value"].ToString());
//payPlanDue;//PatGuar.PayPlanDue;
}

does not seem to work...

where is the definition for the rows in the tablePP and tableMisc in formRPStatement?
It seems that "CompletedAmt" from the database in the payplan table may be what I want, but I can't seem to figure out where it is stored in those arrays...

Re: Help with Plugins

Posted: Wed Mar 31, 2010 1:35 pm
by drtech
Here is what I am trying to do on the statements for a floating balance on my plugin:

Total: $1000 (includes all financed payment plans)
-Amt Financed: $500 (what is left on the balance of all the payment plans)
-In Est. : $100
Owed Now :$400

Code:

double pplanTotal = 0;
//double balanceTotal = PatGuar.BalTotal;
for (int m = 0; m < tableMisc.Rows.Count; m++)
{
if (tableMisc.Rows[m]["descript"].ToString() == "Balance")
{
pplanTotal += PIn.Double(tableMisc.Rows[m]["value"].ToString());
//payPlanDue;//PatGuar.PayPlanDue;
}
}
double pplanDue = 0;
for (int m = 0; m < tableMisc.Rows.Count; m++)
{
if (tableMisc.Rows[m]["descript"].ToString() == "payPlanDue")
{
pplanDue += PIn.Double(tableMisc.Rows[m]["value"].ToString());
//payPlanDue;//PatGuar.PayPlanDue;
}
}
double amtFinanced = pplanTotal - pplanDue;
if (tablePP.Rows.Count > 0) //Show different info if payment plans involved.
{

text = (PatGuar.BalTotal + pplanTotal).ToString("c"); //orig: PatGuar.BalTotal.ToString("c");
par.AddFormattedText(text, font);
par.AddLineBreak();
text = amtFinanced.ToString("c");
par.AddFormattedText(text, font);
par.AddLineBreak();
text = PatGuar.InsEst.ToString("c");
par.AddFormattedText(text, font);
par.AddLineBreak();
text = (PatGuar.BalTotal + pplanDue - PatGuar.InsEst).ToString("c");
par.AddFormattedText(text, fontBold);
par.AddLineBreak();

Re: Help with Plugins

Posted: Wed Mar 31, 2010 1:39 pm
by jordansparks
You'll have to figure out a query that does it. You won't be getting your data from the middle tier.

Re: Help with Plugins

Posted: Wed Mar 31, 2010 1:41 pm
by drtech
ok...was hoping it was already there...

Re: Help with Plugins

Posted: Wed Mar 31, 2010 1:54 pm
by drtech
I am also getting an error when debuging

DLL 'C:\Windows\assembly\GAC\Microsoft.DirectX\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.

you can just continue and it works fine, but keeps breaking twice to announce this on Initialize Graphics in ToothChartDirectX.cs

I am not doing anything with graphics, so not sure what that is all about. debugging with beta 7.0.14

Re: Help with Plugins

Posted: Wed Mar 31, 2010 4:11 pm
by jordansparks
Loader lock is discussed here in the fifth paragraph:
http://www.opendental.com/manual/developers.html

Re: Help with Plugins

Posted: Wed Mar 31, 2010 6:54 pm
by drtech
thanks...