Exemplo n.º 1
0
        private void butUp_Click(object sender, System.EventArgs e)
        {
            int selected = 0;

            if (listViewButtons.SelectedIndices.Count == 0)
            {
                return;
            }
            else if (listViewButtons.SelectedIndices[0] == 0)
            {
                return;
            }
            else
            {
                ProcButton but = ButtonList[listViewButtons.SelectedIndices[0]].Copy();
                but.ItemOrder--;
                ProcButtons.Update(but);
                selected = but.ItemOrder;
                but      = ButtonList[listViewButtons.SelectedIndices[0] - 1].Copy();
                but.ItemOrder++;
                ProcButtons.Update(but);
            }
            FillButtons();
            changed = true;
            listViewButtons.SelectedIndices.Clear();
            listViewButtons.SelectedIndices.Add(selected);
        }
Exemplo n.º 2
0
        private void butRun_Click(object sender, EventArgs e)
        {
            if (!checkTcodes.Checked && !checkNcodes.Checked && !checkDcodes.Checked && !checkAutocodes.Checked &&
                !checkProcButtons.Checked && !checkApptProcsQuickAdd.Checked)
            {
                MsgBox.Show(this, "Please select at least one tool first.");
                return;
            }
            Changed = true;
            int rowsInserted = 0;

            if (checkTcodes.Checked)
            {
                ProcedureCodes.TcodesClear();
                //yes, this really does refresh before moving on.
                DataValid.SetInvalid(InvalidTypes.Defs | InvalidTypes.ProcCodes | InvalidTypes.Fees);
            }
            if (checkNcodes.Checked)
            {
                try {
                    rowsInserted += FormProcCodes.ImportProcCodes("", new List <ProcedureCode>(), Properties.Resources.NoFeeProcCodes);
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidTypes.Defs | InvalidTypes.ProcCodes | InvalidTypes.Fees);
                //fees are included because they are grouped by defs.
            }
            if (checkDcodes.Checked)
            {
                try {
                    rowsInserted += FormProcCodes.ImportProcCodes("", codeList, "");
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidTypes.Defs | InvalidTypes.ProcCodes | InvalidTypes.Fees);
            }
            if (checkNcodes.Checked || checkDcodes.Checked)
            {
                MessageBox.Show("Procedure codes inserted: " + rowsInserted);
            }
            if (checkAutocodes.Checked)
            {
                AutoCodes.SetToDefault();
                DataValid.SetInvalid(InvalidTypes.AutoCodes);
            }
            if (checkProcButtons.Checked)
            {
                ProcButtons.SetToDefault();
                DataValid.SetInvalid(InvalidTypes.ProcButtons | InvalidTypes.Defs);
            }
            if (checkApptProcsQuickAdd.Checked)
            {
                ProcedureCodes.ResetApptProcsQuickAdd();
                DataValid.SetInvalid(InvalidTypes.Defs);
            }
            MessageBox.Show(Lan.g(this, "Done."));
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "New Customer Procedure codes tool was run.");
        }
Exemplo n.º 3
0
        private void FillButtons()
        {
            listViewButtons.Items.Clear();
            imageListProcButtons.Images.Clear();
            if (selectedCat == 0)
            {
                ButtonList = new ProcButton[0];
                return;
            }
            ProcButtons.Refresh();
            ButtonList = ProcButtons.GetForCat(selectedCat);
            //first check and fix any order problems
            for (int i = 0; i < ButtonList.Length; i++)
            {
                if (ButtonList[i].ItemOrder != i)
                {
                    ButtonList[i].ItemOrder = i;
                    ProcButtons.Update(ButtonList[i]);
                }
            }
            ListViewItem item;

            for (int i = 0; i < ButtonList.Length; i++)
            {
                if (ButtonList[i].ButtonImage != null)
                {
                    //image keys are simply the ProcButtonNum
                    imageListProcButtons.Images.Add(ButtonList[i].ProcButtonNum.ToString(), ButtonList[i].ButtonImage);
                }
                item = new ListViewItem(new string[] { ButtonList[i].Description }, ButtonList[i].ProcButtonNum.ToString());
                listViewButtons.Items.Add(item);
            }
        }
