Esempio n. 1
0
        private string GetSignatureKey()
        {
            //ProcCur.Note was already assembled as it will appear in proc edit window.  We want to key on that.
            //Procs and proc groups are keyed differently
            string keyData;

            if (ProcedureCodes.GetStringProcCode(ProcCur.CodeNum) == ProcedureCodes.GroupProcCode)
            {
                keyData  = ProcCur.ProcDate.ToShortDateString();
                keyData += ProcCur.DateEntryC.ToShortDateString();
                keyData += ProcCur.UserNum.ToString();                                            //Security.CurUser.UserName;
                keyData += ProcCur.Note;
                List <ProcGroupItem> groupItemList = ProcGroupItems.GetForGroup(ProcCur.ProcNum); //Orders the list to ensure same key in all cases.
                for (int i = 0; i < groupItemList.Count; i++)
                {
                    keyData += groupItemList[i].ProcGroupItemNum.ToString();
                }
            }
            else              //regular proc
            {
                keyData = ProcCur.Note + ProcCur.UserNum.ToString();
            }
            //MsgBoxCopyPaste msgb=new MsgBoxCopyPaste(keyData);
            //msgb.ShowDialog();
            return(keyData);
        }
Esempio n. 2
0
 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.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);
     }
     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;
 }
Esempio n. 3
0
        private void butChange_Click(object sender, System.EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult == DialogResult.Cancel)
            {
                textADA.Text = ProcedureCodes.GetStringProcCode(AutoCodeItemCur.CodeNum);
                return;
            }
            if (AutoCodeItems.GetContainsKey(FormP.SelectedCodeNum) &&
                AutoCodeItems.GetOne(FormP.SelectedCodeNum).AutoCodeNum != AutoCodeItemCur.AutoCodeNum)
            {
                //This section is a fix for an old bug that did not cause items to get deleted properly
                if (!AutoCodes.GetContainsKey(AutoCodeItems.GetOne(FormP.SelectedCodeNum).AutoCodeNum))
                {
                    AutoCodeItems.Delete(AutoCodeItems.GetOne(FormP.SelectedCodeNum));
                    textADA.Text = ProcedureCodes.GetStringProcCode(FormP.SelectedCodeNum);
                }
                else
                {
                    MessageBox.Show(Lan.g(this, "That procedure code is already in use in a different Auto Code.  Not allowed to use it here."));
                    textADA.Text = ProcedureCodes.GetStringProcCode(AutoCodeItemCur.CodeNum);
                }
            }
            else
            {
                textADA.Text = ProcedureCodes.GetStringProcCode(FormP.SelectedCodeNum);
            }
        }
Esempio n. 4
0
        private void butAddProc_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.OK)
            {
                return;
            }
            string        procCode     = ProcedureCodes.GetStringProcCode(FormP.SelectedCodeNum);
            List <string> procsOnCards = CreditCardCur.Procedures.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList();

            //If the procedure is already attached to this card, return without adding the procedure again
            if (procsOnCards.Exists(x => x == procCode))
            {
                return;
            }
            //Warn if attached to a different active card for this patient
            if (CreditCards.ProcLinkedToCard(CreditCardCur.PatNum, procCode, CreditCardCur.CreditCardNum))
            {
                if (!MsgBox.Show(this, MsgBoxButtons.YesNo, "This procedure is already linked with another credit card on this patient's "
                                 + "account. Adding the procedure to this card will result in the patient being charged twice for this procedure. Add this procedure?"))
                {
                    return;
                }
            }
            if (CreditCardCur.Procedures != "")
            {
                CreditCardCur.Procedures += ",";
            }
            CreditCardCur.Procedures += procCode;
            FillProcs();
        }
Esempio 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();
        }
