Exemple #1
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;
            }
        }
        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();
        }
Exemple #3
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textADA.Text == "")
     {
         MessageBox.Show(Lan.g(this, "Code cannot be left blank."));
         listConditions.SelectedIndex = -1;
         FillList();
         return;
     }
     AutoCodeItemCur.CodeNum = ProcedureCodes.GetCodeNum(textADA.Text);
     if (IsNew)
     {
         AutoCodeItems.Insert(AutoCodeItemCur);
     }
     else
     {
         AutoCodeItems.Update(AutoCodeItemCur);
     }
     AutoCodeConds.DeleteForItemNum(AutoCodeItemCur.AutoCodeItemNum);
     for (int i = 0; i < listConditions.SelectedIndices.Count; i++)
     {
         AutoCodeCond AutoCodeCondCur = new AutoCodeCond();
         AutoCodeCondCur.AutoCodeItemNum = AutoCodeItemCur.AutoCodeItemNum;
         AutoCodeCondCur.Cond            = (AutoCondition)listConditions.SelectedIndices[i];
         AutoCodeConds.Insert(AutoCodeCondCur);
     }
     DialogResult = DialogResult.OK;
 }
Exemple #4
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 (AutoCodeItemC.HList.ContainsKey(FormP.SelectedCodeNum) &&
                (long)AutoCodeItemC.HList[FormP.SelectedCodeNum] != AutoCodeItemCur.AutoCodeNum)
            {
                //This section is a fix for an old bug that did not cause items to get deleted properly
                if (!AutoCodeC.HList.ContainsKey((long)AutoCodeItemC.HList[FormP.SelectedCodeNum]))
                {
                    AutoCodeItems.Delete((long)AutoCodeItemC.HList[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);
            }
        }
        private void butAddProc_Click(object sender, EventArgs e)
        {
            List <GridColumn> listGridCols = new List <GridColumn>()
            {
                new GridColumn(Lan.g(this, "Code"), 70),
                new GridColumn(Lan.g(this, "Abbreviation"), 90, HorizontalAlignment.Center),
                new GridColumn(Lan.g(this, "Description"), 0, HorizontalAlignment.Right)
            };
            List <ProcedureCode> listMouthProcCodes = ProcedureCodes.GetProcCodesByTreatmentArea(false, TreatmentArea.Mouth, TreatmentArea.None)
                                                      .OrderBy(x => x.ProcCode).ToList();
            List <GridRow> listGridRows = new List <GridRow>();

            listMouthProcCodes.ForEach(x => {
                GridRow row = new GridRow(x.ProcCode, x.AbbrDesc, x.Descript);
                row.Tag     = x;
                listGridRows.Add(row);
            });
            FormGridSelection formGridSelect = new FormGridSelection(listGridCols, listGridRows, "Add Procedure", "Procedures");

            if (formGridSelect.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            foreach (object tag in formGridSelect.ListSelectedTags)
            {
                string fieldName = "Proc:" + ((ProcedureCode)tag).ProcCode;
                listBoxFields.Items.Add(new ODBoxItem <SheetFieldDef>(fieldName, SheetFieldDef.NewCheckBox(fieldName, 0, 0, 0, 0)));
                listBoxFields.SetSelected(listBoxFields.Items.Count - 1, true);
            }
        }
Exemple #6
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textRuleDesc.Text == "")
     {
         MsgBox.Show(this, "Description not allowed to be blank.");
         return;
     }
     if (!ProcedureCodes.IsValidCode(textCodeStart.Text) ||
         !ProcedureCodes.IsValidCode(textCodeEnd.Text))
     {
         MsgBox.Show(this, "Start and end codes must be valid procedure codes.");
         return;
     }
     ApptRuleCur.RuleDesc  = textRuleDesc.Text;
     ApptRuleCur.CodeStart = textCodeStart.Text;
     ApptRuleCur.CodeEnd   = textCodeEnd.Text;
     ApptRuleCur.IsEnabled = checkIsEnabled.Checked;
     if (IsNew)
     {
         AppointmentRules.Insert(ApptRuleCur);
     }
     else
     {
         AppointmentRules.Update(ApptRuleCur);
     }
     DialogResult = DialogResult.OK;
 }