Exemplo n.º 4
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (listViewButtons.SelectedIndices.Count == 0)
     {
         MessageBox.Show(Lan.g(this, "Please select an item first."));
         return;
     }
     ProcButtons.Delete(ButtonList[listViewButtons.SelectedIndices[0]]);
     changed = true;
     FillButtons();
 }
Exemplo n.º 5
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDescript.Text == "")
            {
                MessageBox.Show(Lan.g(this, "You must type in a description."));
                return;
            }
            if (listADA.Items.Count == 0 && listAutoCodes.SelectedIndices.Count == 0)
            {
                MessageBox.Show(Lan.g(this, "You must pick at least one Auto Code or Procedure Code."));
                return;
            }
            ProcButtonCur.Description = textDescript.Text;
            if (ProcButtonCur.Category != _listProcButtonCatDefs[comboCategory.SelectedIndex].DefNum)
            {
                //This will put it at the end of the order in the new category
                ProcButtonCur.ItemOrder
                    = ProcButtons.GetForCat(_listProcButtonCatDefs[comboCategory.SelectedIndex].DefNum).Length;
            }
            ProcButtonCur.Category    = _listProcButtonCatDefs[comboCategory.SelectedIndex].DefNum;
            ProcButtonCur.ButtonImage = POut.Bitmap((Bitmap)pictureBox.Image, System.Drawing.Imaging.ImageFormat.Png);
            if (IsNew)
            {
                ProcButtonCur.ItemOrder = ProcButtons.GetCount();
                ProcButtons.Insert(ProcButtonCur);
            }
            else
            {
                ProcButtons.Update(ProcButtonCur);
            }
            ProcButtonItems.DeleteAllForButton(ProcButtonCur.ProcButtonNum);
            ProcButtonItem item;

            for (int i = 0; i < listADA.Items.Count; i++)
            {
                item = new ProcButtonItem();
                item.ProcButtonNum = ProcButtonCur.ProcButtonNum;
                item.CodeNum       = ProcedureCodes.GetCodeNum(listADA.Items[i].ToString());
                item.ItemOrder     = i + 1;        //not i++, that would mess up the itteration.
                ProcButtonItems.Insert(item);
            }
            for (int i = 0; i < listAutoCodes.SelectedIndices.Count; i++)
            {
                item = new ProcButtonItem();
                item.ProcButtonNum = ProcButtonCur.ProcButtonNum;
                item.AutoCodeNum   = _listShortDeep[listAutoCodes.SelectedIndices[i]].AutoCodeNum;
                item.ItemOrder     = i + 1;        //not i++, that would mess up the itteration.
                ProcButtonItems.Insert(item);
            }
            DialogResult = DialogResult.OK;
        }