Esempio n. 6
0
        ///<summary>Makes the "Before" and "After" columns human-readable for certain logs.</summary>
        private void TranslateBeforeAndAfter()
        {
            foreach (InsEditLog logCur in _listLogs)
            {
                long beforeKey = PIn.Long(logCur.OldValue, false);
                long afterKey  = PIn.Long(logCur.NewValue, false);
                switch (logCur.FieldName)
                {
                case "CarrierNum":
                    if (logCur.LogType == InsEditLogType.Carrier)
                    {
                        break;
                    }
                    string carrierNameBefore = Carriers.GetCarrier(beforeKey).CarrierName;
                    string carrierNameAfter  = Carriers.GetCarrier(afterKey).CarrierName;
                    if (logCur.LogType == InsEditLogType.InsPlan && carrierNameBefore == carrierNameAfter) //Edits to carrier.
                    {
                        break;                                                                             //Don't translate CarrierNum to CarrierName when both carriers have the same name, loses too much useful detail.
                    }
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : carrierNameBefore;
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : carrierNameAfter;
                    break;

                case "EmployerNum":
                    if (logCur.LogType == InsEditLogType.Employer)
                    {
                        break;
                    }
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Employers.GetName(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Employers.GetName(afterKey);
                    break;

                case "FeeSched":
                case "CopayFeeSched":
                case "AllowedFeeSched":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : FeeScheds.GetDescription(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : FeeScheds.GetDescription(afterKey);
                    break;

                case "BenefitType":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Enum.GetName(typeof(InsBenefitType), beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Enum.GetName(typeof(InsBenefitType), afterKey);
                    break;

                case "CovCatNum":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : CovCats.GetDesc(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : CovCats.GetDesc(afterKey);
                    break;

                case "CodeNum":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : ProcedureCodes.GetStringProcCode(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : ProcedureCodes.GetStringProcCode(afterKey);
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 7
0
 private void FormResellerServiceEdit_Load(object sender, EventArgs e)
 {
     if (!IsNew)
     {
         textCode.Text = ProcedureCodes.GetStringProcCode(ResellerServiceCur.CodeNum);
         textDesc.Text = ProcedureCodes.GetLaymanTerm(ResellerServiceCur.CodeNum);
         textFee.Text  = ResellerServiceCur.Fee.ToString("F");
     }
 }
Esempio n. 8
0
 private void FormChartProcedureEntryEdit_Load(object sender, System.EventArgs e)
 {
     AutoCodes.RefreshCache();
     ProcButtonItems.RefreshCache();
     if (IsNew)
     {
         this.Text = Lan.g(this, "Add Procedure Button");
     }
     else
     {
         this.Text = Lan.g(this, "Edit Procedure Button");
     }
     textDescript.Text      = ProcButtonCur.Description;
     _listProcButtonCatDefs = Defs.GetDefsForCategory(DefCat.ProcButtonCats, true);
     for (int i = 0; i < _listProcButtonCatDefs.Count; i++)
     {
         comboCategory.Items.Add(_listProcButtonCatDefs[i].ItemName);
         if (ProcButtonCur.Category == _listProcButtonCatDefs[i].DefNum)
         {
             comboCategory.SelectedIndex = i;
         }
     }
     if (comboCategory.SelectedIndex == -1)
     {
         comboCategory.SelectedIndex = 0;              //we know that there will always be at least one cat. Validated in FormProcButtons
     }
     pictureBox.Image        = PIn.Bitmap(ProcButtonCur.ButtonImage);
     checkMultiVisit.Checked = ProcButtonCur.IsMultiVisit;
     long[] codeNumList = ProcButtonItems.GetCodeNumListForButton(ProcButtonCur.ProcButtonNum);
     long[] auto        = ProcButtonItems.GetAutoListForButton(ProcButtonCur.ProcButtonNum);
     listADA.Items.Clear();
     for (int i = 0; i < codeNumList.Length; i++)
     {
         listADA.Items.Add(ProcedureCodes.GetStringProcCode(codeNumList[i]));
     }
     listAutoCodes.Items.Clear();
     _listShortDeep = AutoCodes.GetListDeep(true);
     for (int i = 0; i < _listShortDeep.Count; i++)
     {
         listAutoCodes.Items.Add(_listShortDeep[i].Description);
         for (int j = 0; j < auto.Length; j++)
         {
             if (auto[j] == _listShortDeep[i].AutoCodeNum)
             {
                 listAutoCodes.SetSelected(i, true);
                 break;
             }
         }
     }
     //fill images to pick from
     for (int i = 0; i < imageList.Images.Count; i++)
     {
         listView.Items.Add("", i);
     }
 }
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.Cancel)
            {
                listADA.Items.Add(ProcedureCodes.GetStringProcCode(FormP.SelectedCodeNum));
            }
        }
Esempio n. 10
0
        private void butPickOrthoProc_Click(object sender, EventArgs e)
        {
            FormProcCodes FormPC = new FormProcCodes();

            FormPC.IsSelectionMode = true;
            FormPC.ShowDialog();
            if (FormPC.DialogResult == DialogResult.OK)
            {
                _orthoAutoProcCodeNum  = FormPC.SelectedCodeNum;
                textOrthoAutoProc.Text = ProcedureCodes.GetStringProcCode(_orthoAutoProcCodeNum);
            }
        }
Esempio n. 11
0
        ///<summary>Makes the "Before" and "After" columns human-readable for certain logs.</summary>
        private void TranslateBeforeAndAfter()
        {
            foreach (InsEditLog logCur in _listLogs)
            {
                long beforeKey = PIn.Long(logCur.OldValue, false);
                long afterKey  = PIn.Long(logCur.NewValue, false);
                switch (logCur.FieldName)
                {
                case "CarrierNum":
                    if (logCur.LogType == InsEditLogType.Carrier)
                    {
                        break;
                    }
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Carriers.GetCarrier(beforeKey).CarrierName;
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Carriers.GetCarrier(afterKey).CarrierName;
                    break;

                case "EmployerNum":
                    if (logCur.LogType == InsEditLogType.Employer)
                    {
                        break;
                    }
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Employers.GetName(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Employers.GetName(afterKey);
                    break;

                case "FeeSched":
                case "CopayFeeSched":
                case "AllowedFeeSched":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : FeeScheds.GetDescription(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : FeeScheds.GetDescription(afterKey);
                    break;

                case "BenefitType":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Enum.GetName(typeof(InsBenefitType), beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Enum.GetName(typeof(InsBenefitType), afterKey);
                    break;

                case "CovCatNum":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : CovCats.GetDesc(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : CovCats.GetDesc(afterKey);
                    break;

                case "CodeNum":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : ProcedureCodes.GetStringProcCode(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : ProcedureCodes.GetStringProcCode(afterKey);
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 12
0
        private void butProcCode_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.OK)
            {
                return;
            }
            textProcCodes.Text = string.Join(",", new[] { textProcCodes.Text, ProcedureCodes.GetStringProcCode(FormP.SelectedCodeNum) }.Where(x => !string.IsNullOrEmpty(x)));
        }
Esempio n. 13
0
        private void butPick_Click(object sender, EventArgs e)
        {
            FormProcCodes FormPC = new FormProcCodes();

            FormPC.IsSelectionMode = true;
            FormPC.ShowDialog();
            if (FormPC.DialogResult == DialogResult.OK)
            {
                ResellerServiceCur.CodeNum = FormPC.SelectedCodeNum;
                textCode.Text = ProcedureCodes.GetStringProcCode(ResellerServiceCur.CodeNum);
                textDesc.Text = ProcedureCodes.GetLaymanTerm(ResellerServiceCur.CodeNum);
            }
        }
Esempio n. 14
0
 private void FormAutoItemEdit_Load(object sender, System.EventArgs e)
 {
     AutoCodeConds.RefreshCache();
     if (IsNew)
     {
         this.Text = Lan.g(this, "Add Auto Code Item");
     }
     else
     {
         this.Text    = Lan.g(this, "Edit Auto Code Item");
         textADA.Text = ProcedureCodes.GetStringProcCode(AutoCodeItemCur.CodeNum);
     }
     FillList();
 }
Esempio n. 15
0
        private void FillTriggers()
        {
            listTriggers.Items.Clear();
            if (TriggerList.Count == 0 || comboSpecial.SelectedIndex == 2)         //child prophy special type has no triggers, triggers from Prophy type are used
            {
                return;
            }
            string str;

            for (int i = 0; i < TriggerList.Count; i++)
            {
                str  = ProcedureCodes.GetStringProcCode(TriggerList[i].CodeNum);
                str += "- " + ProcedureCodes.GetLaymanTerm(TriggerList[i].CodeNum);
                listTriggers.Items.Add(str);
            }
        }
Esempio n. 16
0
        private void FillTriggers()
        {
            listTriggers.Items.Clear();
            if (TriggerList.Count == 0)
            {
                return;
            }
            string str;

            for (int i = 0; i < TriggerList.Count; i++)
            {
                str  = ProcedureCodes.GetStringProcCode(TriggerList[i].CodeNum);
                str += "- " + ProcedureCodes.GetLaymanTerm(TriggerList[i].CodeNum);
                listTriggers.Items.Add(str);
            }
        }
Esempio n. 17
0
        private void butProcCode_Click(object sender, EventArgs e)
        {
            FormProcCodes formp = new FormProcCodes();

            formp.IsSelectionMode = true;
            formp.ShowDialog();
            if (formp.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (textProcCodes.Text != "")
            {
                textProcCodes.Text += ",";
            }
            textProcCodes.Text += ProcedureCodes.GetStringProcCode(formp.SelectedCodeNum);
        }
Esempio n. 18
0
        private void butAddProc_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (RecallTypeCur.Procedures != "")
            {
                RecallTypeCur.Procedures += ",";
            }
            RecallTypeCur.Procedures += ProcedureCodes.GetStringProcCode(FormP.SelectedCodeNum);
            FillProcs();
        }
Esempio n. 19
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;
     }
 }
Esempio n. 20
0
        public static void SetCompleteInAppt(Appointment apt, List <InsPlan> PlanList, List <PatPlan> patPlans, long siteNum, int patientAge, List <InsSub> subList)
        {
            List <Procedure> procsInAppt = Procedures.GetProcsForSingle(apt.AptNum, false);

            Procedures.SetCompleteInAppt(apt, PlanList, patPlans, siteNum, patientAge, procsInAppt, subList);
            if (Programs.UsingOrion)
            {
                OrionProcs.SetCompleteInAppt(procsInAppt);
            }
            //automation
            List <string> procCodes = new List <string>();

            for (int i = 0; i < procsInAppt.Count; i++)
            {
                procCodes.Add(ProcedureCodes.GetStringProcCode(procsInAppt[i].CodeNum));
            }
            AutomationL.Trigger(AutomationTrigger.CompleteProcedure, procCodes, apt.PatNum);
        }
Esempio n. 21
0
        private string GetStringForType(long recallTypeNum)
        {
            if (recallTypeNum == 0)
            {
                return("");
            }
            List <RecallTrigger> triggerList = RecallTriggers.GetForType(recallTypeNum);
            string retVal = "";

            for (int i = 0; i < triggerList.Count; i++)
            {
                if (i > 0)
                {
                    retVal += ",";
                }
                retVal += ProcedureCodes.GetStringProcCode(triggerList[i].CodeNum);
            }
            return(retVal);
        }
Esempio n. 22
0
        private void FormOrthoSetup_Load(object sender, EventArgs e)
        {
            checkPatClone.Checked = PrefC.GetBool(PrefName.ShowFeaturePatientClone);
            checkApptModuleShowOrthoChartItem.Checked = PrefC.GetBool(PrefName.ApptModuleShowOrthoChartItem);
            checkOrthoEnabled.Checked = PrefC.GetBool(PrefName.OrthoEnabled);
            checkOrthoFinancialInfoInChart.Checked  = PrefC.GetBool(PrefName.OrthoCaseInfoInOrthoChart);
            checkOrthoClaimMarkAsOrtho.Checked      = PrefC.GetBool(PrefName.OrthoClaimMarkAsOrtho);
            checkOrthoClaimUseDatePlacement.Checked = PrefC.GetBool(PrefName.OrthoClaimUseDatePlacement);
            textOrthoMonthsTreat.Text          = PrefC.GetByte(PrefName.OrthoDefaultMonthsTreat).ToString();
            _orthoAutoProcCodeNum              = PrefC.GetLong(PrefName.OrthoAutoProcCodeNum);
            textOrthoAutoProc.Text             = ProcedureCodes.GetStringProcCode(_orthoAutoProcCodeNum);
            checkConsolidateInsPayment.Checked = PrefC.GetBool(PrefName.OrthoInsPayConsolidated);
            string strListOrthoNums = PrefC.GetString(PrefName.OrthoPlacementProcsList);

            if (strListOrthoNums != "")
            {
                _listOrthoPlacementCodeNums.AddRange(strListOrthoNums.Split(new char[] { ',' }).ToList().Select(x => PIn.Long(x)));
            }
            RefreshListBoxProcs();
        }
Esempio n. 23
0
        private void butAddProc_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.OK)
            {
                return;
            }
            string procCode = ProcedureCodes.GetStringProcCode(FormP.SelectedCodeNum);

            if (_listCCProcs.Exists(x => x == procCode))
            {
                return;
            }
            _listCCProcs.Add(procCode);
            _listCCProcs.Sort();
            FillProcs();
        }
Esempio n. 24
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableProcSelect", "Date"), 70);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Prov"), 55);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Code"), 55);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Tooth"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Description"), 250);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Fee"), 60, HorizontalAlignment.Right);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ProcList.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(ProcList[i].ProcDate.ToShortDateString());
                row.Cells.Add(Providers.GetAbbr(ProcList[i].ProvNum));
                row.Cells.Add(ProcedureCodes.GetStringProcCode(ProcList[i].CodeNum));
                row.Cells.Add(Tooth.ToInternat(ProcList[i].ToothNum));
                string descript = "";
                if (ProcList[i].PatNum != PatNum)               //when IsForProvKeys
                {
                    Patient pat = Patients.GetLim(ProcList[i].PatNum);
                    descript += pat.GetNameLF() + " - ";
                }
                descript += ProcedureCodes.GetProcCode(ProcList[i].CodeNum).Descript;
                row.Cells.Add(descript);
                row.Cells.Add(ProcList[i].ProcFee.ToString("F"));
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Esempio n. 25
0
 private void MakeAuditTrailEntries()
 {
     foreach (ClaimProc claimProc in ClaimProcsToEdit)
     {
         string    strProcCode  = ProcedureCodes.GetStringProcCode(Procedures.GetOneProc(claimProc.ProcNum, false).CodeNum);
         ClaimProc oldClaimProc = _listClaimProcsOld.FirstOrDefault(x => x.ProcNum == claimProc.ProcNum);
         if (oldClaimProc != null)               //Shouldn't be null, but if somehow it is, do not log changes since we do not know what it changed from.
         {
             double procOldWriteoffAmt = oldClaimProc.WriteOff;
             double procOldInsAmt      = oldClaimProc.InsPayAmt;
             if (claimProc.WriteOff != procOldWriteoffAmt)
             {
                 SecurityLogs.MakeLogEntry(Permissions.InsWriteOffEdit, claimProc.PatNum, $"Writeoff amount for procedure {strProcCode}, " +
                                           $"changed from ${procOldWriteoffAmt.ToString("C")} to ${claimProc.WriteOff.ToString("C")}");
             }
             if (claimProc.InsPayAmt != procOldInsAmt)
             {
                 SecurityLogs.MakeLogEntry(Permissions.InsPayEdit, claimProc.PatNum, $"Insurance payment amount for procedure {strProcCode}, " +
                                           $"changed from ${procOldInsAmt.ToString("C")} to ${claimProc.InsPayAmt.ToString("C")}");
             }
         }
     }
 }
Esempio n. 26
0
        ///<summary>Returns a list of limited versions of ProcTP corresponding to the Procedures in listProcs.  Intended to mimic the logic in
        ///ContrTreat.LoadActiveTP, on a limited data basis in order to extract the necessary data to create a ToothChart.</summary>
        private List <ProcTP> GetTreatProcTPs(List <Procedure> listProcsAll)
        {
            List <Procedure> listProcs   = listProcsAll.FindAll(x => x.ProcStatus.In(ProcStat.TP, ProcStat.TPi));
            List <ProcTP>    listProcTPs = new List <ProcTP>();

            foreach (Procedure proc in listProcs)
            {
                ProcTP procTP = new ProcTP();
                procTP.ProcNumOrig = proc.ProcNum;
                procTP.ToothNumTP  = Tooth.ToInternat(proc.ToothNum);
                procTP.ProcCode    = ProcedureCodes.GetStringProcCode(proc.CodeNum);
                if (ProcedureCodes.GetProcCode(proc.CodeNum).TreatArea == TreatmentArea.Surf)
                {
                    procTP.Surf = Tooth.SurfTidyFromDbToDisplay(proc.Surf, proc.ToothNum);
                }
                else
                {
                    procTP.Surf = proc.Surf;                  //for UR, L, etc.
                }
                listProcTPs.Add(procTP);
            }
            return(listProcTPs);
        }
Esempio n. 27
0
        private void FormBenefitEdit_Load(object sender, System.EventArgs e)
        {
            if (BenCur == null)
            {
                MessageBox.Show("Benefit cannot be null.");
                DialogResult = DialogResult.Cancel;
                return;
            }
            if (!Security.IsAuthorized(Permissions.InsPlanEdit))
            {
                butOK.Enabled = false;
            }
            if (BenCur.PatPlanNum == 0)          //attached to insplan
            {
                checkPat.Checked = false;
            }
            else
            {
                checkPat.Checked = true;
            }
            listCategory.Items.Clear();
            listCategory.Items.Add(Lan.g(this, "None"));
            listCategory.SelectedIndex = 0;
            _listCovCats = CovCats.GetDeepCopy(true);
            for (int i = 0; i < _listCovCats.Count; i++)
            {
                listCategory.Items.Add(_listCovCats[i].Description);
                if (_listCovCats[i].CovCatNum == BenCur.CovCatNum)
                {
                    listCategory.SelectedIndex = i + 1;
                }
            }
            textProcCode.Text = ProcedureCodes.GetStringProcCode(BenCur.CodeNum);
            listType.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(InsBenefitType)).Length; i++)
            {
                listType.Items.Add(Lan.g("enumInsBenefitType", Enum.GetNames(typeof(InsBenefitType))[i]));
                if ((int)BenCur.BenefitType == i)
                {
                    listType.SelectedIndex = i;
                }
            }
            if (BenCur.Percent == -1)
            {
                textPercent.Text = "";
            }
            else
            {
                textPercent.Text = BenCur.Percent.ToString();
            }
            if (BenCur.MonetaryAmt == -1)
            {
                textAmount.Text = "";
            }
            else
            {
                textAmount.Text = BenCur.MonetaryAmt.ToString("n");
            }
            listTimePeriod.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(BenefitTimePeriod)).Length; i++)
            {
                listTimePeriod.Items.Add(Lan.g("enumBenefitTimePeriod", Enum.GetNames(typeof(BenefitTimePeriod))[i]));
                if ((int)BenCur.TimePeriod == i)
                {
                    listTimePeriod.SelectedIndex = i;
                }
            }
            textQuantity.Text = BenCur.Quantity.ToString();
            listQuantityQualifier.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(BenefitQuantity)).Length; i++)
            {
                listQuantityQualifier.Items.Add(Lan.g("enumBenefitQuantity", Enum.GetNames(typeof(BenefitQuantity))[i]));
                if ((int)BenCur.QuantityQualifier == i)
                {
                    listQuantityQualifier.SelectedIndex = i;
                }
            }
            for (int i = 0; i < Enum.GetNames(typeof(BenefitCoverageLevel)).Length; i++)
            {
                listCoverageLevel.Items.Add(Lan.g("enumBenefitCoverageLevel", Enum.GetNames(typeof(BenefitCoverageLevel))[i]));
                if ((int)BenCur.CoverageLevel == i)
                {
                    listCoverageLevel.SelectedIndex = i;
                }
            }
            //determine if this is an annual max

            /*if(textCode.Text==""
             *      && listType.SelectedIndex==(int)InsBenefitType.Limitations
             *      && (listTimePeriod.SelectedIndex==(int)BenefitTimePeriod.CalendarYear
             || listTimePeriod.SelectedIndex==(int)BenefitTimePeriod.ServiceYear)
             ||     && listQuantityQualifier.SelectedIndex==(int)BenefitQuantity.None)
             ||{
             ||     isAnnualMax=true;
             ||}*/
        }
