Ejemplo n.º 1
0
		private void butInsPlan2_Click(object sender,EventArgs e) {
			FormInsPlanSelect FormIPS=new FormInsPlanSelect(AptCur.PatNum);
			FormIPS.ShowNoneButton=true;
			FormIPS.ViewRelat=false;
			FormIPS.ShowDialog();
			if(FormIPS.DialogResult!=DialogResult.OK) {
				return;
			}
			if(FormIPS.SelectedPlan==null) {
				AptCur.InsPlan2=0;
				textInsPlan2.Text="";
				return;
			}
			AptCur.InsPlan2=FormIPS.SelectedPlan.PlanNum;
			textInsPlan2.Text=InsPlans.GetCarrierName(AptCur.InsPlan2,PlanList);
		}
Ejemplo n.º 2
0
		private void butOtherCovChange_Click(object sender, System.EventArgs e) {
			FormInsPlanSelect FormIPS=new FormInsPlanSelect(PatCur.PatNum);
			FormIPS.ShowDialog();
			if(FormIPS.DialogResult!=DialogResult.OK){
				return;
			}
			ClaimCur.PlanNum2=FormIPS.SelectedPlan.PlanNum;
			ClaimCur.InsSubNum2=FormIPS.SelectedSub.InsSubNum;
			textPlan2.Text=InsPlans.GetDescript(ClaimCur.PlanNum2,FamCur,PlanList,ClaimCur.InsSubNum2,SubList);
			if(textPlan2.Text==""){
				comboPatRelat2.Visible=false;
				label10.Visible=false;
			}
			else{
				comboPatRelat2.Visible=true;
				label10.Visible=true;
			}
		}
Ejemplo n.º 3
0
		private void butAddEstimate_Click(object sender, System.EventArgs e) {
			FormInsPlanSelect FormIS=new FormInsPlanSelect(PatCur.PatNum);
			FormIS.ShowDialog();
			if(FormIS.DialogResult==DialogResult.Cancel){
				return;
			}
			InsPlan plan=FormIS.SelectedPlan;
			InsSub sub=FormIS.SelectedSub;
			List <Benefit> benList=Benefits.Refresh(PatPlanList,SubList);
			ClaimProc cp=new ClaimProc();
			ClaimProcs.CreateEst(cp,ProcCur,plan,sub);
			if(plan.PlanType=="c") {//capitation
				double allowed=PIn.Double(textProcFee.Text);
				cp.BaseEst=allowed;
				cp.InsEstTotal=allowed;
				cp.CopayAmt=InsPlans.GetCopay(ProcCur.CodeNum,plan.FeeSched,plan.CopayFeeSched,plan.CodeSubstNone,ProcCur.ToothNum);
				if(cp.CopayAmt > allowed) {//if the copay is greater than the allowed fee calculated above
					cp.CopayAmt=allowed;//reduce the copay
				}
				if(cp.CopayAmt==-1) {
					cp.CopayAmt=0;
				}
				cp.WriteOffEst=cp.BaseEst-cp.CopayAmt;
				if(cp.WriteOffEst<0) {
					cp.WriteOffEst=0;
				}
				cp.WriteOff=cp.WriteOffEst;
				ClaimProcs.Update(cp);
			}
			long patPlanNum=PatPlans.GetPatPlanNum(sub.InsSubNum,PatPlanList);
			if(patPlanNum > 0){
				double paidOtherInsTotal=ClaimProcs.GetPaidOtherInsTotal(cp,PatPlanList);
				double writeOffOtherIns=ClaimProcs.GetWriteOffOtherIns(cp,PatPlanList);
				ClaimProcs.ComputeBaseEst(cp,ProcCur.ProcFee,ProcCur.ToothNum,ProcCur.CodeNum,plan,patPlanNum,benList,
					HistList,LoopList,PatPlanList,paidOtherInsTotal,paidOtherInsTotal,PatCur.Age,writeOffOtherIns);	
			}
			FormClaimProc FormC=new FormClaimProc(cp,ProcCur,FamCur,PatCur,PlanList,HistList,ref LoopList,PatPlanList,true,SubList);
			//FormC.NoPermission not needed because butAddEstimate not enabled
			FormC.ShowDialog();
			if(FormC.DialogResult==DialogResult.Cancel){
				ClaimProcs.Delete(cp);
			}
			FillIns();
		}
Ejemplo n.º 4
0
		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);
		}
Ejemplo n.º 5
0
 private void checkIns_Click(object sender, System.EventArgs e)
 {
     if(PayPlans.GetAmtPaid(PayPlanCur.PayPlanNum)!=0){
         MsgBox.Show(this,"Not allowed because payments are attached.");
         checkIns.Checked=!checkIns.Checked;
         return;
     }
     if(table.Rows.Count>0){
         MsgBox.Show(this,"Not allowed without first clearing the amortization schedule.");
         checkIns.Checked=!checkIns.Checked;
         return;
     }
     if(checkIns.Checked){
         FormInsPlanSelect FormI=new FormInsPlanSelect(PayPlanCur.PatNum);
         FormI.ShowDialog();
         if(FormI.DialogResult==DialogResult.Cancel){
             checkIns.Checked=false;
             return;
         }
         PayPlanCur.PlanNum=FormI.SelectedPlan.PlanNum;
         PayPlanCur.InsSubNum=FormI.SelectedSub.InsSubNum;
         PayPlanCur.Guarantor=PayPlanCur.PatNum;
         textInsPlan.Text=InsPlans.GetDescript(PayPlanCur.PlanNum,FamCur,InsPlanList,PayPlanCur.InsSubNum,SubList);
         labelGuarantor.Visible=false;
         textGuarantor.Visible=false;
         butGoToGuar.Visible=false;
         butChangeGuar.Visible=false;
         labelInsPlan.Visible=true;
         textInsPlan.Visible=true;
         butChangePlan.Visible=true;
     }
     else{//not insurance
         PayPlanCur.Guarantor=PayPlanCur.PatNum;
         textGuarantor.Text=Patients.GetLim(PayPlanCur.Guarantor).GetNameLF();
         PayPlanCur.PlanNum=0;
         PayPlanCur.InsSubNum=0;
         labelGuarantor.Visible=true;
         textGuarantor.Visible=true;
         butGoToGuar.Visible=true;
         butChangeGuar.Visible=true;
         labelInsPlan.Visible=false;
         textInsPlan.Visible=false;
         butChangePlan.Visible=false;
     }
 }
Ejemplo n.º 6
0
 private void butChangePlan_Click(object sender, System.EventArgs e)
 {
     FormInsPlanSelect FormI=new FormInsPlanSelect(PayPlanCur.PatNum);
     FormI.ShowDialog();
     if(FormI.DialogResult==DialogResult.Cancel){
         return;
     }
     PayPlanCur.PlanNum=FormI.SelectedPlan.PlanNum;
     PayPlanCur.InsSubNum=FormI.SelectedSub.InsSubNum;
     textInsPlan.Text=InsPlans.GetDescript(PayPlanCur.PlanNum,Patients.GetFamily(PayPlanCur.PatNum),new List <InsPlan> (),PayPlanCur.InsSubNum,new List<InsSub>());
 }