Exemplo n.º 6
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDescript.Text == "")
            {
                MessageBox.Show(Lan.g(this, "You must type in a description."));
                return;
            }
            if (listADA.Items.Count == 0 && listAutoCodes.SelectedIndices.Count == 0)
            {
                MessageBox.Show(Lan.g(this, "You must pick at least one Auto Code or ADA Code."));
                return;
            }
            ProcButtonCur.Description = textDescript.Text;
            if (ProcButtonCur.Category != DefB.Short[(int)DefCat.ProcButtonCats][comboCategory.SelectedIndex].DefNum)
            {
                //This will put it at the end of the order in the new category
                ProcButtonCur.ItemOrder
                    = ProcButtons.GetForCat(DefB.Short[(int)DefCat.ProcButtonCats][comboCategory.SelectedIndex].DefNum).Length;
            }
            ProcButtonCur.Category    = DefB.Short[(int)DefCat.ProcButtonCats][comboCategory.SelectedIndex].DefNum;
            ProcButtonCur.ButtonImage = (Bitmap)pictureBox.Image;
            if (IsNew)
            {
                ProcButtonCur.ItemOrder = ProcButtons.List.Length;
                ProcButtons.Insert(ProcButtonCur);
            }
            else
            {
                ProcButtons.Update(ProcButtonCur);
            }
            ProcButtonItems.DeleteAllForButton(ProcButtonCur.ProcButtonNum);
            ProcButtonItem item;

            for (int i = 0; i < listADA.Items.Count; i++)
            {
                item = new ProcButtonItem();
                item.ProcButtonNum = ProcButtonCur.ProcButtonNum;
                item.ADACode       = listADA.Items[i].ToString();
                ProcButtonItems.Insert(item);
            }
            for (int i = 0; i < listAutoCodes.SelectedIndices.Count; i++)
            {
                item = new ProcButtonItem();
                item.ProcButtonNum = ProcButtonCur.ProcButtonNum;
                item.AutoCodeNum   = AutoCodes.ListShort[listAutoCodes.SelectedIndices[i]].AutoCodeNum;
                ProcButtonItems.Insert(item);
            }
            DialogResult = DialogResult.OK;
        }
Exemplo n.º 7
0
        private void FillButtons()
        {
            listViewButtons.Items.Clear();
            imageListProcButtons.Images.Clear();
            if (selectedCat == 0)
            {
                //empty button list and return because we will be using and OD grid to display these buttons.
                ButtonList = new ProcButton[0];
                return;
            }
            ProcButtons.RefreshCache();
            ButtonList = ProcButtons.GetForCat(selectedCat);
            //first check and fix any order problems
            for (int i = 0; i < ButtonList.Length; i++)
            {
                if (ButtonList[i].ItemOrder != i)
                {
                    ButtonList[i].ItemOrder = i;
                    ProcButtons.Update(ButtonList[i]);
                }
            }
            ListViewItem item;

            for (int i = 0; i < ButtonList.Length; i++)
            {
                if (ButtonList[i].ButtonImage != "")
                {
                    //image keys are simply the ProcButtonNum
                    try {
                        imageListProcButtons.Images.Add(ButtonList[i].ProcButtonNum.ToString(), PIn.Bitmap(ButtonList[i].ButtonImage));
                    }
                    catch {
                        imageListProcButtons.Images.Add(new Bitmap(20, 20));                       //Add a blank image so the list stays in synch
                    }
                }
                item = new ListViewItem(new string[] { ButtonList[i].Description }, ButtonList[i].ProcButtonNum.ToString());
                listViewButtons.Items.Add(item);
            }
        }
