-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathContrAccountP.cs
More file actions
165 lines (154 loc) · 5.68 KB
/
ContrAccountP.cs
File metadata and controls
165 lines (154 loc) · 5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OpenDental;
using OpenDentBusiness;
namespace PluginExample {
public partial class ContrAccountP:UserControl {
private static ContrAccountP contrAccountP;
public Family FamCur;
public Patient PatCur;
public ContrAccountP() {
InitializeComponent();
}
public static void InitializeOnStartup_end(OpenDental.ContrAccount sender) {
contrAccountP=new ContrAccountP();
sender.Controls.Add(contrAccountP.panelInsInfoDetail);
//any control could be used here:
Label label2=(Label)sender.Controls.Find("label2",true)[0];
label2.MouseHover+=new EventHandler(contrAccountP.label2_MouseHover);
label2.MouseLeave+=new EventHandler(contrAccountP.label2_MouseLeave);
}
public static void RefreshModuleData_end(object sender,Family famCur,Patient patCur) {
contrAccountP.FamCur=famCur;
contrAccountP.PatCur=patCur;
}
public void label2_MouseHover(object sender,EventArgs e) {
if(PatCur==null) {
return;
}
Cursor.Current=Cursors.WaitCursor;
panelInsInfoDetail.Visible = true;
panelInsInfoDetail.BringToFront();
FillInsInfo();
Cursor.Current=Cursors.Default;
}
private void label2_MouseLeave(object sender,EventArgs e) {
panelInsInfoDetail.Visible = false;
}
public void FillInsInfo() {
//Broken during overhaul of 6.7, fixed in 6.8 by DrTech
textPriMax.Text = "";
textPriDed.Text = "";
textPriDedFam.Text = "";
textPriDedRem.Text = "";
textPriUsed.Text = "";
textPriPend.Text = "";
textPriRem.Text = "";
textSecMax.Text = "";
textSecDed.Text = "";
textSecDedFam.Text = "";
textSecDedRem.Text = "";
textSecUsed.Text = "";
textSecPend.Text = "";
textSecRem.Text = "";
if(PatCur == null) {//redundant
return;
}
List<InsSub> SubList=InsSubs.RefreshForFam(FamCur);
List<InsPlan> InsPlanList=InsPlans.RefreshForSubList(SubList);
List<PatPlan> PatPlanList=PatPlans.Refresh(PatCur.PatNum);
List<Benefit> BenefitList=Benefits.Refresh(PatPlanList);
List<ClaimProc> ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum);
List<ClaimProcHist> HistList=ClaimProcs.GetHistList(PatCur.PatNum,BenefitList,PatPlanList,InsPlanList,DateTime.Today);
double max = 0;
double ded = 0;
double dedFam = 0;
double dedUsed = 0;
double remain = 0;
double pend = 0;
double used = 0;
InsPlan PlanCur;//=new InsPlan();
if(PatPlanList.Count > 0) {
PlanCur = InsPlans.GetPlan(PatPlanList[0].PlanNum,InsPlanList);
pend = InsPlans.GetPendingDisplay(HistList,DateTime.Today,PlanCur,PatPlanList[0].PatPlanNum,-1,PatCur.PatNum);
used = InsPlans.GetInsUsedDisplay(HistList,DateTime.Today,PlanCur.PlanNum,PatPlanList[0].PatPlanNum,
-1,InsPlanList,BenefitList,PatCur.PatNum);
textPriPend.Text = pend.ToString("F");
textPriUsed.Text = used.ToString("F");
max = Benefits.GetAnnualMaxDisplay(BenefitList,PlanCur.PlanNum,PatPlanList[0].PatPlanNum,false);
if(max == -1) {//if annual max is blank
textPriMax.Text = "";
textPriRem.Text = "";
}
else {
remain = max - used - pend;
if(remain < 0) {
remain = 0;
}
textPriMax.Text = max.ToString("F");
textPriRem.Text = remain.ToString("F");
}
//deductible:
ded = Benefits.GetDeductGeneralDisplay(BenefitList,PlanCur.PlanNum,PatPlanList[0].PatPlanNum,BenefitCoverageLevel.Individual);
dedFam = Benefits.GetDeductGeneralDisplay(BenefitList,PlanCur.PlanNum,PatPlanList[0].PatPlanNum,BenefitCoverageLevel.Family);
if(ded != -1) {
textPriDed.Text = ded.ToString("F");
dedUsed = InsPlans.GetDedUsedDisplay(HistList,DateTime.Today,PlanCur.PlanNum,PatPlanList[0].PatPlanNum,-1,InsPlanList,
BenefitCoverageLevel.Individual,PatCur.PatNum);
textPriDedRem.Text = (ded - dedUsed).ToString("F");
}
if(dedFam != -1) {
textPriDedFam.Text = dedFam.ToString("F");
}
}
if(PatPlanList.Count > 1) {
PlanCur = InsPlans.GetPlan(PatPlanList[1].PlanNum,InsPlanList);
pend = InsPlans.GetPendingDisplay(HistList,DateTime.Today,PlanCur,PatPlanList[1].PatPlanNum,-1,PatCur.PatNum);
textSecPend.Text = pend.ToString("F");
used = InsPlans.GetInsUsedDisplay(HistList,DateTime.Today,PlanCur.PlanNum,PatPlanList[1].PatPlanNum,-1,
InsPlanList,BenefitList,PatCur.PatNum);
textSecUsed.Text = used.ToString("F");
max = Benefits.GetAnnualMaxDisplay(BenefitList,PlanCur.PlanNum,PatPlanList[1].PatPlanNum,false);
if(max == -1) {
textSecMax.Text = "";
textSecRem.Text = "";
}
else {
remain = max - used - pend;
if(remain < 0) {
remain = 0;
}
textSecMax.Text = max.ToString("F");
textSecRem.Text = remain.ToString("F");
}
ded = Benefits.GetDeductGeneralDisplay(BenefitList,PlanCur.PlanNum,PatPlanList[1].PatPlanNum,BenefitCoverageLevel.Individual);
dedFam = Benefits.GetDeductGeneralDisplay(BenefitList,PlanCur.PlanNum,PatPlanList[1].PatPlanNum,BenefitCoverageLevel.Family);
if(ded != -1) {
textSecDed.Text = ded.ToString("F");
dedUsed = InsPlans.GetDedUsedDisplay(HistList,DateTime.Today,PlanCur.PlanNum,PatPlanList[1].PatPlanNum,-1,InsPlanList,
BenefitCoverageLevel.Individual,PatCur.PatNum);
textSecDedRem.Text = (ded - dedUsed).ToString("F");
}
if(dedFam != -1) {
textSecDedFam.Text = dedFam.ToString("F");
}
}
/*
//**only different line from tx pl routine fillsummary
if(PatPlanList.Count == 0) {
labelInsLeft.Text = Lan.g(this,"No Ins.");
labelInsLeftAmt.Text = "";
}
else {
labelInsLeft.Text = Lan.g(this,"Ins. Left");
labelInsLeftAmt.Text = textPriRem.Text;
}*/
}
}
}