Exemple #7
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] = ProcedureList[i].ADACode;
                tbProcs.Cell[3, i] = Tooth.ToInternat(ProcedureList[i].ToothNum);
                tbProcs.Cell[4, i] = ProcedureCodes.GetProcCode(ProcedureList[i].ADACode).Descript;
                tbProcs.Cell[5, i] = ProcedureList[i].ProcFee.ToString("F");
            }
            tbProcs.LayoutTables();
        }
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textMedicalCode.Text != "" && !ProcedureCodes.HList.Contains(textMedicalCode.Text))
            {
                MsgBox.Show(this, "Invalid medical code.  It must refer to an existing procedure code entered separately");
                return;
            }
            if (textSubstitutionCode.Text != "" && !ProcedureCodes.HList.Contains(textSubstitutionCode.Text))
            {
                MsgBox.Show(this, "Invalid substitution code.  It must refer to an existing procedure code entered separately");
                return;
            }
            bool DoSynchRecall = false;

            if (IsNew && checkSetRecall.Checked)
            {
                DoSynchRecall = true;
            }
            else if (ProcCode.SetRecall != checkSetRecall.Checked)          //set recall changed
            {
                DoSynchRecall = true;
            }
            if (DoSynchRecall)
            {
                if (!MsgBox.Show(this, true, "Because you have changed the recall setting for this procedure code, all your patient recalls will be resynchronized, which can take a minute or two.  Do you want to continue?"))
                {
                    return;
                }
            }
            ProcCode.AlternateCode1   = textAlternateCode1.Text;
            ProcCode.MedicalCode      = textMedicalCode.Text;
            ProcCode.SubstitutionCode = textSubstitutionCode.Text;
            ProcCode.SubstOnlyIf      = (SubstitutionCondition)comboSubstOnlyIf.SelectedIndex;
            ProcCode.Descript         = textDescription.Text;
            ProcCode.AbbrDesc         = textAbbrev.Text;
            ProcCode.LaymanTerm       = textLaymanTerm.Text;
            ProcCode.ProcTime         = strBTime.ToString();
            ProcCode.GraphicColor     = butColor.BackColor;
            ProcCode.SetRecall        = checkSetRecall.Checked;
            ProcCode.NoBillIns        = checkNoBillIns.Checked;
            ProcCode.IsProsth         = checkIsProsth.Checked;
            ProcCode.IsHygiene        = checkIsHygiene.Checked;
            ProcCode.IsCanadianLab    = checkIsCanadianLab.Checked;
            ProcCode.DefaultNote      = textNote.Text;
            ProcCode.PaintType        = (ToothPaintingType)listPaintType.SelectedIndex;
            ProcCode.TreatArea        = (TreatmentArea)listTreatArea.SelectedIndex + 1;
            ProcCode.BaseUnits        = Int16.Parse(textBaseUnits.Text.ToString());
            if (listCategory.SelectedIndex != -1)
            {
                ProcCode.ProcCat = DefB.Short[(int)DefCat.ProcCodeCats][listCategory.SelectedIndex].DefNum;
            }
            ProcedureCodes.Update(ProcCode);            //whether new or not.
            if (DoSynchRecall)
            {
                Cursor = Cursors.WaitCursor;
                Recalls.SynchAllPatients();
                Cursor = Cursors.Default;
            }
            DialogResult = DialogResult.OK;
        }
        ///<summary>Opens FormProcCodes in SelectionMode. Creates a new SubstitutionLink for the selected Procedure.</summary>
        private void ButAdd_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.OK)
            {
                return;
            }
            _listAllProcCodes = ProcedureCodes.GetAllCodes();          //in case they added a new proc code
            ProcedureCode procSelected = _listAllProcCodes.FirstOrDefault(x => x.CodeNum == FormP.SelectedCodeNum);

            if (procSelected == null)
            {
                return;                //should never happen, just in case
            }
            //Valid procedure selected. Create a new SubstitutionLink.  The user will be able to add the substition code on the cell grid.
            SubstitutionLink subLink = new SubstitutionLink();

            subLink.CodeNum          = procSelected.CodeNum;
            subLink.PlanNum          = _insPlan.PlanNum;
            subLink.SubstOnlyIf      = SubstitutionCondition.Always;
            subLink.SubstitutionCode = "";          //Set to blank. The user will be able to add in the cell grid
            //The substitution link will be synced on OK click.
            _listSubstLinks.Add(subLink);
            FillGridMain();
            //Set the substitution link we just added as selected. The X pos at 3 is the SubstCode column.
            gridMain.SetSelected(new Point(3, gridMain.ListGridRows.ToList().FindIndex(x => (x.Tag as ProcedureCode).CodeNum == subLink.CodeNum)));
        }
        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);
        }
 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;
 }
        private void FillGridServices()
        {
            _listServices = ResellerServices.GetServicesForReseller(_resellerCur.ResellerNum);
            gridServices.BeginUpdate();
            gridServices.ListGridColumns.Clear();
            GridColumn col = new GridColumn("Description", 180);

            gridServices.ListGridColumns.Add(col);
            col           = new GridColumn("Fee", 0);
            col.TextAlign = HorizontalAlignment.Right;
            gridServices.ListGridColumns.Add(col);
            gridServices.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < _listServices.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(ProcedureCodes.GetLaymanTerm(_listServices[i].CodeNum));
                row.Cells.Add(_listServices[i].Fee.ToString("F"));
                gridServices.ListGridRows.Add(row);
            }
            gridServices.EndUpdate();
            //The Available Services grid has changed, re-evaluate the bundle requirement label visibility.
            labelBundleRequired.Visible = IsBundleMissing();
        }