Exemplo n.º 8
0
        private void butRun_Click(object sender, EventArgs e)
        {
            if (!checkTcodes.Checked && !checkNcodes.Checked && !checkDcodes.Checked && !checkAutocodes.Checked &&
                !checkProcButtons.Checked && !checkApptProcsQuickAdd.Checked && !checkRecallTypes.Checked)
            {
                MsgBox.Show(this, "Please select at least one tool first.");
                return;
            }
            Changed = false;
            int rowsInserted = 0;

            #region N Codes
            if (checkNcodes.Checked)
            {
                try {
                    rowsInserted += FormProcCodes.ImportProcCodes("", null, Properties.Resources.NoFeeProcCodes);
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                Changed = true;
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
                //fees are included because they are grouped by defs.
            }
            #endregion
            #region D Codes
            if (checkDcodes.Checked)
            {
                try {
                    if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))                     //Canadian. en-CA or fr-CA
                    {
                        if (_codeList == null)
                        {
                            CanadaDownloadProcedureCodes();
                        }
                    }
                    rowsInserted += FormProcCodes.ImportProcCodes("", _codeList, "");
                    Changed       = true;
                    int descriptionsFixed = ProcedureCodes.ResetADAdescriptions();
                    MessageBox.Show("Procedure code descriptions updated: " + descriptionsFixed.ToString());
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
            }
            #endregion
            if (checkNcodes.Checked || checkDcodes.Checked)
            {
                MessageBox.Show("Procedure codes inserted: " + rowsInserted);
            }
            #region Auto Codes
            if (checkAutocodes.Checked)
            {
                //checking for any AutoCodes and prompting the user if they exist
                if (AutoCodes.GetCount() > 0)
                {
                    string msgText = Lan.g(this, "This tool will delete all current autocodes and then add in the default autocodes.") + "\r\n";
                    //If the proc tool isn't going to put the procedure buttons back to default, warn them that they will need to reassociate them.
                    if (!checkProcButtons.Checked)
                    {
                        msgText += Lan.g(this, "Any procedure buttons associated with the current autocodes will be dissociated and will need to be reassociated manually.") + "\r\n";
                    }
                    msgText += Lan.g(this, "Continue?");
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, msgText))
                    {
                        AutoCodes.SetToDefault();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.AutoCodes);
                    }
                    else
                    {
                        checkAutocodes.Checked = false;                       //if the user hits no on the popup, uncheck and continue
                    }
                }
                //If there are no autocodes then add the defaults
                else
                {
                    AutoCodes.SetToDefault();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.AutoCodes);
                }
            }
            #endregion
            #region Proc Buttons
            if (checkProcButtons.Checked)
            {
                //checking for any custom proc button categories and prompting the user if they exist
                if (Defs.HasCustomCategories())
                {
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, "This tool will delete all current ProcButtons from the Chart Module and add in the defaults. Continue?"))
                    {
                        ProcButtons.SetToDefault();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
                    }
                    else
                    {
                        checkProcButtons.Checked = false;                      //continue and uncheck if user hits no on the popup
                    }
                }
                //no ProcButtons found, run normally
                else
                {
                    ProcButtons.SetToDefault();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
                }
            }
            #endregion
            #region Appt Procs Quick Add
            if (checkApptProcsQuickAdd.Checked)
            {
                //checking for any ApptProcsQuickAdd and prompting the user if they exist
                if (Defs.GetDefsForCategory(DefCat.ApptProcsQuickAdd).Count > 0)
                {
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, "This tool will reset the list of procedures in the appointment edit window to the defaults. Continue?"))
                    {
                        ProcedureCodes.ResetApptProcsQuickAdd();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.Defs);
                    }
                    else
                    {
                        checkApptProcsQuickAdd.Checked = false;                      //uncheck and continue if no is selected on the popup
                    }
                }
                //run normally if no customizations are found
                else
                {
                    ProcedureCodes.ResetApptProcsQuickAdd();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.Defs);
                }
            }
            #endregion
            #region Recall Types
            if (checkRecallTypes.Checked &&
                (!RecallTypes.IsUsingManuallyAddedTypes() ||                 //If they have any manually added types, ask them if they are sure they want to delete them.
                 MsgBox.Show(this, MsgBoxButtons.OKCancel, "This will delete all patient recalls for recall types which were manually added.  Continue?")))
            {
                RecallTypes.SetToDefault();
                Changed = true;
                DataValid.SetInvalid(InvalidType.RecallTypes, InvalidType.Prefs);
                SecurityLogs.MakeLogEntry(Permissions.RecallEdit, 0, "Recall types set to default.");
            }
            #endregion
            #region T Codes
            if (checkTcodes.Checked)            //Even though this is first in the interface, we need to run it last, since other regions need the T codes above.
            {
                ProcedureCodes.TcodesClear();
                Changed = true;
                //yes, this really does refresh before moving on.
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
                SecurityLogs.MakeLogEntry(Permissions.ProcCodeEdit, 0, "T-Codes deleted.");
            }
            #endregion
            if (Changed)
            {
                MessageBox.Show(Lan.g(this, "Done."));
                SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "New Customer Procedure codes tool was run.");
            }
        }