Esempio n. 28
0
        private void FillGrid()
        {
            List <Procedure> entireList = Procedures.Refresh(AptCur.PatNum);

            ProcList = new List <Procedure>();
            bool       isPlanned  = AptCur.AptStatus == ApptStatus.Planned;
            ApptStatus apptStatus = AptCur.AptStatus;

            for (int i = 0; i < entireList.Count; i++)
            {
                //We want all unattached completed procs with same date as appt.
                //but only if one of these types
                if (apptStatus == ApptStatus.Scheduled || apptStatus == ApptStatus.Complete || apptStatus == ApptStatus.Broken)
                {
                    if (entireList[i].AptNum == 0 &&
                        entireList[i].ProcStatus == ProcStat.C &&
                        entireList[i].ProcDate.Date == AptCur.AptDateTime.Date)
                    {
                        ProcList.Add(entireList[i]);
                    }
                }
                //otherwise, we only want TP procs that are not attached to this appointment.
                //As for TP procs attached to other appointments, we will show this to the user and warn them about it,
                //but we won't filter them out.
                if (entireList[i].ProcStatus != ProcStat.TP)
                {
                    continue;
                }
                if (isPlanned)
                {
                    if (entireList[i].PlannedAptNum == AptCur.AptNum)
                    {
                        continue;
                    }
                }
                else
                {
                    if (entireList[i].AptNum == AptCur.AptNum)
                    {
                        continue;
                    }
                }
                ProcList.Add(entireList[i]);
            }
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn(Lan.g("TableProcSelect", "OtherAppt"), 70, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Code"), 55);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Priority"), 55);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Tooth"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Description"), 250);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Fee"), 60, HorizontalAlignment.Right);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ProcList.Count; i++)
            {
                row = new ODGridRow();
                if (ProcList[i].ProcStatus == ProcStat.C)              //so unattached
                {
                    row.Cells.Add("");
                }
                else if (isPlanned && ProcList[i].PlannedAptNum != 0)
                {
                    row.Cells.Add("X");
                }
                else if (!isPlanned && ProcList[i].AptNum != 0)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Cells.Add(ProcedureCodes.GetStringProcCode(ProcList[i].CodeNum));
                row.Cells.Add(Defs.GetName(DefCat.TxPriorities, ProcList[i].Priority));
                row.Cells.Add(Tooth.ToInternat(ProcList[i].ToothNum));
                row.Cells.Add(ProcedureCodes.GetLaymanTerm(ProcList[i].CodeNum));
                row.Cells.Add(ProcList[i].ProcFee.ToString("F"));
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Esempio n. 29
0
        private void butIncrease_Click(object sender, System.EventArgs e)
        {
            int percent = 0;

            if (textPercent.Text == "")
            {
                MsgBox.Show(this, "Please enter a percent first.");
                return;
            }
            try{
                percent = System.Convert.ToInt32(textPercent.Text);
            }
            catch {
                MsgBox.Show(this, "Percent is not a valid number.");
                return;
            }
            if (percent < -99 || percent > 99)
            {
                MsgBox.Show(this, "Percent must be between -99 and 99.");
                return;
            }
            if (!MsgBox.Show(this, true, "This will overwrite all values of the current fee schedule showing in the main window.  For this reason, you should be working on a copy.  Are you sure you want to continue?"))
            {
                return;
            }

            int round = 0;

            if (radioDime.Checked)
            {
                round = 1;
            }
            if (radioPenny.Checked)
            {
                round = 2;
            }
            Fees.Increase(SchedNum, percent, round);
            Fees.RefreshCache();
            for (int i = 0; i < Fees.Listt.Count; i++)
            {
                if (Fees.Listt[i].FeeSched != SchedNum)
                {
                    continue;
                }
                if (Fees.Listt[i].Amount == 0)
                {
                    continue;
                }
                SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, Lan.g(this, "Procedure") + ": " + ProcedureCodes.GetStringProcCode(Fees.Listt[i].CodeNum)
                                          + ", " + Lan.g(this, "Fee") + ": " + Fees.Listt[i].Amount.ToString("c") + ", " + Lan.g(this, "Fee Schedule") + ": " + FeeScheds.GetDescription(Fees.Listt[i].FeeSched)
                                          + ". " + Lan.g(this, "Fee increased by") + " " + ((float)percent / 100.0f).ToString("p") + " " + Lan.g(this, " using the increase button in the Fee Tools window.")
                                          , Fees.Listt[i].CodeNum);
            }
            DialogResult = DialogResult.OK;
        }
