Exemplo n.º 1
0
 private void FillHeader()
 {
     Text = "Procedure Paid - Patient: " + _proc.ClaimPaid.PatientName;
     textProcAdjudicated.Text = _proc.ProcCodeAdjudicated;
     if (ProcedureCodes.IsValidCode(_proc.ProcCodeAdjudicated))
     {
         textProcAdjudicated.Text = _proc.ProcCodeAdjudicated + " - " + ProcedureCodes.GetProcCode(_proc.ProcCodeAdjudicated).AbbrDesc;
     }
     textProcSubmitted.Text = _proc.ProcCodeBilled;
     if (ProcedureCodes.IsValidCode(_proc.ProcCodeBilled))
     {
         textProcSubmitted.Text = _proc.ProcCodeBilled + " - " + ProcedureCodes.GetProcCode(_proc.ProcCodeBilled).AbbrDesc;
     }
     textDateService.Text = _proc.DateServiceStart.ToShortDateString();
     if (_proc.DateServiceEnd > _proc.DateServiceStart)
     {
         textDateService.Text += " to " + _proc.DateServiceEnd.ToShortDateString();
         textDateService.Width = 160;              //Increase width to accout for extra text.
     }
     textInsPaid.Text = _proc.InsPaid.ToString("f2");
     if (_proc.ProcNum == 0)
     {
         textProcNum.Text = "";
     }
     else
     {
         textProcNum.Text = _proc.ProcNum.ToString();
     }
     textProcFee.Text     = _proc.ProcFee.ToString("f2");
     textInsPaidCalc.Text = (_proc.ProcFee - _patRespSum - _contractualObligationSum - _payorInitiatedReductionSum - _otherAdjustmentSum).ToString("f2");
 }
Exemplo n.º 2
0
        private void FillTable()
        {
            int count = 0;

            AutoCodeItems.RefreshCache();
            AutoCodeConds.RefreshCache();
            _listAutoCodeConds = AutoCodeConds.GetDeepCopy();
            listForCode        = AutoCodeItems.GetListForCode(AutoCodeCur.AutoCodeNum);
            tbAutoItem.ResetRows(listForCode.Count);
            tbAutoItem.SetGridColor(Color.Gray);
            tbAutoItem.SetBackGColor(Color.White);
            for (int i = 0; i < listForCode.Count; i++)
            {
                tbAutoItem.Cell[0, i] = ProcedureCodes.GetProcCode(listForCode[i].CodeNum).ProcCode;
                tbAutoItem.Cell[1, i] = ProcedureCodes.GetProcCode(listForCode[i].CodeNum).Descript;
                count = 0;
                for (int j = 0; j < _listAutoCodeConds.Count; j++)
                {
                    if (_listAutoCodeConds[j].AutoCodeItemNum == listForCode[i].AutoCodeItemNum)
                    {
                        if (count != 0)
                        {
                            tbAutoItem.Cell[2, i] += ", ";
                        }
                        tbAutoItem.Cell[2, i] += _listAutoCodeConds[j].Cond.ToString();
                        count++;
                    }
                }
            }
            tbAutoItem.LayoutTables();
        }
 private void FormRepeatChargeEdit_Load(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         FormProcCodes FormP = new FormProcCodes();
         FormP.IsSelectionMode = true;
         FormP.ShowDialog();
         if (FormP.DialogResult != DialogResult.OK)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         ProcedureCode procCode = ProcedureCodes.GetProcCode(FormP.SelectedADA);
         if (procCode.TreatArea != TreatmentArea.Mouth)
         {
             MsgBox.Show(this, "Procedure codes that require tooth numbers are not allowed.");
             DialogResult = DialogResult.Cancel;
             return;
         }
         RepeatCur.ADACode = FormP.SelectedADA;
     }
     textADACode.Text   = RepeatCur.ADACode;
     textDesc.Text      = ProcedureCodes.GetProcCode(RepeatCur.ADACode).Descript;
     textChargeAmt.Text = RepeatCur.ChargeAmt.ToString("F");
     if (RepeatCur.DateStart.Year > 1880)
     {
         textDateStart.Text = RepeatCur.DateStart.ToShortDateString();
     }
     if (RepeatCur.DateStop.Year > 1880)
     {
         textDateStop.Text = RepeatCur.DateStop.ToShortDateString();
     }
     textNote.Text = RepeatCur.Note;
 }
Exemplo n.º 4
0
        private void FillTable()
        {
            int count = 0;

            AutoCodeItems.Refresh();
            AutoCodeConds.Refresh();
            AutoCodeItems.GetListForCode(AutoCodeCur.AutoCodeNum);
            tbAutoItem.ResetRows(AutoCodeItems.ListForCode.Length);
            tbAutoItem.SetGridColor(Color.Gray);
            tbAutoItem.SetBackGColor(Color.White);
            for (int i = 0; i < AutoCodeItems.ListForCode.Length; i++)
            {
                tbAutoItem.Cell[0, i] = ProcedureCodes.GetProcCode(AutoCodeItems.ListForCode[i].CodeNum).ProcCode;
                tbAutoItem.Cell[1, i] = ProcedureCodes.GetProcCode(AutoCodeItems.ListForCode[i].CodeNum).Descript;
                count = 0;
                for (int j = 0; j < AutoCodeConds.List.Length; j++)
                {
                    if (AutoCodeConds.List[j].AutoCodeItemNum == AutoCodeItems.ListForCode[i].AutoCodeItemNum)
                    {
                        if (count != 0)
                        {
                            tbAutoItem.Cell[2, i] += ", ";
                        }
                        tbAutoItem.Cell[2, i] += AutoCodeConds.List[j].Cond.ToString();
                        count++;
                    }
                }
            }
            tbAutoItem.LayoutTables();
        }