Exemplo n.º 9
0
        private void butRun_Click(object sender, EventArgs e)
        {
            if (!checkTcodes.Checked && !checkNcodes.Checked && !checkDcodes.Checked && !checkAutocodes.Checked &&
                !checkProcButtons.Checked && !checkApptProcsQuickAdd.Checked && !checkRecallTypes.Checked)
            {
                MsgBox.Show(this, "Please select at least one tool first.");
                return;
            }
            Changed = true;
            int rowsInserted = 0;

            if (checkTcodes.Checked)
            {
                ProcedureCodes.TcodesClear();
                //yes, this really does refresh before moving on.
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
            }
            if (checkNcodes.Checked)
            {
                try {
                    rowsInserted += FormProcCodes.ImportProcCodes("", null, Properties.Resources.NoFeeProcCodes);
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
                //fees are included because they are grouped by defs.
            }
            if (checkDcodes.Checked)
            {
                try {
                    if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))                     //Canadian. en-CA or fr-CA
                    {
                        if (codeList == null)
                        {
                            CanadaDownloadProcedureCodes();                            //Fill codeList with Canadian codes
                        }
                    }
                    rowsInserted += FormProcCodes.ImportProcCodes("", codeList, "");
                    int descriptionsFixed = ProcedureCodes.ResetADAdescriptions();
                    MessageBox.Show("Procedure code descriptions updated: " + descriptionsFixed.ToString());
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
            }
            if (checkNcodes.Checked || checkDcodes.Checked)
            {
                MessageBox.Show("Procedure codes inserted: " + rowsInserted);
            }
            if (checkAutocodes.Checked)
            {
                AutoCodes.SetToDefault();
                DataValid.SetInvalid(InvalidType.AutoCodes);
            }
            if (checkProcButtons.Checked)
            {
                ProcButtons.SetToDefault();
                DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
            }
            if (checkApptProcsQuickAdd.Checked)
            {
                ProcedureCodes.ResetApptProcsQuickAdd();
                DataValid.SetInvalid(InvalidType.Defs);
            }
            if (checkRecallTypes.Checked)
            {
                RecallTypes.SetToDefault();
                DataValid.SetInvalid(InvalidType.RecallTypes, InvalidType.Prefs);
            }
            MessageBox.Show(Lan.g(this, "Done."));
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "New Customer Procedure codes tool was run.");
        }
