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;
        }
示例#2
0
        ///<summary>Resets the descriptions for all ADA codes to the official wording.  Required by the license.</summary>
        public static void ResetADAdescriptions(List <ProcedureCode> codeList)
        {
            ProcedureCode code;

            for (int i = 0; i < codeList.Count; i++)
            {
                if (!ProcedureCodes.IsValidCode(codeList[i].ProcCode))
                {
                    continue;
                }
                code          = ProcedureCodes.GetProcCode(codeList[i].ProcCode);
                code.Descript = codeList[i].Descript;
                ProcedureCodes.Update(code);
            }
            //don't forget to refresh procedurecodes.
        }