Esempio n. 30
0
        private void FormBenefitEdit_Load(object sender, System.EventArgs e)
        {
            if (BenCur == null)
            {
                MessageBox.Show("Benefit cannot be null.");
            }
            if (BenCur.PatPlanNum == 0)          //attached to insplan
            {
                checkPat.Checked = false;
            }
            else
            {
                checkPat.Checked = true;
            }
            listCategory.Items.Clear();
            for (int i = 0; i < CovCatB.ListShort.Length; i++)
            {
                listCategory.Items.Add(CovCatB.ListShort[i].Description);
                if (CovCatB.ListShort[i].CovCatNum == BenCur.CovCatNum)
                {
                    listCategory.SelectedIndex = i;
                }
            }
            if (listCategory.SelectedIndex == -1 && CovCatB.ListShort.Length > 0)
            {
                listCategory.SelectedIndex = 0;
            }
            textProcCode.Text = ProcedureCodes.GetStringProcCode(BenCur.CodeNum);
            listType.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(InsBenefitType)).Length; i++)
            {
                listType.Items.Add(Lan.g("enumInsBenefitType", Enum.GetNames(typeof(InsBenefitType))[i]));
                if ((int)BenCur.BenefitType == i)
                {
                    listType.SelectedIndex = i;
                }
            }
            textPercent.Text = BenCur.Percent.ToString();
            textAmount.Text  = BenCur.MonetaryAmt.ToString("n");
            listTimePeriod.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(BenefitTimePeriod)).Length; i++)
            {
                listTimePeriod.Items.Add(Lan.g("enumBenefitTimePeriod", Enum.GetNames(typeof(BenefitTimePeriod))[i]));
                if ((int)BenCur.TimePeriod == i)
                {
                    listTimePeriod.SelectedIndex = i;
                }
            }
            textQuantity.Text = BenCur.Quantity.ToString();
            listQuantityQualifier.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(BenefitQuantity)).Length; i++)
            {
                listQuantityQualifier.Items.Add(Lan.g("enumBenefitQuantity", Enum.GetNames(typeof(BenefitQuantity))[i]));
                if ((int)BenCur.QuantityQualifier == i)
                {
                    listQuantityQualifier.SelectedIndex = i;
                }
            }
            for (int i = 0; i < Enum.GetNames(typeof(BenefitCoverageLevel)).Length; i++)
            {
                listCoverageLevel.Items.Add(Lan.g("enumBenefitCoverageLevel", Enum.GetNames(typeof(BenefitCoverageLevel))[i]));
                if ((int)BenCur.CoverageLevel == i)
                {
                    listCoverageLevel.SelectedIndex = i;
                }
            }
            //determine if this is an annual max

            /*if(textCode.Text==""
             *      && listType.SelectedIndex==(int)InsBenefitType.Limitations
             *      && (listTimePeriod.SelectedIndex==(int)BenefitTimePeriod.CalendarYear
             || listTimePeriod.SelectedIndex==(int)BenefitTimePeriod.ServiceYear)
             ||     && listQuantityQualifier.SelectedIndex==(int)BenefitQuantity.None)
             ||{
             ||     isAnnualMax=true;
             ||}*/
            SetVisibilities();
        }