Exemplo n.º 10
0
        private void butRun_Click(object sender, EventArgs e)
        {
            //The updating of CDT codes takes place towards the end of the year, while we typically do it in December, we have
            //done it as early as Novemeber before. This warning will inform users that using the new codes will cause rejection
            //on their claims if they try to use them before the first of the new year.
            DateTime datePromptStart = new DateTime(2019, 12, 20);
            DateTime datePromptEnd   = new DateTime(datePromptStart.Year, 12, 31);

            if (DateTime.Now.Between(datePromptStart, datePromptEnd) && checkDcodes.Checked) //Only validate if attempting to update D Codes
            {
                if (MessageBox.Show(                                                         //Still between datePromptStart and the first of the next year, prompt that these codes may cause problems.
                        Lan.g(this, "Updating D Codes at this time could result in acquiring codes which are not valid until ")
                        + datePromptEnd.AddDays(1).ToShortDateString() + Lan.g(this, ". Using these codes could cause claims to be rejected, continue?")
                        , Lan.g(this, "D Codes"), MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;                    //Early return if the user is between datePromptStart and the first of the next year and they've said no to updating D Codes.
                }
            }
            if (!checkTcodes.Checked && !checkNcodes.Checked && !checkDcodes.Checked && !checkAutocodes.Checked &&
                !checkProcButtons.Checked && !checkApptProcsQuickAdd.Checked && !checkRecallTypes.Checked)
            {
                MsgBox.Show(this, "Please select at least one tool first.");
                return;
            }
            Changed = false;
            int rowsInserted = 0;

            #region N Codes
            if (checkNcodes.Checked)
            {
                try {
                    rowsInserted += FormProcCodes.ImportProcCodes("", null, Properties.Resources.NoFeeProcCodes);
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                Changed = true;
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes);
            }
            #endregion
            #region D Codes
            if (checkDcodes.Checked)
            {
                try {
                    if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))                     //Canadian. en-CA or fr-CA
                    {
                        if (_codeList == null)
                        {
                            CanadaDownloadProcedureCodes();
                        }
                    }
                    rowsInserted += FormProcCodes.ImportProcCodes("", _codeList, "");
                    Changed       = true;
                    int descriptionsFixed = ProcedureCodes.ResetADAdescriptions();
                    MessageBox.Show("Procedure code descriptions updated: " + descriptionsFixed.ToString());
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes);
            }
            #endregion
            if (checkNcodes.Checked || checkDcodes.Checked)
            {
                MessageBox.Show("Procedure codes inserted: " + rowsInserted);
            }
            #region Auto Codes
            if (checkAutocodes.Checked)
            {
                //checking for any AutoCodes and prompting the user if they exist
                if (AutoCodes.GetCount() > 0)
                {
                    string msgText = Lan.g(this, "This tool will delete all current autocodes and then add in the default autocodes.") + "\r\n";
                    //If the proc tool isn't going to put the procedure buttons back to default, warn them that they will need to reassociate them.
                    if (!checkProcButtons.Checked)
                    {
                        msgText += Lan.g(this, "Any procedure buttons associated with the current autocodes will be dissociated and will need to be reassociated manually.") + "\r\n";
                    }
                    msgText += Lan.g(this, "Continue?");
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, msgText))
                    {
                        AutoCodes.SetToDefault();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.AutoCodes);
                    }
                    else
                    {
                        checkAutocodes.Checked = false;                       //if the user hits no on the popup, uncheck and continue
                    }
                }
                //If there are no autocodes then add the defaults
                else
                {
                    AutoCodes.SetToDefault();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.AutoCodes);
                }
            }
            #endregion
            #region Proc Buttons
            if (checkProcButtons.Checked)
            {
                //checking for any custom proc button categories and prompting the user if they exist
                if (Defs.HasCustomCategories())
                {
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, "This tool will delete all current ProcButtons from the Chart Module and add in the defaults. Continue?"))
                    {
                        ProcButtons.SetToDefault();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
                    }
                    else
                    {
                        checkProcButtons.Checked = false;                      //continue and uncheck if user hits no on the popup
                    }
                }
                //no ProcButtons found, run normally
                else
                {
                    ProcButtons.SetToDefault();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
                }
            }
            #endregion
            #region Appt Procs Quick Add
            if (checkApptProcsQuickAdd.Checked)
            {
                //checking for any ApptProcsQuickAdd and prompting the user if they exist
                if (Defs.GetDefsForCategory(DefCat.ApptProcsQuickAdd).Count > 0)
                {
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, "This tool will reset the list of procedures in the appointment edit window to the defaults. Continue?"))
                    {
                        ProcedureCodes.ResetApptProcsQuickAdd();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.Defs);
                    }
                    else
                    {
                        checkApptProcsQuickAdd.Checked = false;                      //uncheck and continue if no is selected on the popup
                    }
                }
                //run normally if no customizations are found
                else
                {
                    ProcedureCodes.ResetApptProcsQuickAdd();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.Defs);
                }
            }
            #endregion
            #region Recall Types
            if (checkRecallTypes.Checked &&
                (!RecallTypes.IsUsingManuallyAddedTypes() ||                 //If they have any manually added types, ask them if they are sure they want to delete them.
                 MsgBox.Show(this, MsgBoxButtons.OKCancel, "This will delete all patient recalls for recall types which were manually added.  Continue?")))
            {
                RecallTypes.SetToDefault();
                Changed = true;
                DataValid.SetInvalid(InvalidType.RecallTypes, InvalidType.Prefs);
                SecurityLogs.MakeLogEntry(Permissions.RecallEdit, 0, "Recall types set to default.");
            }
            #endregion
            #region T Codes
            if (checkTcodes.Checked)            //Even though this is first in the interface, we need to run it last, since other regions need the T codes above.
            {
                ProcedureCodes.TcodesClear();
                Changed = true;
                //yes, this really does refresh before moving on.
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes);
                SecurityLogs.MakeLogEntry(Permissions.ProcCodeEdit, 0, "T-Codes deleted.");
            }
            #endregion
            if (Changed)
            {
                MessageBox.Show(Lan.g(this, "Done."));
                SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "New Customer Procedure codes tool was run.");
            }
        }