Exemplo n.º 5
0
        private void FormProcSelect_Load(object sender, System.EventArgs e)
        {
            Procedure[] entireList = Procedures.Refresh(PatNum);
            ArrayList   AL         = new ArrayList();

            for (int i = 0; i < entireList.Length; i++)
            {
                if (entireList[i].ProcStatus == ProcStat.C)
                {
                    AL.Add(entireList[i]);
                }
            }
            ProcedureList = new Procedure[AL.Count];
            AL.CopyTo(ProcedureList);
            tbProcs.ResetRows(ProcedureList.Length);
            tbProcs.SetGridColor(Color.LightGray);
            for (int i = 0; i < ProcedureList.Length; i++)
            {
                tbProcs.Cell[0, i] = ProcedureList[i].ProcDate.ToShortDateString();
                tbProcs.Cell[1, i] = Providers.GetAbbr(ProcedureList[i].ProvNum);
                tbProcs.Cell[2, i] = ProcedureCodes.GetStringProcCode(ProcedureList[i].CodeNum);
                tbProcs.Cell[3, i] = Tooth.ToInternat(ProcedureList[i].ToothNum);
                tbProcs.Cell[4, i] = ProcedureCodes.GetProcCode(ProcedureList[i].CodeNum).Descript;
                tbProcs.Cell[5, i] = ProcedureList[i].ProcFee.ToString("F");
            }
            tbProcs.LayoutTables();
        }
Exemplo n.º 6
0
        private void butEncCdt_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            if (!Security.IsAuthorized(Permissions.SecurityAdmin, false))
            {
                FormP.IsSelectionMode = false;
            }
            else
            {
                FormP.IsSelectionMode = true;
            }
            FormP.ShowDialog();
            if (FormP.DialogResult == DialogResult.OK)
            {
                NewEncCodeSystem            = "CDT";
                comboEncCodes.SelectedIndex = -1;
                ProcedureCode procCur = ProcedureCodes.GetProcCode(FormP.SelectedCodeNum);
                textEncCodeValue.Text    = procCur.ProcCode;
                textEncCodeDescript.Text = procCur.Descript;
                //We might implement a CodeSystem column on the ProcCode table since it may have ICD9 and ICD10 codes in it.  If so, we can set the NewEncCodeSystem to the value in that new column.
                //NewEncCodeSystem=procCur.CodeSystem;
                labelEncWarning.Visible = true;
            }
        }
Exemplo n.º 7
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            RepeatCharge[] chargeList = RepeatCharges.Refresh(0);
            int            countAdded = 0;
            DateTime       possibleDate;
            Procedure      proc;

            for (int i = 0; i < chargeList.Length; i++)
            {
                if (chargeList[i].DateStart > DateTime.Today)              //not started yet
                {
                    continue;
                }
                //if(chargeList[i].DateStop.Year>1880//not blank
                //	&& chargeList[i].DateStop<DateTime.Today)//but already ended
                //{
                //	continue;
                //}
                //get a list dates of all completed procedures with this Code and patNum
                ArrayList ALdates = RepeatCharges.GetDates(ProcedureCodes.GetCodeNum(chargeList[i].ProcCode), chargeList[i].PatNum);
                possibleDate = chargeList[i].DateStart;
                //start looping through possible dates, beginning with the start date of the repeating charge
                while (possibleDate <= DateTime.Today)
                {
                    if (possibleDate < DateTime.Today.AddMonths(-3))
                    {
                        possibleDate = possibleDate.AddMonths(1);
                        continue;                        //don't go back more than three months
                    }
                    //check to see if the possible date is present in the list
                    if (ALdates.Contains(possibleDate))
                    {
                        possibleDate = possibleDate.AddMonths(1);
                        continue;
                    }
                    if (chargeList[i].DateStop.Year > 1880 &&              //not blank
                        chargeList[i].DateStop < possibleDate)                           //but already ended
                    {
                        break;
                    }
                    //otherwise, insert a procedure to db
                    proc             = new Procedure();
                    proc.CodeNum     = ProcedureCodes.GetCodeNum(chargeList[i].ProcCode);
                    proc.DateEntryC  = DateTime.Today;
                    proc.PatNum      = chargeList[i].PatNum;
                    proc.ProcDate    = possibleDate;
                    proc.DateTP      = possibleDate;
                    proc.ProcFee     = chargeList[i].ChargeAmt;
                    proc.ProcStatus  = ProcStat.C;
                    proc.ProvNum     = PrefC.GetLong(PrefName.PracticeDefaultProv);
                    proc.MedicalCode = ProcedureCodes.GetProcCode(proc.CodeNum).MedicalCode;
                    proc.BaseUnits   = ProcedureCodes.GetProcCode(proc.CodeNum).BaseUnits;
                    Procedures.Insert(proc);                    //no recall synch needed because dental offices don't use this feature
                    countAdded++;
                    possibleDate = possibleDate.AddMonths(1);
                }
            }
            MessageBox.Show(countAdded.ToString() + " " + Lan.g(this, "procedures added."));
            DialogResult = DialogResult.OK;
        }