Exemple #13
0
 private void FormProcCodeNew_Load(object sender, EventArgs e)
 {
     ProcedureCodes.RefreshCache();
     listType.Items.Add(Lan.g(this, "none"));
     listType.Items.Add(Lan.g(this, "Exam"));
     listType.Items.Add(Lan.g(this, "Xray"));
     listType.Items.Add(Lan.g(this, "Prophy"));
     listType.Items.Add(Lan.g(this, "Fluoride"));
     listType.Items.Add(Lan.g(this, "Sealant"));
     listType.Items.Add(Lan.g(this, "Amalgam"));
     listType.Items.Add(Lan.g(this, "Composite, Anterior"));
     listType.Items.Add(Lan.g(this, "Composite, Posterior"));
     listType.Items.Add(Lan.g(this, "Buildup/Post"));
     listType.Items.Add(Lan.g(this, "Pulpotomy"));
     listType.Items.Add(Lan.g(this, "RCT"));
     listType.Items.Add(Lan.g(this, "SRP"));
     listType.Items.Add(Lan.g(this, "Denture"));
     listType.Items.Add(Lan.g(this, "RPD"));
     listType.Items.Add(Lan.g(this, "Denture Repair"));
     listType.Items.Add(Lan.g(this, "Reline"));
     listType.Items.Add(Lan.g(this, "Ceramic Inlay"));
     listType.Items.Add(Lan.g(this, "Metallic Inlay"));
     listType.Items.Add(Lan.g(this, "Whitening"));
     listType.Items.Add(Lan.g(this, "All-Ceramic Crown"));
     listType.Items.Add(Lan.g(this, "PFM Crown"));
     listType.Items.Add(Lan.g(this, "Full Gold Crown"));
     listType.Items.Add(Lan.g(this, "Bridge Pontic or Retainer - Ceramic"));
     listType.Items.Add(Lan.g(this, "Bridge Pontic or Retainer - PFM"));
     listType.Items.Add(Lan.g(this, "Bridge Pontic or Retainer - Metal"));
     listType.Items.Add(Lan.g(this, "Extraction"));
     listType.Items.Add(Lan.g(this, "Ortho"));
     listType.Items.Add(Lan.g(this, "Nitrous"));
     if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum))
     {
         labelListType.Visible  = false;
         listType.Visible       = false;
         labelTreatArea.Visible = false;
         comboTreatArea.Visible = false;
     }
     listType.SelectedIndex = 0;
     for (int i = 0; i < Enum.GetNames(typeof(ToothPaintingType)).Length; i++)
     {
         comboPaintType.Items.Add(Enum.GetNames(typeof(ToothPaintingType))[i]);
     }
     comboPaintType.SelectedIndex = (int)ToothPaintingType.None;
     for (int i = 1; i < Enum.GetNames(typeof(TreatmentArea)).Length; i++)
     {
         comboTreatArea.Items.Add(Lan.g(this, Enum.GetNames(typeof(TreatmentArea))[i]));
     }
     comboTreatArea.SelectedIndex = (int)TreatmentArea.Mouth - 1;
     _listProcCodeCatDefs         = Defs.GetDefsForCategory(DefCat.ProcCodeCats, true);
     for (int i = 0; i < _listProcCodeCatDefs.Count; i++)
     {
         comboCategory.Items.Add(_listProcCodeCatDefs[i].ItemName);
     }
     comboCategory.SelectedIndex = 0;
     textNewCode.Focus();
     textNewCode.Select(textNewCode.Text.Length, 1);
 }
        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.ProcFee     = chargeList[i].ChargeAmt;
                    proc.ProcStatus  = ProcStat.C;
                    proc.ProvNum     = PrefB.GetInt("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;
        }