Exemplo n.º 11
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDescript.Text == "")
            {
                MessageBox.Show(Lan.g(this, "You must type in a description."));
                return;
            }
            if (listADA.Items.Count == 0 && listAutoCodes.SelectedIndices.Count == 0)
            {
                MessageBox.Show(Lan.g(this, "You must pick at least one Auto Code or Procedure Code."));
                return;
            }
            foreach (int index in listAutoCodes.SelectedIndices)
            {
                AutoCode autoCode = _listShortDeep[index];
                if (AutoCodeItems.GetListForCode(autoCode.AutoCodeNum).Count == 0)
                {
                    //This AutoCode was saved with no AutoCodeItems attached, which is invalid.
                    MessageBox.Show(this, Lan.g(this, "The following AutoCode has no associated Procedure Codes: ") + "\r\n" + autoCode.Description + "\r\n"
                                    + Lan.g(this, "AutoCode must be setup correctly before it can be used with a Quick Proc Button."));
                    return;
                }
            }
            //Point of no return.
            ProcButtonCur.Description = textDescript.Text;
            if (ProcButtonCur.Category != _listProcButtonCatDefs[comboCategory.SelectedIndex].DefNum)
            {
                //This will put it at the end of the order in the new category
                ProcButtonCur.ItemOrder
                    = ProcButtons.GetForCat(_listProcButtonCatDefs[comboCategory.SelectedIndex].DefNum).Length;
            }
            ProcButtonCur.Category     = _listProcButtonCatDefs[comboCategory.SelectedIndex].DefNum;
            ProcButtonCur.ButtonImage  = POut.Bitmap((Bitmap)pictureBox.Image, System.Drawing.Imaging.ImageFormat.Png);
            ProcButtonCur.IsMultiVisit = checkMultiVisit.Checked;
            if (IsNew)
            {
                ProcButtonCur.ItemOrder = ProcButtons.GetCount();
                ProcButtons.Insert(ProcButtonCur);
            }
            else
            {
                ProcButtons.Update(ProcButtonCur);
            }
            ProcButtonItems.DeleteAllForButton(ProcButtonCur.ProcButtonNum);
            ProcButtonItem item;

            for (int i = 0; i < listADA.Items.Count; i++)
            {
                item = new ProcButtonItem();
                item.ProcButtonNum = ProcButtonCur.ProcButtonNum;
                item.CodeNum       = ProcedureCodes.GetCodeNum(listADA.Items[i].ToString());
                item.ItemOrder     = i + 1;        //not i++, that would mess up the itteration.
                ProcButtonItems.Insert(item);
            }
            for (int i = 0; i < listAutoCodes.SelectedIndices.Count; i++)
            {
                item = new ProcButtonItem();
                item.ProcButtonNum = ProcButtonCur.ProcButtonNum;
                item.AutoCodeNum   = _listShortDeep[listAutoCodes.SelectedIndices[i]].AutoCodeNum;
                item.ItemOrder     = i + 1;        //not i++, that would mess up the itteration.
                ProcButtonItems.Insert(item);
            }
            DialogResult = DialogResult.OK;
        }