Exemplo n.º 8
0
        /// <summary>Returns true if ClaimProcAllowCreditsGreaterThanProcFee preference allows the user to add credits greater than the proc fee. Otherwise returns false </summary>
        private bool isClaimProcGreaterThanProcFee()
        {
            ClaimProcCreditsGreaterThanProcFee creditsGreaterPref = (ClaimProcCreditsGreaterThanProcFee)PrefC.GetInt(PrefName.ClaimProcAllowCreditsGreaterThanProcFee);

            if (creditsGreaterPref == ClaimProcCreditsGreaterThanProcFee.Allow)
            {
                return(true);
            }
            List <Procedure>  listProcs                 = Procedures.GetManyProc(ClaimProcsToEdit.Select(x => x.ProcNum).ToList(), false);
            List <ClaimProc>  listClaimProcsForPat      = ClaimProcs.Refresh(PatCur.PatNum);
            List <PaySplit>   listPaySplitForSelectedCP = PaySplits.GetPaySplitsFromProcs(ClaimProcsToEdit.Select(x => x.ProcNum).ToList());
            List <Adjustment> listAdjForSelectedCP      = Adjustments.GetForProcs(ClaimProcsToEdit.Select(x => x.ProcNum).ToList());
            bool          isCreditGreater               = false;
            List <string> listProcDescripts             = new List <string>();

            for (int i = 0; i < ClaimProcsToEdit.Length; i++)
            {
                ClaimProc claimProcCur = ClaimProcsToEdit[i];
                int       insPayIdx    = gridMain.ListGridColumns.GetIndex(Lan.g("TableClaimProc", "Ins Pay"));
                int       writeoffIdx  = gridMain.ListGridColumns.GetIndex(Lan.g("TableClaimProc", "Writeoff"));
                int       feeAcctIdx   = gridMain.ListGridColumns.GetIndex(Lan.g("TableClaimProc", "Fee"));
                decimal   insPayAmt    = (decimal)ClaimProcs.ProcInsPay(listClaimProcsForPat.FindAll(x => x.ClaimProcNum != claimProcCur.ClaimProcNum), claimProcCur.ProcNum)
                                         + PIn.Decimal(gridMain.ListGridRows[i].Cells[insPayIdx].Text);
                decimal writeOff = (decimal)ClaimProcs.ProcWriteoff(listClaimProcsForPat.FindAll(x => x.ClaimProcNum != claimProcCur.ClaimProcNum), claimProcCur.ProcNum)
                                   + PIn.Decimal(gridMain.ListGridRows[i].Cells[writeoffIdx].Text);
                decimal feeAcct   = PIn.Decimal(gridMain.ListGridRows[i].Cells[feeAcctIdx].Text);
                decimal adj       = listAdjForSelectedCP.Where(x => x.ProcNum == claimProcCur.ProcNum).Select(x => (decimal)x.AdjAmt).Sum();
                decimal patPayAmt = listPaySplitForSelectedCP.Where(x => x.ProcNum == claimProcCur.ProcNum).Select(x => (decimal)x.SplitAmt).Sum();
                //Any changes to this calculation should also consider FormClaimProc.IsClaimProcGreaterThanProcFee().
                decimal creditRem = feeAcct - patPayAmt - insPayAmt - writeOff + adj;
                isCreditGreater |= (creditRem.IsLessThanZero());
                if (creditRem.IsLessThanZero())
                {
                    Procedure proc = listProcs.FirstOrDefault(x => x.ProcNum == claimProcCur.ProcNum);
                    listProcDescripts.Add((proc == null ? "" : ProcedureCodes.GetProcCode(proc.CodeNum).ProcCode)
                                          + "\t" + Lan.g(this, "Fee") + ": " + feeAcct.ToString("F")
                                          + "\t" + Lan.g(this, "Credits") + ": " + (Math.Abs(-patPayAmt - insPayAmt - writeOff + adj)).ToString("F")
                                          + "\t" + Lan.g(this, "Remaining") + ": (" + Math.Abs(creditRem).ToString("F") + ")");
                }
            }
            if (!isCreditGreater)
            {
                return(true);
            }
            if (creditsGreaterPref == ClaimProcCreditsGreaterThanProcFee.Block)
            {
                MsgBoxCopyPaste msgBox = new MsgBoxCopyPaste(Lan.g(this, "Remaining amount is negative for the following procedures") + ":\r\n"
                                                             + string.Join("\r\n", listProcDescripts) + "\r\n" + Lan.g(this, "Not allowed to continue."));
                msgBox.Text = Lan.g(this, "Overpaid Procedure Warning");
                msgBox.ShowDialog();
                return(false);
            }
            if (creditsGreaterPref == ClaimProcCreditsGreaterThanProcFee.Warn)
            {
                return(MessageBox.Show(Lan.g(this, "Remaining amount is negative for the following procedures") + ":\r\n"
                                       + string.Join("\r\n", listProcDescripts.Take(10)) + "\r\n" + (listProcDescripts.Count > 10?"...\r\n":"") + Lan.g(this, "Continue?")
                                       , Lan.g(this, "Overpaid Procedure Warning"), MessageBoxButtons.OKCancel) == DialogResult.OK);
            }
            return(true);           //should never get to this line, only possible if another enum value is added to allow, warn, and block
        }
Exemplo n.º 9
0
 private void FormApptBreak_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.DialogResult != DialogResult.OK)
     {
         return;
     }
     SelectedProcCode = radioMissed.Checked?ProcedureCodes.GetProcCode("D9986"):ProcedureCodes.GetProcCode("D9987");
 }
Exemplo n.º 10
0
 private void FillProcs()
 {
     listProcs.Items.Clear();
     foreach (string procStr in _listCCProcs)
     {
         listProcs.Items.Add(procStr + "- " + ProcedureCodes.GetLaymanTerm(ProcedureCodes.GetProcCode(procStr).CodeNum));
     }
 }
