Help with Plugins

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Help with Plugins

Post by drtech » Thu Feb 18, 2010 6:01 am

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....
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Help with Plugins

Post by jordansparks » Thu Feb 18, 2010 10:11 am

Give me one example with one change that you feel represents a typical change. I will add that change to the posted sample.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Sat Mar 20, 2010 12:14 pm

How about adding "Referral To" list to the Patient Info section of the Chart instead of just Referred From?
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Help with Plugins

Post by jordansparks » Sat Mar 20, 2010 2:54 pm

OK, I'll add that to the plugin example as well as make sure the plugin example isn't broken.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Help with Plugins

Post by jordansparks » Sat Mar 20, 2010 7:29 pm

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.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Sat Mar 20, 2010 9:34 pm

great...i will try it out as soon as I can and look it over.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Sun Mar 21, 2010 6:09 pm

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
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Help with Plugins

Post by jordansparks » Sun Mar 21, 2010 9:55 pm

Link fixed.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Help with Plugins

Post by jordansparks » Sat Mar 27, 2010 4:24 pm

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.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Tue Mar 30, 2010 2:19 pm

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?
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Tue Mar 30, 2010 7:46 pm

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?
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Tue Mar 30, 2010 8:00 pm

ok, nevermind...i had to change the version in the assembly info....loads now...
Last edited by drtech on Wed Mar 31, 2010 8:38 am, edited 2 times in total.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Wed Mar 31, 2010 8:13 am

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.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Wed Mar 31, 2010 8:42 am

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?
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Help with Plugins

Post by jordansparks » Wed Mar 31, 2010 9:21 am

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.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Wed Mar 31, 2010 9:59 am

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..
Last edited by drtech on Wed Mar 31, 2010 1:01 pm, edited 1 time in total.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Wed Mar 31, 2010 1:03 pm

yes! i got the statement change it to work with my 1st plugin! (using your example of changing the statement!)
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Help with Plugins

Post by jordansparks » Wed Mar 31, 2010 1:21 pm

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.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Wed Mar 31, 2010 1:24 pm

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...
Last edited by drtech on Wed Mar 31, 2010 1:36 pm, edited 1 time in total.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Wed Mar 31, 2010 1:35 pm

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();
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Help with Plugins

Post by jordansparks » Wed Mar 31, 2010 1:39 pm

You'll have to figure out a query that does it. You won't be getting your data from the middle tier.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Wed Mar 31, 2010 1:41 pm

ok...was hoping it was already there...
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Wed Mar 31, 2010 1:54 pm

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
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Help with Plugins

Post by jordansparks » Wed Mar 31, 2010 4:11 pm

Loader lock is discussed here in the fifth paragraph:
http://www.opendental.com/manual/developers.html
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Help with Plugins

Post by drtech » Wed Mar 31, 2010 6:54 pm

thanks...
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

Post Reply