private void gridOut_CellDoubleClick(object sender,ODGridClickEventArgs e) { //bottom grid //bring up claimedit window //after returning from the claim edit window, use a query to get a list of all the claimprocs that have amounts entered for that claim, but have ClaimPaymentNumber of 0. //Set all those claimprocs to be attached. Claim claimCur=Claims.GetClaim(ClaimsOutstanding[e.Row].ClaimNum); FormClaimEdit FormCE=new FormClaimEdit(claimCur,Patients.GetPat(claimCur.PatNum),Patients.GetFamily(claimCur.PatNum)); FormCE.IsFromBatchWindow=true; FormCE.ShowDialog(); if(FormCE.DialogResult!=DialogResult.OK){ return; } ClaimProcs.AttachToPayment(claimCur.ClaimNum,ClaimPaymentCur.ClaimPaymentNum,ClaimPaymentCur.CheckDate,ClaimsAttached.Count+1); FillGrids(); }
private void gridPreAuth_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) { Claim claim=Claims.GetClaim(((Claim)ALPreAuth[e.Row]).ClaimNum);//gets attached images. FormClaimEdit FormC=new FormClaimEdit(claim,PatCur,FamCur); //FormClaimEdit2.IsPreAuth=true; FormC.ShowDialog(); if(FormC.DialogResult!=DialogResult.OK){ return; } ModuleSelected(PatCur.PatNum); }
private void gridAttached_CellDoubleClick(object sender,ODGridClickEventArgs e) { //top grid //bring up claimedit window. User should be able to edit if not locked. Claim claimCur=Claims.GetClaim(ClaimsAttached[gridAttached.GetSelectedIndex()].ClaimNum); FormClaimEdit FormCE=new FormClaimEdit(claimCur,Patients.GetPat(claimCur.PatNum),Patients.GetFamily(claimCur.PatNum)); FormCE.IsFromBatchWindow=true; FormCE.ShowDialog(); FillGrids(); }
private void menuInsOther_Click(object sender, System.EventArgs e) { if(!CheckClearinghouseDefaults()) { return; } List <PatPlan> PatPlanList=PatPlans.Refresh(PatCur.PatNum); List<InsSub> SubList=InsSubs.RefreshForFam(FamCur); List<InsPlan> InsPlanList=InsPlans.RefreshForSubList(SubList); List<ClaimProc> ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum); List <Benefit> BenefitList=Benefits.Refresh(PatPlanList,SubList); List<Procedure> procsForPat=Procedures.Refresh(PatCur.PatNum); if(gridAccount.SelectedIndices.Length==0){ MessageBox.Show(Lan.g(this,"Please select procedures first.")); return; } DataTable table=DataSetMain.Tables["account"]; bool allAreProcedures=true; for(int i=0;i<gridAccount.SelectedIndices.Length;i++){ if(table.Rows[gridAccount.SelectedIndices[i]]["ProcNum"].ToString()=="0"){ allAreProcedures=false; } } if(!allAreProcedures){ MessageBox.Show(Lan.g(this,"You can only select procedures.")); return; } Claim ClaimCur=CreateClaim("Other",PatPlanList,InsPlanList,ClaimProcList,procsForPat,SubList); if(ClaimCur.ClaimNum==0){ ModuleSelected(PatCur.PatNum); return; } ClaimL.CalculateAndUpdate(procsForPat,InsPlanList,ClaimCur,PatPlanList,BenefitList,PatCur.Age,SubList); //still have not saved some changes to the claim at this point FormClaimEdit FormCE=new FormClaimEdit(ClaimCur,PatCur,FamCur); FormCE.IsNew=true;//this causes it to delete the claim if cancelling. FormCE.ShowDialog(); ModuleSelected(PatCur.PatNum); }
private void ToolBarMainPreAuth_Click() { if(!CheckClearinghouseDefaults()) { return; } if(gridPlans.SelectedIndices[0]!=0){ MsgBox.Show(this,"You can only send a preauth from the current TP, not a saved TP."); return; } if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canada int numLabProcsUnselected=0; List<int> selectedIndices=new List<int>(gridMain.SelectedIndices); for(int i=0;i<selectedIndices.Count;i++) { Procedure proc=((Procedure)gridMain.Rows[selectedIndices[i]].Tag); if(proc!=null) { ProcedureCode procCode=ProcedureCodes.GetProcCodeFromDb(proc.CodeNum); if(procCode.IsCanadianLab) { gridMain.SetSelected(selectedIndices[i],false);//deselect numLabProcsUnselected++; } } } if(numLabProcsUnselected>0) { MessageBox.Show(Lan.g(this,"Number of lab fee procedures unselected")+": "+numLabProcsUnselected.ToString()); } if(gridMain.SelectedIndices.Length>7) { List <int> selectedIndicies=new List<int>(gridMain.SelectedIndices); selectedIndicies.Sort(); for(int i=0;i<selectedIndicies.Count;i++) { //Unselect all but the first 7 procedures with the smallest index numbers. gridMain.SetSelected(selectedIndicies[i],(i<7)); } MsgBox.Show(this,"Only the first 7 procedures will be selected. You will need to create another preauth for the remaining procedures."); } } bool procsSelected=false; for(int i=0;i<gridMain.SelectedIndices.Length;i++){ if(gridMain.Rows[gridMain.SelectedIndices[i]].Tag!=null){ procsSelected=true; } } if(!procsSelected) { MessageBox.Show(Lan.g(this,"Please select procedures first.")); return; } Claim ClaimCur=new Claim(); FormInsPlanSelect FormIPS=new FormInsPlanSelect(PatCur.PatNum); FormIPS.ViewRelat=true; FormIPS.ShowDialog(); if(FormIPS.DialogResult!=DialogResult.OK) { return; } ClaimCur.PatNum=PatCur.PatNum; ClaimCur.ClaimStatus="W"; ClaimCur.DateSent=DateTimeOD.Today; ClaimCur.PlanNum=FormIPS.SelectedPlan.PlanNum; ClaimCur.InsSubNum=FormIPS.SelectedSub.InsSubNum; ClaimCur.ProvTreat=0; for(int i=0;i<gridMain.SelectedIndices.Length;i++){ if(gridMain.Rows[gridMain.SelectedIndices[i]].Tag==null){ continue;//skip any hightlighted subtotal lines } if(ClaimCur.ProvTreat==0){//makes sure that at least one prov is set ClaimCur.ProvTreat=((Procedure)gridMain.Rows[gridMain.SelectedIndices[i]].Tag).ProvNum; } if(!Providers.GetIsSec(((Procedure)gridMain.Rows[gridMain.SelectedIndices[i]].Tag).ProvNum)){ ClaimCur.ProvTreat=((Procedure)gridMain.Rows[gridMain.SelectedIndices[i]].Tag).ProvNum; } } ClaimCur.ClinicNum=PatCur.ClinicNum; if(Providers.GetIsSec(ClaimCur.ProvTreat)){ ClaimCur.ProvTreat=PatCur.PriProv; //OK if 0, because auto select first in list when open claim } ClaimCur.ProvBill=Providers.GetBillingProvNum(ClaimCur.ProvTreat,ClaimCur.ClinicNum); ClaimCur.EmployRelated=YN.No; ClaimCur.ClaimType="PreAuth"; //this could be a little better if we automate figuring out the patrelat //instead of making the user enter it: ClaimCur.PatRelat=FormIPS.PatRelat; Claims.Insert(ClaimCur); Procedure ProcCur; ClaimProc ClaimProcCur; ClaimProc cpExisting; for(int i=0;i<gridMain.SelectedIndices.Length;i++){ if(gridMain.Rows[gridMain.SelectedIndices[i]].Tag==null) { continue;//skip any highlighted subtotal lines } ProcCur=(Procedure)gridMain.Rows[gridMain.SelectedIndices[i]].Tag; ClaimProcCur=new ClaimProc(); ClaimProcCur.ProcNum=ProcCur.ProcNum; ClaimProcCur.ClaimNum=ClaimCur.ClaimNum; ClaimProcCur.PatNum=PatCur.PatNum; ClaimProcCur.ProvNum=ProcCur.ProvNum; ClaimProcCur.Status=ClaimProcStatus.Preauth; ClaimProcCur.FeeBilled=ProcCur.ProcFee; ClaimProcCur.PlanNum=FormIPS.SelectedPlan.PlanNum; ClaimProcCur.InsSubNum=FormIPS.SelectedSub.InsSubNum; cpExisting=ClaimProcs.GetEstimate(ClaimProcList,ProcCur.ProcNum,FormIPS.SelectedPlan.PlanNum,FormIPS.SelectedSub.InsSubNum); if(cpExisting!=null){ ClaimProcCur.InsPayEst=cpExisting.InsPayEst; } if(FormIPS.SelectedPlan.UseAltCode && (ProcedureCodes.GetProcCode(ProcCur.CodeNum).AlternateCode1!="")){ ClaimProcCur.CodeSent=ProcedureCodes.GetProcCode(ProcCur.CodeNum).AlternateCode1; } else if(FormIPS.SelectedPlan.IsMedical && ProcCur.MedicalCode!=""){ ClaimProcCur.CodeSent=ProcCur.MedicalCode; } else{ ClaimProcCur.CodeSent=ProcedureCodes.GetStringProcCode(ProcCur.CodeNum); if(ClaimProcCur.CodeSent.Length>5 && ClaimProcCur.CodeSent.Substring(0,1)=="D"){ ClaimProcCur.CodeSent=ClaimProcCur.CodeSent.Substring(0,5); } if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA if(ClaimProcCur.CodeSent.Length>5) { //In Canadian electronic claims, codes can contain letters or numbers and cannot be longer than 5 characters. ClaimProcCur.CodeSent=ClaimProcCur.CodeSent.Substring(0,5); } } } ClaimProcCur.LineNumber=(byte)(i+1); ClaimProcs.Insert(ClaimProcCur); //ProcCur.Update(ProcOld); } ProcList=Procedures.Refresh(PatCur.PatNum); //ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum); ClaimL.CalculateAndUpdate(ProcList,InsPlanList,ClaimCur,PatPlanList,BenefitList,PatCur.Age,SubList); FormClaimEdit FormCE=new FormClaimEdit(ClaimCur,PatCur,FamCur); //FormCE.CalculateEstimates( FormCE.IsNew=true;//this causes it to delete the claim if cancelling. FormCE.ShowDialog(); ModuleSelected(PatCur.PatNum); }
private void menuInsSec_Click(object sender, System.EventArgs e) { if(!CheckClearinghouseDefaults()) { return; } List <PatPlan> PatPlanList=PatPlans.Refresh(PatCur.PatNum); List<InsSub> SubList=InsSubs.RefreshForFam(FamCur); List<InsPlan> InsPlanList=InsPlans.RefreshForSubList(SubList); List<ClaimProc> ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum); List <Benefit> BenefitList=Benefits.Refresh(PatPlanList,SubList); List<Procedure> procsForPat=Procedures.Refresh(PatCur.PatNum); if(PatPlanList.Count<2){ MessageBox.Show(Lan.g(this,"Patient does not have secondary insurance.")); return; } if(PatPlans.GetOrdinal(PriSecMed.Secondary,PatPlanList,InsPlanList,SubList)==0) { MsgBox.Show(this,"Patient does not have secondary insurance."); return; } if(gridAccount.SelectedIndices.Length==0){ MessageBox.Show(Lan.g(this,"Please select procedures first.")); return; } DataTable table=DataSetMain.Tables["account"]; bool allAreProcedures=true; for(int i=0;i<gridAccount.SelectedIndices.Length;i++){ if(table.Rows[gridAccount.SelectedIndices[i]]["ProcNum"].ToString()=="0"){ allAreProcedures=false; } } if(!allAreProcedures){ MessageBox.Show(Lan.g(this,"You can only select procedures.")); return; } //At this point, all selected items are procedures. InsCanadaValidateProcs(procsForPat,table); Claim ClaimCur=CreateClaim("S",PatPlanList,InsPlanList,ClaimProcList,procsForPat,SubList); if(ClaimCur.ClaimNum==0){ ModuleSelected(PatCur.PatNum); return; } ClaimCur.ClaimStatus="W"; ClaimCur.DateSent=DateTimeOD.Today; ClaimL.CalculateAndUpdate(procsForPat,InsPlanList,ClaimCur,PatPlanList,BenefitList,PatCur.Age,SubList); FormClaimEdit FormCE=new FormClaimEdit(ClaimCur,PatCur,FamCur); FormCE.IsNew=true;//this causes it to delete the claim if cancelling. FormCE.ShowDialog(); ModuleSelected(PatCur.PatNum); }
private void menuInsMedical_Click(object sender, System.EventArgs e) { if(!CheckClearinghouseDefaults()) { return; } List <PatPlan> PatPlanList=PatPlans.Refresh(PatCur.PatNum); List<InsSub> SubList=InsSubs.RefreshForFam(FamCur); List<InsPlan> InsPlanList=InsPlans.RefreshForSubList(SubList); List<ClaimProc> ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum); List <Benefit> BenefitList=Benefits.Refresh(PatPlanList,SubList); List<Procedure> procsForPat=Procedures.Refresh(PatCur.PatNum); long medSubNum=0; for(int i=0;i<PatPlanList.Count;i++){ InsSub sub=InsSubs.GetSub(PatPlanList[i].InsSubNum,SubList); if(InsPlans.GetPlan(sub.PlanNum,InsPlanList).IsMedical){ medSubNum=sub.InsSubNum; break; } } if(medSubNum==0){ MsgBox.Show(this,"Patient does not have medical insurance."); return; } DataTable table=DataSetMain.Tables["account"]; Procedure proc; if(gridAccount.SelectedIndices.Length==0){ //autoselect procedures for(int i=0;i<table.Rows.Count;i++){//loop through every line showing on screen if(table.Rows[i]["ProcNum"].ToString()=="0"){ continue;//ignore non-procedures } proc=Procedures.GetProcFromList(procsForPat,PIn.Long(table.Rows[i]["ProcNum"].ToString())); if(proc.ProcFee==0){ continue;//ignore zero fee procedures, but user can explicitly select them } if(proc.MedicalCode==""){ continue;//ignore non-medical procedures } if(Procedures.NeedsSent(proc.ProcNum,medSubNum,ClaimProcList)) { gridAccount.SetSelected(i,true); } } if(gridAccount.SelectedIndices.Length==0){//if still none selected MsgBox.Show(this,"Please select procedures first."); return; } } bool allAreProcedures=true; for(int i=0;i<gridAccount.SelectedIndices.Length;i++){ if(table.Rows[gridAccount.SelectedIndices[i]]["ProcNum"].ToString()=="0"){ allAreProcedures=false; } } if(!allAreProcedures){ MsgBox.Show(this,"You can only select procedures."); return; } Claim ClaimCur=CreateClaim("Med",PatPlanList,InsPlanList,ClaimProcList,procsForPat,SubList); if(ClaimCur.ClaimNum==0){ ModuleSelected(PatCur.PatNum); return; } ClaimCur.ClaimStatus="W"; ClaimCur.DateSent=DateTimeOD.Today; ClaimL.CalculateAndUpdate(procsForPat,InsPlanList,ClaimCur,PatPlanList,BenefitList,PatCur.Age,SubList); //still have not saved some changes to the claim at this point FormClaimEdit FormCE=new FormClaimEdit(ClaimCur,PatCur,FamCur); FormCE.IsNew=true;//this causes it to delete the claim if cancelling. FormCE.ShowDialog(); ModuleSelected(PatCur.PatNum); }
private void toolBarButIns_Click() { if(!CheckClearinghouseDefaults()) { return; } List <PatPlan> PatPlanList=PatPlans.Refresh(PatCur.PatNum); List<InsSub> SubList=InsSubs.RefreshForFam(FamCur); List<InsPlan> InsPlanList=InsPlans.RefreshForSubList(SubList); List<ClaimProc> ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum); List <Benefit> BenefitList=Benefits.Refresh(PatPlanList,SubList); List<Procedure> procsForPat=Procedures.Refresh(PatCur.PatNum); if(PatPlanList.Count==0){ MsgBox.Show(this,"Patient does not have insurance."); return; } int countSelected=0; DataTable table=DataSetMain.Tables["account"]; InsPlan plan; InsSub sub; if(gridAccount.SelectedIndices.Length==0){ //autoselect procedures for(int i=0;i<table.Rows.Count;i++){//loop through every line showing on screen if(table.Rows[i]["ProcNum"].ToString()=="0"){ continue;//ignore non-procedures } if((decimal)table.Rows[i]["chargesDouble"]==0){ continue;//ignore zero fee procedures, but user can explicitly select them } Procedure proc=Procedures.GetProcFromList(procsForPat,PIn.Long(table.Rows[i]["ProcNum"].ToString())); ProcedureCode procCode=ProcedureCodes.GetProcCodeFromDb(proc.CodeNum); if(procCode.IsCanadianLab) { continue; } int ordinal=PatPlans.GetOrdinal(PriSecMed.Primary,PatPlanList,InsPlanList,SubList); if(ordinal==0) { //No primary dental plan. Must be a medical plan. Use the first medical plan instead. ordinal=1; } sub=InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList,ordinal),SubList); if(Procedures.NeedsSent(proc.ProcNum,sub.InsSubNum,ClaimProcList)){ if(CultureInfo.CurrentCulture.Name.EndsWith("CA") && countSelected==7) {//Canadian. en-CA or fr-CA MsgBox.Show(this,"Only the first 7 procedures will be automatically selected. You will need to create another claim for the remaining procedures."); continue;//only send 7. } countSelected++; gridAccount.SetSelected(i,true); } } if(gridAccount.SelectedIndices.Length==0){//if still none selected MessageBox.Show(Lan.g(this,"Please select procedures first.")); return; } } bool allAreProcedures=true; for(int i=0;i<gridAccount.SelectedIndices.Length;i++){ if(table.Rows[gridAccount.SelectedIndices[i]]["ProcNum"].ToString()=="0"){ allAreProcedures=false; } } if(!allAreProcedures){ MsgBox.Show(this,"You can only select procedures."); return; } //At this point, all selected items are procedures. InsCanadaValidateProcs(procsForPat,table); string claimType="P"; if(PatPlanList.Count==1 && PatPlans.GetOrdinal(PriSecMed.Medical,PatPlanList,InsPlanList,SubList)>0) {//if there's exactly one medical plan claimType="Med"; } Claim ClaimCur=CreateClaim(claimType,PatPlanList,InsPlanList,ClaimProcList,procsForPat,SubList); ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum); if(ClaimCur.ClaimNum==0){ ModuleSelected(PatCur.PatNum); return; } ClaimCur.ClaimStatus="W"; ClaimCur.DateSent=DateTimeOD.Today; ClaimL.CalculateAndUpdate(procsForPat,InsPlanList,ClaimCur,PatPlanList,BenefitList,PatCur.Age,SubList); FormClaimEdit FormCE=new FormClaimEdit(ClaimCur,PatCur,FamCur); FormCE.IsNew=true;//this causes it to delete the claim if cancelling. FormCE.ShowDialog(); if(FormCE.DialogResult!=DialogResult.OK){ ModuleSelected(PatCur.PatNum); return;//will have already been deleted } if(PatPlans.GetOrdinal(PriSecMed.Secondary,PatPlanList,InsPlanList,SubList)>0 //if there exists a secondary plan && !CultureInfo.CurrentCulture.Name.EndsWith("CA"))//And not Canada (don't create secondary claim for Canada) { sub=InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList,PatPlans.GetOrdinal(PriSecMed.Secondary,PatPlanList,InsPlanList,SubList)),SubList); plan=InsPlans.GetPlan(sub.PlanNum,InsPlanList); ClaimCur=CreateClaim("S",PatPlanList,InsPlanList,ClaimProcList,procsForPat,SubList); if(ClaimCur.ClaimNum==0){ ModuleSelected(PatCur.PatNum); return; } ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum); ClaimCur.ClaimStatus="H"; ClaimL.CalculateAndUpdate(procsForPat,InsPlanList,ClaimCur,PatPlanList,BenefitList,PatCur.Age,SubList); } ModuleSelected(PatCur.PatNum); }
private void gridAccount_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) { if(ViewingInRecall) return; Actscrollval=gridAccount.ScrollValue; DataTable table=DataSetMain.Tables["account"]; if(table.Rows[e.Row]["ProcNum"].ToString()!="0"){ Procedure proc=Procedures.GetOneProc(PIn.Long(table.Rows[e.Row]["ProcNum"].ToString()),true); Patient pat=FamCur.GetPatient(proc.PatNum); FormProcEdit FormPE=new FormProcEdit(proc,pat,FamCur); FormPE.ShowDialog(); } else if(table.Rows[e.Row]["AdjNum"].ToString()!="0"){ Adjustment adj=Adjustments.GetOne(PIn.Long(table.Rows[e.Row]["AdjNum"].ToString())); FormAdjust FormAdj=new FormAdjust(PatCur,adj); FormAdj.ShowDialog(); } else if(table.Rows[e.Row]["PayNum"].ToString()!="0"){ Payment PaymentCur=Payments.GetPayment(PIn.Long(table.Rows[e.Row]["PayNum"].ToString())); /* if(PaymentCur.PayType==0){//provider income transfer FormProviderIncTrans FormPIT=new FormProviderIncTrans(); FormPIT.PatNum=PatCur.PatNum; FormPIT.PaymentCur=PaymentCur; FormPIT.IsNew=false; FormPIT.ShowDialog(); } else{*/ FormPayment FormPayment2=new FormPayment(PatCur,FamCur,PaymentCur); FormPayment2.IsNew=false; FormPayment2.ShowDialog(); //} } else if(table.Rows[e.Row]["ClaimNum"].ToString()!="0"){//claims and claimpayments Claim claim=Claims.GetClaim(PIn.Long(table.Rows[e.Row]["ClaimNum"].ToString())); Patient pat=FamCur.GetPatient(claim.PatNum); FormClaimEdit FormClaimEdit2=new FormClaimEdit(claim,pat,FamCur); FormClaimEdit2.IsNew=false; FormClaimEdit2.ShowDialog(); } else if(table.Rows[e.Row]["StatementNum"].ToString()!="0"){ Statement stmt=Statements.CreateObject(PIn.Long(table.Rows[e.Row]["StatementNum"].ToString())); FormStatementOptions FormS=new FormStatementOptions(); FormS.StmtCur=stmt; FormS.ShowDialog(); } else if(table.Rows[e.Row]["PayPlanNum"].ToString()!="0"){ PayPlan payplan=PayPlans.GetOne(PIn.Long(table.Rows[e.Row]["PayPlanNum"].ToString())); FormPayPlan2=new FormPayPlan(PatCur,payplan); FormPayPlan2.ShowDialog(); if(FormPayPlan2.GotoPatNum!=0){ ModuleSelected(FormPayPlan2.GotoPatNum,false); return; } } bool isSelectingFamily=gridAcctPat.GetSelectedIndex()==this.DataSetMain.Tables["patient"].Rows.Count-1; ModuleSelected(PatCur.PatNum,isSelectingFamily); }
private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) { Claim claim=Claims.GetClaim(PIn.Long(Table.Rows[e.Row]["ClaimNum"].ToString())); Patient pat=Patients.GetPat(claim.PatNum); Family fam=Patients.GetFamily(pat.PatNum); FormClaimEdit FormCE=new FormClaimEdit(claim,pat,fam); FormCE.IsNew=false; FormCE.ShowDialog(); }
private void gridClaimDetails_CellDoubleClick(object sender,ODGridClickEventArgs e) { Hx835_Claim claimPaid=(Hx835_Claim)gridClaimDetails.Rows[e.Row].Tag; Claim claim=claimPaid.GetClaimFromDb(); if(claimPaid.IsSplitClaim && (claim==null || claim.ClaimStatus!="R")) { if(MessageBox.Show(Lan.g(this,"The insurance carrier has split the claim")+". " +Lan.g(this,"You must manually locate and split the claim before entering the payment information")+". " +Lan.g(this,"Continue entering payment")+"?","",MessageBoxButtons.OKCancel)!=DialogResult.OK) { return; } } bool isReadOnly=true; if(claim==null) {//Original claim not found. MessageBox.Show(Lan.g(this,"Original claim not found")+". "+Lan.g(this,"The claim details from the EOB will be displayed instead")+". " +Lan.g(this,"Locate the Claim Identifier on the EOB and manually edit the Claim Identifier of the original claim to match, then try again")+"."); } else if(claim.ClaimStatus=="R") {//Claim found and is already received. //If the claim is already received, then we do not allow the user to enter payments. //The user can edit the claim to change the status from received if they wish to enter the payments again. Patient pat=Patients.GetPat(claim.PatNum); Family fam=Patients.GetFamily(claim.PatNum); FormClaimEdit formCE=new FormClaimEdit(claim,pat,fam); formCE.ShowDialog(); isReadOnly=false; } else if(Security.IsAuthorized(Permissions.InsPayCreate)) {//Claim found and is not received. Date not checked here, but it will be checked when actually creating the check. EnterPayment(claimPaid,claim,false); isReadOnly=false; } if(isReadOnly) { FormEtrans835ClaimEdit formC=new FormEtrans835ClaimEdit(claimPaid); formC.ShowDialog(this); } else { claim=claimPaid.GetClaimFromDb();//Refresh the claim, since the claim status might have changed above. if(claim.ClaimStatus=="R") { gridClaimDetails.Rows[e.Row].Cells[0].Text="X";//Indicate that payment is Received. } else { gridClaimDetails.Rows[e.Row].Cells[0].Text="";//Indicate that payment is not Received. } } }
private void gridCharges_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) { if(gridCharges.Rows[e.Row].Tag==null) {//Prevent double clicking on the "Current Totals" row return; } if(gridCharges.Rows[e.Row].Tag.GetType()==typeof(PayPlanCharge)){ PayPlanCharge payPlanCharge=(PayPlanCharge)gridCharges.Rows[e.Row].Tag; FormPayPlanChargeEdit FormP=new FormPayPlanChargeEdit(payPlanCharge);//This automatically takes care of our in-memory list because the Tag is referencing our list of objects. FormP.ShowDialog(); if(FormP.DialogResult==DialogResult.Cancel){ return; } if(FormP.PayPlanChargeCur==null) {//The user deleted the payplancharge. _listPayPlanCharges.Remove(payPlanCharge);//We know the payPlanCharge object is inside _listPayPlanCharges. gridCharges.BeginUpdate(); gridCharges.Rows.RemoveAt(e.Row); gridCharges.EndUpdate(); return; } } else if(gridCharges.Rows[e.Row].Tag.GetType()==typeof(PaySplit)){ PaySplit paySplit=(PaySplit)gridCharges.Rows[e.Row].Tag; FormPayment FormPayment2=new FormPayment(PatCur,FamCur,Payments.GetPayment(paySplit.PayNum));//FormPayment may inserts and/or update the paysplits. FormPayment2.IsNew=false; FormPayment2.ShowDialog(); if(FormPayment2.DialogResult==DialogResult.Cancel){ return; } } else if(gridCharges.Rows[e.Row].Tag.GetType()==typeof(DataRow)){//Claim payment or bundle. DataRow bundledClaimProc=(DataRow)gridCharges.Rows[e.Row].Tag; Claim claimCur=Claims.GetClaim(PIn.Long(bundledClaimProc["ClaimNum"].ToString())); FormClaimEdit FormCE=new FormClaimEdit(claimCur,PatCur,FamCur);//FormClaimEdit inserts and/or updates the claim and/or claimprocs, which could potentially change the bundle. FormCE.IsNew=false; FormCE.ShowDialog(); //Cancel from FormClaimEdit does not cancel payment edits, fill grid every time } FillCharges(); }