Exemplo n.º 11
0
        private void butOK_Click(object sender, EventArgs e)
        {
            int   countProcsLinkedToOrthoCase = 0;
            float percent = 0;          //Placeholder

            if (!float.TryParse(textPercentage.Text, out percent))
            {
                MsgBox.Show(this, "Percent is invalid. Please enter a valid number to continue.");
                return;
            }
            bool hasDiscount = false;

            for (int i = 0; i < _listProcs.Count; i++)
            {
                if (_listProcs[i].Discount != 0)
                {
                    hasDiscount = true;
                    break;
                }
            }
            if (hasDiscount &&         //A discount exists for a procedure
                !MsgBox.Show(this, MsgBoxButtons.YesNo, "One or more of the selected procedures has a discount value already set.  This will overwrite current discount values with a new value.  Continue?"))
            {
                return;
            }
            List <long> listProcNumsLinkedToOrthoCases = OrthoProcLinks.GetManyForProcs(_listProcs.Select(x => x.ProcNum).ToList()).Select(y => y.ProcNum).ToList();

            for (int j = 0; j < _listProcs.Count; j++)
            {
                if (listProcNumsLinkedToOrthoCases.Contains(_listProcs[j].ProcNum))
                {
                    countProcsLinkedToOrthoCase++;
                }
                else if (percent == 0)
                {
                    _listProcs[j].Discount = 0;                  //Potentially clears out old discount.
                }
                else
                {
                    _listProcs[j].Discount = _listProcs[j].ProcFee * (percent / 100);
                }
                if (_listProcs[j].Discount != _oldListProcs[j].Discount)               //Discount was changed
                {
                    string message = Lan.g(this, "Discount created or changed from Treat Plan module for procedure")
                                     + ": " + ProcedureCodes.GetProcCode(_listProcs[j].CodeNum).ProcCode + "  " + Lan.g(this, "Dated")
                                     + ": " + _listProcs[j].ProcDate.ToShortDateString() + "  " + Lan.g(this, "With a Fee of") + ": " + _listProcs[j].ProcFee.ToString("c") + ".  " + Lan.g(this, "Attributed a") + " " + percent
                                     + " " + Lan.g(this, "percent discount, changing the discount value from") + " " + _oldListProcs[j].Discount.ToString("c") + " " + Lan.g(this, "to") + " " + _listProcs[j].Discount.ToString("c");
                    SecurityLogs.MakeLogEntry(Permissions.TreatPlanDiscountEdit, _listProcs[j].PatNum, message);
                }
                Procedures.Update(_listProcs[j], _oldListProcs[j]);
            }
            if (countProcsLinkedToOrthoCase > 0)
            {
                string countProcsSkipped = countProcsLinkedToOrthoCase.ToString();
                MessageBox.Show(this, Lans.g(this, "Procedures attached to ortho cases cannot have discounts. Procedures skipped:") + " " + countProcsSkipped);
            }
            DialogResult = DialogResult.OK;
        }
