Пример #1
0
        private void FillProcedure()
        {
            if (_adjustmentCur.ProcNum == 0)
            {
                textProcDate2.Text       = "";
                textProcProv.Text        = "";
                textProcTooth.Text       = "";
                textProcDescription.Text = "";
                textProcFee.Text         = "";
                textProcWriteoff.Text    = "";
                textProcInsPaid.Text     = "";
                textProcInsEst.Text      = "";
                textProcAdj.Text         = "";
                textProcPatPaid.Text     = "";
                textProcAdjCur.Text      = "";
                labelProcRemain.Text     = "";
                _adjRemAmt = 0;
                return;
            }
            Procedure         procCur         = Procedures.GetOneProc(_adjustmentCur.ProcNum, false);
            List <ClaimProc>  listClaimProcs  = ClaimProcs.Refresh(procCur.PatNum);
            List <Adjustment> listAdjustments = Adjustments.Refresh(procCur.PatNum)
                                                .Where(x => x.ProcNum == procCur.ProcNum && x.AdjNum != _adjustmentCur.AdjNum).ToList();

            textProcDate.Text        = procCur.ProcDate.ToShortDateString();
            textProcDate2.Text       = procCur.ProcDate.ToShortDateString();
            textProcProv.Text        = Providers.GetAbbr(procCur.ProvNum);
            textProcTooth.Text       = Tooth.ToInternat(procCur.ToothNum);
            textProcDescription.Text = ProcedureCodes.GetProcCode(procCur.CodeNum).Descript;
            double procWO      = -ClaimProcs.ProcWriteoff(listClaimProcs, procCur.ProcNum);
            double procInsPaid = -ClaimProcs.ProcInsPay(listClaimProcs, procCur.ProcNum);
            double procInsEst  = -ClaimProcs.ProcEstNotReceived(listClaimProcs, procCur.ProcNum);
            double procAdj     = listAdjustments.Sum(x => x.AdjAmt);
            double procPatPaid = -PaySplits.GetTotForProc(procCur);

            textProcFee.Text      = procCur.ProcFeeTotal.ToString("F");
            textProcWriteoff.Text = procWO == 0?"":procWO.ToString("F");
            textProcInsPaid.Text  = procInsPaid == 0?"":procInsPaid.ToString("F");
            textProcInsEst.Text   = procInsEst == 0?"":procInsEst.ToString("F");
            textProcAdj.Text      = procAdj == 0?"":procAdj.ToString("F");
            textProcPatPaid.Text  = procPatPaid == 0?"":procPatPaid.ToString("F");
            //Intelligently sum the values above based on statuses instead of blindly adding all of the values together.
            //The remaining amount is typically called the "patient portion" so utilze the centralized method that gets the patient portion.
            decimal patPort    = ClaimProcs.GetPatPortion(procCur, listClaimProcs, listAdjustments);
            double  procAdjCur = 0;

            if (textAmount.errorProvider1.GetError(textAmount) == "")
            {
                if (listTypePos.SelectedIndex > -1)              //pos
                {
                    procAdjCur = PIn.Double(textAmount.Text);
                }
                else if (listTypeNeg.SelectedIndex > -1 || Defs.GetValue(DefCat.AdjTypes, _adjustmentCur.AdjType) == "dp")           //neg or discount plan
                {
                    procAdjCur = -PIn.Double(textAmount.Text);
                }
            }
            textProcAdjCur.Text = procAdjCur == 0?"":procAdjCur.ToString("F");
            //Add the current adjustment amount to the patient portion which will give the newly calculated remaining amount.
            _adjRemAmt           = (decimal)procAdjCur + (decimal)procPatPaid + patPort;
            labelProcRemain.Text = _adjRemAmt.ToString("c");
        }
Пример #2
0
        private void FillProcedure()
        {
            if (PaySplitCur.ProcNum == 0)
            {
                textProcDate2.Text       = "";
                textProcProv.Text        = "";
                textProcTooth.Text       = "";
                textProcDescription.Text = "";
                ProcFee               = 0;
                textProcFee.Text      = "";
                ProcInsPaid           = 0;
                textProcInsPaid.Text  = "";
                ProcInsEst            = 0;
                textProcInsEst.Text   = "";
                ProcAdj               = 0;
                textProcAdj.Text      = "";
                ProcPrevPaid          = 0;
                textProcPrevPaid.Text = "";
                ProcPaidHere          = 0;
                textProcPaidHere.Text = "";
                labelProcRemain.Text  = "";
                //butAttach.Enabled=true;
                //butDetach.Enabled=false;
                //ComputeProcTotals();
                return;
            }
            Procedure ProcCur = Procedures.GetOneProc(PaySplitCur.ProcNum, false);

            ClaimProc[]  ClaimProcList  = ClaimProcs.Refresh(ProcCur.PatNum);
            Adjustment[] AdjustmentList = Adjustments.Refresh(ProcCur.PatNum);
            PaySplit[]   PaySplitList   = PaySplits.Refresh(ProcCur.PatNum);
            textProcDate.Text        = ProcCur.ProcDate.ToShortDateString();
            textProcDate2.Text       = ProcCur.ProcDate.ToShortDateString();
            textProcProv.Text        = Providers.GetAbbr(ProcCur.ProvNum);
            textProcTooth.Text       = Tooth.ToInternat(ProcCur.ToothNum);
            textProcDescription.Text = ProcedureCodes.GetProcCode(ProcCur.ADACode).Descript;
            ProcFee     = ProcCur.ProcFee;
            ProcInsPaid = -ClaimProcs.ProcInsPay(ClaimProcList, ProcCur.ProcNum);
            ProcInsEst  = -ClaimProcs.ProcEstNotReceived(ClaimProcList, ProcCur.ProcNum);
            ProcAdj     = Adjustments.GetTotForProc(ProcCur.ProcNum, AdjustmentList);
            //next line will still work even if IsNew
            ProcPrevPaid     = -PaySplits.GetTotForProc(ProcCur.ProcNum, PaySplitList, PaySplitCur.SplitNum);
            textProcFee.Text = ProcFee.ToString("F");
            if (ProcInsPaid == 0)
            {
                textProcInsPaid.Text = "";
            }
            else
            {
                textProcInsPaid.Text = ProcInsPaid.ToString("F");
            }
            if (ProcInsEst == 0)
            {
                textProcInsEst.Text = "";
            }
            else
            {
                textProcInsEst.Text = ProcInsEst.ToString("F");
            }
            if (ProcAdj == 0)
            {
                textProcAdj.Text = "";
            }
            else
            {
                textProcAdj.Text = ProcAdj.ToString("F");
            }
            if (ProcPrevPaid == 0)
            {
                textProcPrevPaid.Text = "";
            }
            else
            {
                textProcPrevPaid.Text = ProcPrevPaid.ToString("F");
            }
            ComputeProcTotals();
            //butAttach.Enabled=false;
            //butDetach.Enabled=true;
        }