Exemple #15
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;
                }
            }
        }
        private void butNew_Click(object sender, System.EventArgs e)
        {
            //won't be visible if no permission
            FormProcCodeNew FormPCN = new FormProcCodeNew();

            FormPCN.ShowDialog();
            if (FormPCN.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (FormPCN.textNewCode.Text == "")
            {
                return;
            }
            ProcedureCode procCode;

            if (ProcedureCodes.HList.ContainsKey(FormPCN.textNewCode.Text))
            {
                procCode = (ProcedureCode)ProcedureCodes.HList[FormPCN.textNewCode.Text];
                textAbbreviation.Text = "";
                textDescription.Text  = "";
                textCode.Text         = FormPCN.textNewCode.Text;
                if (DefB.GetHidden(DefCat.ProcCodeCats, procCode.ProcCat))
                {
                    checkShowHidden.Checked = true;
                    FillCats();
                }
                for (int i = 0; i < CatList.Length; i++)
                {
                    if (CatList[i].DefNum == procCode.ProcCat)
                    {
                        listCategories.SetSelected(i, true);
                    }
                    else
                    {
                        listCategories.SetSelected(i, false);
                    }
                }
                FillGrid();
                MessageBox.Show(Lan.g(this, "That code already exists."));
                return;
            }
            procCode         = new ProcedureCode();
            procCode.ADACode = FormPCN.textNewCode.Text;
            //procCode.ProcTime="/X/";//moved to contructor.
            procCode.ProcCat = DefB.Short[(int)DefCat.ProcCodeCats][0].DefNum;
            //procCode.GraphicColor=Color.FromArgb(0);//moved to contructor.
            ProcedureCodes.Insert(procCode);
            FormProcCodeEdit FormP = new FormProcCodeEdit(procCode);

            FormP.IsNew = true;
            FormP.ShowDialog();
            if (FormP.DialogResult == DialogResult.OK)
            {
                changed = true;
                FillGrid();
            }
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Added Procedure Code: " + procCode.ADACode);
        }
Exemple #17
0
 private void FormApptBreak_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.DialogResult != DialogResult.OK)
     {
         return;
     }
     SelectedProcCode = radioMissed.Checked?ProcedureCodes.GetProcCode("D9986"):ProcedureCodes.GetProcCode("D9987");
 }
 private void FormInsPlanSubstitution_Load(object sender, EventArgs e)
 {
     _listAllProcCodes   = ProcedureCodes.GetAllCodes();
     _listSubstProcCodes = _listAllProcCodes.FindAll(x => !String.IsNullOrEmpty(x.SubstitutionCode));
     _listDbSubstLinks   = SubstitutionLinks.GetAllForPlans(_insPlan.PlanNum);
     FillGridSubstituionInclude();
     FillGridSubstituionExclude();
 }
 private void FillProcs()
 {
     listProcs.Items.Clear();
     foreach (string procStr in _listCCProcs)
     {
         listProcs.Items.Add(procStr + "- " + ProcedureCodes.GetLaymanTerm(ProcedureCodes.GetProcCode(procStr).CodeNum));
     }
 }
        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;
        }