Exemplo n.º 12
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TableInvoiceItems", "Date"), 70);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "PatName"), 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Prov"), 55);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Code"), 55);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Tooth"), 50);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Description"), 150);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Fee"), 60, HorizontalAlignment.Right);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;
            List <ProcedureCode> listProcCodes = ProcedureCodes.GetAllCodes();

            foreach (DataRow tableRow in _tableSuperFamAcct.Rows)
            {
                row = new GridRow();
                row.Cells.Add(PIn.DateT(tableRow["Date"].ToString()).ToShortDateString());
                row.Cells.Add(tableRow["PatName"].ToString());
                row.Cells.Add(Providers.GetAbbr(PIn.Long(tableRow["Prov"].ToString())));
                if (!string.IsNullOrWhiteSpace(tableRow["AdjType"].ToString()))                             //It's an adjustment
                {
                    row.Cells.Add(Lan.g(this, "Adjust"));                                                   //Adjustment
                    row.Cells.Add(Tooth.ToInternat(tableRow["Tooth"].ToString()));
                    row.Cells.Add(Defs.GetName(DefCat.AdjTypes, PIn.Long(tableRow["AdjType"].ToString()))); //Adjustment type
                }
                else if (!string.IsNullOrWhiteSpace(tableRow["ChargeType"].ToString()))                     //It's a payplan charge
                {
                    if (PrefC.GetInt(PrefName.PayPlansVersion) != (int)PayPlanVersions.AgeCreditsAndDebits)
                    {
                        continue;                        //They can only attach debits to invoices and they can only do so if they're on version 2.
                    }
                    row.Cells.Add(Lan.g(this, "Pay Plan"));
                    row.Cells.Add(Tooth.ToInternat(tableRow["Tooth"].ToString()));
                    row.Cells.Add(PIn.Enum <PayPlanChargeType>(PIn.Int(tableRow["ChargeType"].ToString())).GetDescription()); //Pay Plan charge type
                }
                else                                                                                                          //It's a procedure
                {
                    ProcedureCode procCode = ProcedureCodes.GetProcCode(PIn.Long(tableRow["Code"].ToString()), listProcCodes);
                    row.Cells.Add(procCode.ProcCode);
                    row.Cells.Add(Tooth.ToInternat(tableRow["Tooth"].ToString()));
                    row.Cells.Add(procCode.Descript);
                }
                row.Cells.Add(PIn.Double(tableRow["Amount"].ToString()).ToString("F"));
                row.Tag = tableRow;
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Exemplo n.º 13
0
        ///<summary>Returns empty string if no duplicates, otherwise returns duplicate procedure information.  In all places where this is called, we are guaranteed to have the eCW bridge turned on.  So this is an eCW peculiarity rather than an HL7 restriction.  Other HL7 interfaces will not be checking for duplicate procedures unless we intentionally add that as a feature later.</summary>
        public static string ProcsContainDuplicates(List <Procedure> procs)
        {
            string           info         = "";
            List <Procedure> procsChecked = new List <Procedure>();

            for (int i = 0; i < procs.Count; i++)
            {
                Procedure     proc        = procs[i];
                ProcedureCode procCode    = ProcedureCodes.GetProcCode(procs[i].CodeNum);
                string        procCodeStr = procCode.ProcCode;
                if (procCodeStr.Length > 5 && procCodeStr.StartsWith("D"))
                {
                    procCodeStr = procCodeStr.Substring(0, 5);
                }
                for (int j = 0; j < procsChecked.Count; j++)
                {
                    Procedure     procDup        = procsChecked[j];
                    ProcedureCode procCodeDup    = ProcedureCodes.GetProcCode(procsChecked[j].CodeNum);
                    string        procCodeDupStr = procCodeDup.ProcCode;
                    if (procCodeDupStr.Length > 5 && procCodeDupStr.StartsWith("D"))
                    {
                        procCodeDupStr = procCodeDupStr.Substring(0, 5);
                    }
                    if (procCodeDupStr != procCodeStr)
                    {
                        continue;
                    }
                    if (procDup.ToothNum != proc.ToothNum)
                    {
                        continue;
                    }
                    if (procDup.ToothRange != proc.ToothRange)
                    {
                        continue;
                    }
                    if (procDup.ProcFee != proc.ProcFee)
                    {
                        continue;
                    }
                    if (procDup.Surf != proc.Surf)
                    {
                        continue;
                    }
                    if (info != "")
                    {
                        info += ", ";
                    }
                    info += procCodeDupStr;
                }
                procsChecked.Add(proc);
            }
            if (info != "")
            {
                info = Lan.g("ProcedureL", "Duplicate procedures") + ": " + info;
            }
            return(info);
        }
Exemplo n.º 14
0
 private void RefreshListBoxProcs()
 {
     listboxOrthoPlacementProcs.Items.Clear();
     foreach (long orthoProcCodeNum in _listOrthoPlacementCodeNums)
     {
         ProcedureCode             procCodeCur = ProcedureCodes.GetProcCode(orthoProcCodeNum);
         ODBoxItem <ProcedureCode> listBoxItem = new ODBoxItem <ProcedureCode>(procCodeCur.ProcCode, procCodeCur);
         listboxOrthoPlacementProcs.Items.Add(listBoxItem);
     }
 }
Exemplo n.º 15
0
 private void FormAutoCodeLessIntrusive_Load(object sender, System.EventArgs e)
 {
     //Moved from FormProcEdit.SaveAndClose() in version 16.3+
     labelMain.Text = ProcedureCodes.GetProcCode(_verifyCode).ProcCode
                      + " (" + ProcedureCodes.GetProcCode(_verifyCode).Descript + ") "
                      + Lan.g("FormProcEdit", "is the recommended procedure code for this procedure.  Change procedure code and fee?");
     if (PrefC.GetBool(PrefName.ProcEditRequireAutoCodes))
     {
         butNo.Text = Lan.g(this, "Edit Proc");             //Button will otherwise say 'No'.
     }
 }
Exemplo n.º 16
0
 private void FillProcedureBreakdown()
 {
     if (_claimPaid.ListProcs.Count == 0)
     {
         gridProcedureBreakdown.Title = "EOB Procedure Breakdown (None Reported)";
     }
     else
     {
         gridProcedureBreakdown.Title = "EOB Procedure Breakdown";
     }
     gridProcedureBreakdown.BeginUpdate();
     gridProcedureBreakdown.ListGridColumns.Clear();
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("ProcNum", 80, HorizontalAlignment.Left));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("ProcCode", 80, HorizontalAlignment.Center));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("ProcDescript", 0, HorizontalAlignment.Left));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("FeeBilled", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("InsPaid", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("PatPort", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("Deduct", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridColumns.Add(new GridColumn("Writeoff", 70, HorizontalAlignment.Right));
     gridProcedureBreakdown.ListGridRows.Clear();
     _procAdjAmtSum = 0;
     for (int i = 0; i < _claimPaid.ListProcs.Count; i++)
     {
         //Logic mimics SheetUtil.getTable_EraClaimsPaid(...)
         Hx835_Proc proc = _claimPaid.ListProcs[i];
         GridRow    row  = new GridRow();
         row.Tag = proc;
         if (proc.ProcNum == 0)
         {
             row.Cells.Add(new GridCell(""));                    //ProcNum
         }
         else
         {
             row.Cells.Add(new GridCell(proc.ProcNum.ToString()));             //ProcNum
         }
         row.Cells.Add(new GridCell(proc.ProcCodeAdjudicated));                //ProcCode
         string procDescript = "";
         if (ProcedureCodes.IsValidCode(proc.ProcCodeAdjudicated))
         {
             ProcedureCode procCode = ProcedureCodes.GetProcCode(proc.ProcCodeAdjudicated);
             procDescript = procCode.AbbrDesc;
         }
         row.Cells.Add(new GridCell(procDescript));                          //ProcDescript
         row.Cells.Add(new GridCell(proc.ProcFee.ToString("f2")));           //FeeBilled
         row.Cells.Add(new GridCell(proc.InsPaid.ToString("f2")));           //InsPaid
         row.Cells.Add(new GridCell(proc.PatientPortionAmt.ToString("f2"))); //PatPort
         row.Cells.Add(new GridCell(proc.DeductibleAmt.ToString("f2")));     //Deduct
         row.Cells.Add(new GridCell(proc.WriteoffAmt.ToString("f2")));       //Writeoff
         gridProcedureBreakdown.ListGridRows.Add(row);
     }
     gridProcedureBreakdown.EndUpdate();
     textProcAdjAmtSum.Text = _procAdjAmtSum.ToString("f2");
 }
Exemplo n.º 17
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (textDate.errorProvider1.GetError(textDate) != "")
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     if (textDate.Text != "")
     {
         DateTime    procDate = PIn.Date(textDate.Text);
         Appointment apt;
         for (int i = 0; i < ProcList.Count; i++)
         {
             if (ProcList[i].AptNum == 0)
             {
                 continue;
             }
             apt = Appointments.GetOneApt(ProcList[i].AptNum);
             if (ProcList[i].ProcDate != procDate)
             {
                 if (!MsgBox.Show(this, true, "Date does not match appointment date.  Continue anyway?"))
                 {
                     return;
                 }
                 break;
             }
         }
         for (int i = 0; i < ProcList.Count; i++)
         {
             ProcList[i].ProcDate = procDate;
             Procedures.Update(ProcList[i], ProcOldList[i]);
         }
         Recalls.Synch(ProcList[0].PatNum);
         if (AnyAreC)
         {
             Patient       pat   = Patients.GetPat(ProcList[0].PatNum);
             string        codes = "";
             ProcedureCode ProcedureCode2;
             for (int i = 0; i < ProcList.Count; i++)
             {
                 if (i > 0)
                 {
                     codes += ", ";
                 }
                 ProcedureCode2 = ProcedureCodes.GetProcCode(ProcList[i].CodeNum);
                 codes         += ProcedureCode2.ProcCode;
             }
             SecurityLogs.MakeLogEntry(Permissions.ProcComplEdit, ProcList[0].PatNum,
                                       pat.GetNameLF() + codes + ", New date:" + procDate.ToShortDateString());
         }
     }
     DialogResult = DialogResult.OK;
 }
Exemplo n.º 18
0
        private void butPickProc_Click(object sender, EventArgs e)
        {
            FormProcCodes FormPC = new FormProcCodes();

            FormPC.IsSelectionMode = true;
            FormPC.ShowDialog();
            if (FormPC.DialogResult != DialogResult.OK)
            {
                return;
            }
            textProcedureCode.Text = ProcedureCodes.GetProcCode(FormPC.SelectedCodeNum).ProcCode;
        }
Exemplo n.º 19
0
        private void FillGrid()
        {
            //Changes made in this window do not get saved until after this window closes.
            //But if you double click on a row, then you will end up saving.  That shouldn't hurt anything, but could be improved.
            //also calculates totals for this "payment"
            //the payment itself is imaginary and is simply the sum of the claimprocs on this form
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col;

            if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum))
            {
                col = new GridColumn(Lan.g(this, "Code"), 85);
                gridMain.ListGridColumns.Add(col);
            }
            else
            {
                col = new GridColumn(Lan.g(this, "Code"), 50);
                gridMain.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g(this, "Tth"), 35);
                gridMain.ListGridColumns.Add(col);
            }
            col = new GridColumn(Lan.g(this, "Description"), 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Fee"), 55, HorizontalAlignment.Right);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Estimate"), 55, HorizontalAlignment.Right, true);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Remarks"), 170, true);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow   row;
            Procedure ProcCur;

            for (int i = 0; i < ClaimProcsToEdit.Count; i++)
            {
                row = new GridRow();
                //for pre-auths, there are no total payments, so ProcNum must be >0
                ProcCur = Procedures.GetProcFromList(ProcList, ClaimProcsToEdit[i].ProcNum);
                row.Cells.Add(ProcedureCodes.GetProcCode(ProcCur.CodeNum).ProcCode);
                if (!Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum))
                {
                    row.Cells.Add(Tooth.ToInternat(ProcCur.ToothNum));
                }
                row.Cells.Add(ProcedureCodes.GetProcCode(ProcCur.CodeNum).Descript);
                row.Cells.Add(ClaimProcsToEdit[i].FeeBilled.ToString("F"));
                row.Cells.Add(ClaimProcsToEdit[i].InsPayEst.ToString("F"));
                row.Cells.Add(ClaimProcsToEdit[i].Remarks);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
            FillTotals();
        }
