예제 #1
0
        ///<summary>Retrieves data and uses them to create new PayPlanExtended objects.
        ///Heavy lifting (db calls and double loops) done here once upon load.  This also gets called if the user clicks "Refresh Data".</summary>
        private bool LoadData()
        {
            List <PayPlan>       listPayPlans;
            List <PayPlanCharge> listPayPlanCharges;
            List <ClaimProc>     listPayPlanClaimProcs;
            List <Patient>       listPatients;
            List <InsPlan>       listInsPlans;

            listPayPlans = PayPlans.GetAllOpenInsPayPlans();
            if (listPayPlans.Count == 0)
            {
                MsgBox.Show(this, "There are no insurance payment plans past due.");
                return(false);
            }
            listPayPlanCharges    = PayPlanCharges.GetForPayPlans(listPayPlans.Select(x => x.PayPlanNum).ToList()).Where(x => x.ChargeType == PayPlanChargeType.Debit).ToList();
            listPayPlanClaimProcs = ClaimProcs.GetForPayPlans(listPayPlans.Select(x => x.PayPlanNum).ToList()
                                                              , new List <ClaimProcStatus>()
            {
                ClaimProcStatus.Received, ClaimProcStatus.Supplemental
            });
            listPatients         = Patients.GetLimForPats(listPayPlans.Select(x => x.PatNum).ToList());
            listInsPlans         = InsPlans.GetPlans(listPayPlans.Select(x => x.PlanNum).ToList());
            _listPayPlanExtended = new List <PayPlanExtended>();
            foreach (PayPlan plan in listPayPlans)
            {
                //for each payplan, create a PayPlanExtended object which contains all of the payment plan's information and it's charges.
                //pass in the plan, the list of associated charges, and the list of associated claimprocs (payments).
                _listPayPlanExtended.Add(new PayPlanExtended(plan,
                                                             listPatients.FirstOrDefault(x => x.PatNum == plan.PatNum),
                                                             listPayPlanCharges.Where(x => x.PayPlanNum == plan.PayPlanNum).ToList(),
                                                             listPayPlanClaimProcs.Where(x => x.PayPlanNum == plan.PayPlanNum).ToList(),
                                                             listInsPlans.FirstOrDefault(x => x.PlanNum == plan.PlanNum)));
            }
            return(true);
        }
예제 #2
0
 private void FormPayPlanSelect_Load(object sender, System.EventArgs e)
 {
     if (_includeNone)
     {
         this.Text         = Lan.g(this, "Attach to payment plan?");
         labelExpl.Visible = true;
         butNone.Visible   = true;
     }
     _listPayPlanCharges = PayPlanCharges.GetForPayPlans(_listValidPayPlans.Select(x => x.PayPlanNum).ToList());
     FillGrid();
     gridMain.SetSelected(0, true);
 }
예제 #3
0
 private void FormCreditCardEdit_Load(object sender, EventArgs e)
 {
     _creditCardOld = CreditCardCur.Clone();
     FillFrequencyCombos();
     FillData();
     checkExcludeProcSync.Checked = CreditCardCur.ExcludeProcSync;
     if ((_isXChargeEnabled || _isPayConnectEnabled || _isPaySimpleEnabled) &&
         (!CreditCardCur.IsXWeb() && !CreditCardCur.IsPayConnectPortal()))
     {            //Get recurring payment plan information if using X-Charge or PayConnect and the card is not from XWeb or PayConnectPortal.
         PayPlanList = PayPlans.GetValidPlansNoIns(PatCur.PatNum);
         List <PayPlanCharge> chargeList = PayPlanCharges.GetForPayPlans(PayPlanList.Select(x => x.PayPlanNum).ToList());
         comboPaymentPlans.Items.Add("None");
         comboPaymentPlans.SelectedIndex = 0;
         for (int i = 0; i < PayPlanList.Count; i++)
         {
             comboPaymentPlans.Items.Add(PayPlans.GetTotalPrinc(PayPlanList[i].PayPlanNum, chargeList).ToString("F")
                                         + "  " + Patients.GetPat(PayPlanList[i].PatNum).GetNameFL());
             if (PayPlanList[i].PayPlanNum == CreditCardCur.PayPlanNum)
             {
                 comboPaymentPlans.SelectedIndex = i + 1;
             }
         }
         if (PrefC.IsODHQ)
         {
             groupProcedures.Visible = true;
             FillProcs();
         }
         else
         {
             this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 144);
         }
         UpdateFrequencyText();
         EnableFrequencyControls();
     }
     else              //This will hide the recurring section and change the window size.
     {
         groupRecurringCharges.Visible = false;
         groupChargeFrequency.Visible  = false;
         this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 486);
     }
     if (_isPaySimpleEnabled && !CreditCardCur.IsNew)
     {
         labelAcctType.Visible   = true;
         textAccountType.Visible = true;
     }
     checkChrgWithNoBal.Checked = CreditCardCur.CanChargeWhenNoBal;
     //Only visible if preference is on.
     checkChrgWithNoBal.Visible = PrefC.GetBool(PrefName.RecurringChargesAllowedWhenNoPatBal);
     Plugins.HookAddCode(this, "FormCreditCardEdit.Load_end", PatCur);
 }
예제 #4
0
 private void FormCreditCardEdit_Load(object sender, EventArgs e)
 {
     _creditCardOld = CreditCardCur.Clone();
     FillData();
     checkExcludeProcSync.Checked = CreditCardCur.ExcludeProcSync;
     if ((_isXChargeEnabled || _isPayConnectEnabled || _isPaySimpleEnabled) &&
         !CreditCardCur.IsXWeb())
     {            //Get recurring payment plan information if using X-Charge or PayConnect and the card is not from XWeb.
         PayPlanList = PayPlans.GetValidPlansNoIns(PatCur.PatNum);
         List <PayPlanCharge> chargeList = PayPlanCharges.GetForPayPlans(PayPlanList.Select(x => x.PayPlanNum).ToList());
         comboPaymentPlans.Items.Add("None");
         comboPaymentPlans.SelectedIndex = 0;
         for (int i = 0; i < PayPlanList.Count; i++)
         {
             comboPaymentPlans.Items.Add(PayPlans.GetTotalPrinc(PayPlanList[i].PayPlanNum, chargeList).ToString("F")
                                         + "  " + Patients.GetPat(PayPlanList[i].PatNum).GetNameFL());
             if (PayPlanList[i].PayPlanNum == CreditCardCur.PayPlanNum)
             {
                 comboPaymentPlans.SelectedIndex = i + 1;
             }
         }
         if (PrefC.IsODHQ)
         {
             groupProcedures.Visible = true;
             FillProcs();
         }
         else
         {
             this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 144);
         }
     }
     else              //This will hide the recurring section and change the window size.
     {
         groupRecurringCharges.Visible = false;
         this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 356);
     }
     if (_isPaySimpleEnabled && !CreditCardCur.IsNew)
     {
         textCardNumber.ReadOnly = true;
     }
     Plugins.HookAddCode(this, "FormCreditCardEdit.Load_end", PatCur);
 }