Exemple #21
0
        public static void ResetApptProcsQuickAdd()
        {
            string command = "DELETE FROM definition WHERE Category=3";

            General.NonQ(command);
            string[] array = new string[] {
                "CompEx-4BW-Pano-Pro-Flo", "D0150,D0274,D0330,D1110,D1204",
                "CompEx-2BW-Pano-ChPro-Flo", "D0150,D0272,D0330,D1120,D1203",
                "PerEx-4BW-Pro-Flo", "D0120,D0274,D1110,D1204",
                "LimEx-PA", "D0140,D0220",
                "PerEx-4BW-Pro-Flo", "D0120,D0274,D1110,D1204",
                "PerEx-2BW-ChildPro-Flo", "D0120,D0272,D1120,D1203",
                "Comp Exam", "D0150",
                "Per Exam", "D0120",
                "Lim Exam", "D0140",
                "1 PA", "D0220",
                "2BW", "D0272",
                "4BW", "D0274",
                "Pano", "D0330",
                "Pro Adult", "D1110",
                "Fluor Adult", "D1204",
                "Pro Child", "D1120",
                "Fuor Child", "D1203",
                "PostOp", "N4101",
                "DentAdj", "N4102",
                "Consult", "D9310"
            };
            Def def;

            string[] codelist;
            bool     allvalid;
            int      itemorder = 0;

            for (int i = 0; i < array.Length; i += 2)
            {
                //first, test all procedures for valid
                codelist = array[i + 1].Split(',');
                allvalid = true;
                for (int c = 0; c < codelist.Length; c++)
                {
                    if (!ProcedureCodes.IsValidCode(codelist[c]))
                    {
                        allvalid = false;
                    }
                }
                if (!allvalid)
                {
                    continue;
                }
                def           = new Def();
                def.Category  = DefCat.ApptProcsQuickAdd;
                def.ItemOrder = itemorder;
                def.ItemName  = array[i];
                def.ItemValue = array[i + 1];
                Defs.Insert(def);
                itemorder++;
            }
        }
        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();
        }
Exemple #23
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);
        }
Exemple #24
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");
     }
 }
        ///<summary>Can be called externally as part of the update sequence.  Surround with try catch.  Returns number of codes inserted.  Supply path to file to import or a list of procedure codes, or an xml string.  Make sure to set the other two values blank or empty(not null).</summary>
        public static int ImportProcCodes(string path, List <ProcedureCode> listCodes, string xmlData)
        {
            //xmlData should already be tested ahead of time to make sure it's not blank.
            XmlSerializer serializer = new XmlSerializer(typeof(List <ProcedureCode>));

            if (path != "")
            {
                if (!File.Exists(path))
                {
                    throw new ApplicationException(Lan.g("FormProcCodes", "File does not exist."));
                }
                try {
                    using (TextReader reader = new StreamReader(path)) {
                        listCodes = (List <ProcedureCode>)serializer.Deserialize(reader);
                    }
                }
                catch {
                    throw new ApplicationException(Lan.g("FormProcCodes", "Invalid file format"));
                }
            }
            else if (xmlData != "")
            {
                try {
                    using (TextReader reader = new StringReader(xmlData)) {
                        listCodes = (List <ProcedureCode>)serializer.Deserialize(reader);
                    }
                }
                catch {
                    throw new ApplicationException(Lan.g("FormProcCodes", "xml format"));
                }
            }
            int retVal = 0;

            for (int i = 0; i < listCodes.Count; i++)
            {
                if (ProcedureCodes.HList.ContainsKey(listCodes[i].ProcCode))
                {
                    continue;                    //don't import duplicates.
                }
                listCodes[i].ProcCat = DefB.GetByExactName(DefCat.ProcCodeCats, listCodes[i].ProcCatDescript);
                if (listCodes[i].ProcCat == 0)               //no category exists with that name
                {
                    Def def = new Def();
                    def.Category  = DefCat.ProcCodeCats;
                    def.ItemName  = listCodes[i].ProcCatDescript;
                    def.ItemOrder = DefB.Long[(int)DefCat.ProcCodeCats].Length;
                    Defs.Insert(def);
                    Defs.Refresh();
                    listCodes[i].ProcCat = def.DefNum;
                }
                ProcedureCodes.Insert(listCodes[i]);
                retVal++;
            }
            return(retVal);
            //don't forget to refresh procedurecodes
        }
Exemple #26
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);
     }
 }
 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 CreateFrequencyBenefit(ValidNumber textBox, ComboBox comboBox, string procCodeStr)
        {
            if (PIn.Byte(textBox.Text, false) == 0 || ProcedureCodes.GetCodeNum(procCodeStr) == 0)
            {
                return;
            }
            Benefit ben = Benefits.CreateFrequencyBenefit(ProcedureCodes.GetCodeNum(procCodeStr), PIn.Byte(textBox.Text), GetQuantityQualifier(comboBox),
                                                          _planNum, GetTimePeriod(comboBox.SelectedIndex));

            _listBenefitsAll.Add(ben);
        }
        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));
            }
        }
Exemple #30
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");
 }