Exemplo n.º 20
0
        private void butCdt_Click(object sender, EventArgs e)
        {
            FormProcCodes formPCs = new FormProcCodes();

            formPCs.IsSelectionMode = true;
            if (formPCs.ShowDialog() == DialogResult.OK)
            {
                _encCur.CodeSystem = "CDT";
                ProcedureCode procCode = ProcedureCodes.GetProcCode(formPCs.SelectedCodeNum);
                _encCur.CodeValue     = procCode.ProcCode;
                textCodeSystem.Text   = "CDT";
                textCodeValue.Text    = procCode.ProcCode;
                textCodeDescript.Text = procCode.Descript;
            }
        }
Exemplo n.º 21
0
        ///<summary>Resets the descriptions for all ADA codes to the official wording.  Required by the license.</summary>
        public static void ResetADAdescriptions(List <ProcedureCode> codeList)
        {
            ProcedureCode code;

            for (int i = 0; i < codeList.Count; i++)
            {
                if (!ProcedureCodes.IsValidCode(codeList[i].ProcCode))
                {
                    continue;
                }
                code          = ProcedureCodes.GetProcCode(codeList[i].ProcCode);
                code.Descript = codeList[i].Descript;
                ProcedureCodes.Update(code);
            }
            //don't forget to refresh procedurecodes.
        }
Exemplo n.º 22
0
 ///<summary>Gets the note for the given provider, if one exists.  Otherwise, gets the proccode.defaultnote.</summary>
 public static string GetNote(int provNum, int codeNum)
 {
     for (int i = 0; i < Listt.Count; i++)
     {
         if (Listt[i].ProvNum != provNum)
         {
             continue;
         }
         if (Listt[i].CodeNum != codeNum)
         {
             continue;
         }
         return(Listt[i].Note);
     }
     return(ProcedureCodes.GetProcCode(codeNum).DefaultNote);
 }
Exemplo n.º 23
0
 ///<summary>Gets the time pattern for the given provider, if one exists.  Otherwise, gets the proccode.ProcTime.</summary>
 public static string GetTimePattern(int provNum, int codeNum)
 {
     for (int i = 0; i < Listt.Count; i++)
     {
         if (Listt[i].ProvNum != provNum)
         {
             continue;
         }
         if (Listt[i].CodeNum != codeNum)
         {
             continue;
         }
         return(Listt[i].ProcTime);
     }
     return(ProcedureCodes.GetProcCode(codeNum).ProcTime);
 }
Exemplo n.º 24
0
        private void butEncCdt_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult == DialogResult.OK)
            {
                EncCodeSystem = "CDT";
                comboEncCodes.SelectedIndex = -1;
                ProcedureCode procCur = ProcedureCodes.GetProcCode(FormP.SelectedCodeNum);
                textEncCodeValue.Text    = procCur.ProcCode;
                textEncCodeDescript.Text = procCur.Descript;
                labelEncWarning.Visible  = true;
            }
        }
Exemplo n.º 25
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textProcDate.errorProvider1.GetError(textProcDate) != "" ||
                textAmount.errorProvider1.GetError(textAmount) != "")
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            if (textProcDate.Text == "")
            {
                MsgBox.Show(this, "Please enter a date first.");
                return;
            }
            if (_procCur.ProcStatus == ProcStat.C && PIn.Date(textProcDate.Text).Date > DateTime.Today.Date && !PrefC.GetBool(PrefName.FutureTransDatesAllowed))
            {
                MsgBox.Show(this, "Completed procedures cannot be set for future dates.");
                return;
            }
            if (textAmount.Text == "")
            {
                MsgBox.Show(this, "Please enter an amount.");
                return;
            }
            if (comboProv.GetSelectedProvNum() != _procOld.ProvNum && PrefC.GetBool(PrefName.ProcProvChangesClaimProcWithClaim))
            {
                List <ClaimProc> listClaimProc = ClaimProcs.GetForProc(ClaimProcs.Refresh(_procOld.PatNum), _procOld.ProcNum);
                if (listClaimProc.Any(x => x.Status == ClaimProcStatus.Received ||
                                      x.Status == ClaimProcStatus.Supplemental ||
                                      x.Status == ClaimProcStatus.CapClaim))
                {
                    MsgBox.Show(this, "The provider cannot be changed when this procedure is attached to a claim.");
                    return;
                }
            }
            _procCur.ProcDate    = PIn.Date(textProcDate.Text);
            _procCur.ProcFee     = PIn.Double(textAmount.Text);
            _procCur.Note        = textChartNotes.Text;
            _procCur.BillingNote = textAccountNotes.Text;
            _procCur.ProvNum     = comboProv.GetSelectedProvNum();
            _procCur.ClinicNum   = comboClinic.SelectedClinicNum;
            Procedures.Update(_procCur, _procOld);
            ProcedureCode procedureCode = ProcedureCodes.GetProcCode(_procCur.CodeNum);
            string        logText       = procedureCode.ProcCode + " (" + _procCur.ProcStatus + "), " + Lan.g(this, "Fee") + ": " + _procCur.ProcFee.ToString("c") + ", " + procedureCode.Descript;

            SecurityLogs.MakeLogEntry(IsNew ? Permissions.ProcComplCreate : Permissions.ProcComplEdit, _procCur.PatNum, logText);
            DialogResult = DialogResult.OK;
        }
Exemplo n.º 26
0
        private void FillProcs()
        {
            listProcs.Items.Clear();
            if (RecallTypeCur.Procedures == null || RecallTypeCur.Procedures == "")
            {
                return;
            }
            string[] strArray = RecallTypeCur.Procedures.Split(',');
            string   str;

            for (int i = 0; i < strArray.Length; i++)
            {
                str  = strArray[i];
                str += "- " + ProcedureCodes.GetLaymanTerm(ProcedureCodes.GetProcCode(str).CodeNum);
                listProcs.Items.Add(str);
            }
        }
Exemplo n.º 27
0
 private void FormRepeatChargeEdit_Load(object sender, System.EventArgs e)
 {
     //Set the title bar to show the patient's name much like the main screen does.
     this.Text += " - " + Patients.GetLim(RepeatCur.PatNum).GetNameLF();
     if (IsNew)
     {
         FormProcCodes FormP = new FormProcCodes();
         FormP.IsSelectionMode = true;
         FormP.ShowDialog();
         if (FormP.DialogResult != DialogResult.OK)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         ProcedureCode procCode = ProcedureCodes.GetProcCode(FormP.SelectedCodeNum);
         if (procCode.TreatArea != TreatmentArea.Mouth)
         {
             MsgBox.Show(this, "Procedure codes that require tooth numbers are not allowed.");
             DialogResult = DialogResult.Cancel;
             return;
         }
         RepeatCur.ProcCode     = ProcedureCodes.GetStringProcCode(FormP.SelectedCodeNum);
         RepeatCur.IsEnabled    = true;
         RepeatCur.CreatesClaim = false;
     }
     textCode.Text      = RepeatCur.ProcCode;
     textDesc.Text      = ProcedureCodes.GetProcCode(RepeatCur.ProcCode).Descript;
     textChargeAmt.Text = RepeatCur.ChargeAmt.ToString("F");
     if (RepeatCur.DateStart.Year > 1880)
     {
         textDateStart.Text = RepeatCur.DateStart.ToShortDateString();
     }
     if (RepeatCur.DateStop.Year > 1880)
     {
         textDateStop.Text = RepeatCur.DateStop.ToShortDateString();
     }
     textNote.Text = RepeatCur.Note;
     checkCopyNoteToProc.Checked = RepeatCur.CopyNoteToProc;
     checkCreatesClaim.Checked   = RepeatCur.CreatesClaim;
     checkIsEnabled.Checked      = RepeatCur.IsEnabled;
     if (PrefC.GetBool(PrefName.DistributorKey))             //OD HQ disable the IsEnabled and CreatesClaim checkboxes
     {
         checkCreatesClaim.Enabled = false;
         checkIsEnabled.Enabled    = false;
     }
 }
Exemplo n.º 28
0
        ///<summary>Returns true if InsPayNoWriteoffMoreThanProc preference is turned on and the sum of write off amount is greater than the proc fee.
        ///Otherwise returns false </summary>
        private bool IsWriteOffGreaterThanProcFee()
        {
            if (!PrefC.GetBool(PrefName.InsPayNoWriteoffMoreThanProc))
            {
                return(false);               //InsPayNoWriteoffMoreThanProc preference is off. No need to check.
            }
            List <ClaimProc>  listClaimProcsForPat  = ClaimProcs.Refresh(PatCur.PatNum);
            List <Adjustment> listAdjustmentsForPat = Adjustments.GetForProcs(ClaimProcsToEdit.Select(x => x.ProcNum).Where(x => x != 0).ToList());
            bool          isWriteoffGreater         = false;
            List <string> listProcDescripts         = new List <string>();

            for (int i = 0; i < ClaimProcsToEdit.Length; i++)
            {
                ClaimProc claimProcCur = ClaimProcsToEdit[i];
                //Fetch all adjustments for the given procedure.
                List <Adjustment> listClaimProcAdjustments = listAdjustmentsForPat.Where(x => x.ProcNum == claimProcCur.ProcNum).ToList();
                int     writeoffIdx = gridMain.ListGridColumns.GetIndex(Lan.g("TableClaimProc", "Writeoff"));
                int     feeAcctIdx  = gridMain.ListGridColumns.GetIndex(Lan.g("TableClaimProc", "Fee"));
                decimal writeOff    = (decimal)ClaimProcs.ProcWriteoff(listClaimProcsForPat.FindAll(x => x.ClaimProcNum != claimProcCur.ClaimProcNum), claimProcCur.ProcNum)
                                      + PIn.Decimal(gridMain.ListGridRows[i].Cells[writeoffIdx].Text);
                decimal feeAcct = PIn.Decimal(gridMain.ListGridRows[i].Cells[feeAcctIdx].Text);
                decimal adjAcct = listClaimProcAdjustments.Sum(x => (decimal)x.AdjAmt);
                //Any changes to this calculation should also consider FormClaimProc.IsWriteOffGreaterThanProc().
                decimal writeoffRem = feeAcct - writeOff + adjAcct;
                isWriteoffGreater |= (writeoffRem.IsLessThanZero() && writeOff.IsGreaterThanZero());
                if (writeoffRem.IsLessThanZero() && writeOff.IsGreaterThanZero())
                {
                    Procedure proc = Procedures.GetProcFromList(ProcList, claimProcCur.ProcNum);                 //will return a new procedure if none found.
                    listProcDescripts.Add((proc == null ? "" : ProcedureCodes.GetProcCode(proc.CodeNum).ProcCode)
                                          + "\t" + Lan.g(this, "Fee") + ": " + feeAcct.ToString("F")
                                          + "\t" + Lan.g(this, "Adjustments") + ": " + adjAcct.ToString("F")
                                          + "\t" + Lan.g(this, "Write-off") + ": " + (Math.Abs(-writeOff)).ToString("F")
                                          + "\t" + Lan.g(this, "Remaining") + ": (" + Math.Abs(writeoffRem).ToString("F") + ")");
                }
            }
            if (isWriteoffGreater)
            {
                MsgBoxCopyPaste msgBox = new MsgBoxCopyPaste(Lan.g(this, "Write-off amount is greater than the adjusted procedure fee for the following "
                                                                   + "procedure(s)") + ":\r\n" + string.Join("\r\n", listProcDescripts) + "\r\n" + Lan.g(this, "Not allowed to continue."));
                msgBox.Text = Lan.g(this, "Excessive Write-off");
                msgBox.ShowDialog();
                return(true);
            }
            return(false);
        }
Exemplo n.º 29
0
        private string ConstructSecurityLogForProcType(Procedure proc, Procedure procOld)
        {
            string logTextForProc = "";
            string code           = ProcedureCodes.GetProcCode(proc.CodeNum).ProcCode;
            string procDateStrOld = POut.Date(procOld.ProcDate);
            string procDateStrNew = POut.Date(proc.ProcDate);

            logTextForProc += SecurityLogEntryHelper(code, SecurityLogFields.ProcDate, procDateStrOld, procDateStrNew);
            string provNumStrOld = Providers.GetAbbr(procOld.ProvNum);
            string provNumStrNew = Providers.GetAbbr(proc.ProvNum);

            logTextForProc += SecurityLogEntryHelper(code, SecurityLogFields.ProvNum, provNumStrOld, provNumStrNew);
            string clinicNumStrOld = Clinics.GetAbbr(procOld.ClinicNum);
            string clinicNumStrNew = Clinics.GetAbbr(proc.ClinicNum);

            logTextForProc += SecurityLogEntryHelper(code, SecurityLogFields.ClinicNum, clinicNumStrOld, clinicNumStrNew);
            return(logTextForProc);
        }
Exemplo n.º 30
0
        private void butMaunal_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.ProcComplCreate))
            {
                return;
            }
            if (textChargeAmt.Text == null || textChargeAmt.Text == "")
            {
                MsgBox.Show(this, "You must first enter a charge amount.");
                return;
            }
            double procFee;

            try {
                procFee = Double.Parse(textChargeAmt.Text);
            }
            catch {
                MsgBox.Show(this, "Invalid charge amount.");
                return;
            }
            Procedures.SetDateFirstVisit(DateTime.Today, 1, Patients.GetPat(RepeatCur.PatNum));
            Procedure proc = new Procedure();

            proc.CodeNum        = ProcedureCodes.GetCodeNum(textCode.Text);
            proc.DateEntryC     = DateTimeOD.Today;
            proc.PatNum         = RepeatCur.PatNum;
            proc.ProcDate       = DateTimeOD.Today;
            proc.DateTP         = DateTimeOD.Today;
            proc.ProcFee        = procFee;
            proc.ProcStatus     = ProcStat.C;
            proc.ProvNum        = PrefC.GetLong(PrefName.PracticeDefaultProv);
            proc.MedicalCode    = ProcedureCodes.GetProcCode(proc.CodeNum).MedicalCode;
            proc.BaseUnits      = ProcedureCodes.GetProcCode(proc.CodeNum).BaseUnits;
            proc.DiagnosticCode = PrefC.GetString(PrefName.ICD9DefaultForNewProcs);
            //Check if the repeating charge has been flagged to copy it's note into the billing note of the procedure.
            if (RepeatCur.CopyNoteToProc)
            {
                proc.BillingNote = RepeatCur.Note;
            }
            Procedures.Insert(proc);
            Recalls.Synch(RepeatCur.PatNum);
            MsgBox.Show(this, "Procedure added.");
        }