Ejemplo n.º 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 FormRepeatChargeEdit_Load(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         FormProcCodes FormP = new FormProcCodes();
         FormP.IsSelectionMode = true;
         FormP.ShowDialog();
         if (FormP.DialogResult != DialogResult.OK)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         ProcedureCode procCode = ProcedureCodes.GetProcCode(FormP.SelectedADA);
         if (procCode.TreatArea != TreatmentArea.Mouth)
         {
             MsgBox.Show(this, "Procedure codes that require tooth numbers are not allowed.");
             DialogResult = DialogResult.Cancel;
             return;
         }
         RepeatCur.ADACode = FormP.SelectedADA;
     }
     textADACode.Text   = RepeatCur.ADACode;
     textDesc.Text      = ProcedureCodes.GetProcCode(RepeatCur.ADACode).Descript;
     textChargeAmt.Text = RepeatCur.ChargeAmt.ToString("F");
     if (RepeatCur.DateStart.Year > 1880)
     {
         textDateStart.Text = RepeatCur.DateStart.ToShortDateString();
     }
     if (RepeatCur.DateStop.Year > 1880)
     {
         textDateStop.Text = RepeatCur.DateStop.ToShortDateString();
     }
     textNote.Text = RepeatCur.Note;
 }
Ejemplo n.º 3
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.");
        }
Ejemplo 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();
        }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
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 = AutoCodeItemCur.ADACode;
            }
            else
            {
                if (AutoCodeItems.HList.ContainsKey(FormP.SelectedADA) &&
                    (int)AutoCodeItems.HList[FormP.SelectedADA] != AutoCodeItemCur.AutoCodeNum)
                {
                    //This section is a fix for an old bug that did not cause items to get deleted properly
                    if (!AutoCodes.HList.ContainsKey((int)AutoCodeItems.HList[FormP.SelectedADA]))
                    {
                        AutoCodeItems.Delete((int)AutoCodeItems.HList[FormP.SelectedADA]);
                        textADA.Text = FormP.SelectedADA;
                    }
                    else
                    {
                        MessageBox.Show(Lan.g(this, "That ADA code is already in use in a different Auto Code.  Not allowed to use it here."));
                        textADA.Text = AutoCodeItemCur.ADACode;
                    }
                }
                else
                {
                    textADA.Text = FormP.SelectedADA;
                }
            }
        }
        ///<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)));
        }
Ejemplo n.º 8
0
		private void butPickProc_Click(object sender,EventArgs e) {
			FormProcCodes FormPC=new FormProcCodes();
			FormPC.IsSelectionMode=true;
			FormPC.ShowDialog();
			if(FormPC.DialogResult!=DialogResult.OK) {
				return;
			}
			textProcedureCode.Text=ProcedureCodes.GetProcCode(FormPC.SelectedCodeNum).ProcCode;
		}
Ejemplo n.º 9
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);
			}
		}
Ejemplo n.º 10
0
        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));
            }
        }
Ejemplo n.º 11
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)));
        }
Ejemplo n.º 12
0
        private void butPickProc_Click(object sender, EventArgs e)
        {
            FormProcCodes FormPC = new FormProcCodes();

            FormPC.IsSelectionMode = true;
            FormPC.ShowDialog();
            if (FormPC.DialogResult != DialogResult.OK)
            {
                return;
            }
            textProcedureCode.Text = ProcedureCodes.GetProcCode(FormPC.SelectedCodeNum).ProcCode;
        }
Ejemplo n.º 13
0
        private void butPlacementProcsEdit_Click(object sender, EventArgs e)
        {
            FormProcCodes FormPC = new FormProcCodes();

            FormPC.IsSelectionMode = true;
            FormPC.ShowDialog();
            if (FormPC.DialogResult == DialogResult.OK)
            {
                _listOrthoPlacementCodeNums.Add(FormPC.SelectedCodeNum);
            }
            RefreshListBoxProcs();
        }
Ejemplo n.º 14
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);
            }
        }
Ejemplo n.º 15
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormProcCodes FormPC = new FormProcCodes();

            FormPC.IsSelectionMode         = true;
            FormPC.AllowMultipleSelections = true;
            FormPC.ShowDialog();
            if (FormPC.DialogResult == DialogResult.OK)
            {
                _listProcCodes.AddRange(FormPC.ListSelectedProcCodes.Select(x => x.Copy()).ToList());
            }
            RefreshListBoxProcCodes();
        }
Ejemplo n.º 16
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);
            }
        }
Ejemplo n.º 17
0
        private void butCdt_Click(object sender, EventArgs e)
        {
            FormProcCodes formPCs = new FormProcCodes();

            formPCs.IsSelectionMode = true;
            if (formPCs.ShowDialog() == DialogResult.OK)
            {
                _encCur.CodeSystem = "CDT";
                ProcedureCode procCode = ProcedureCodes.GetProcCode(formPCs.SelectedCodeNum);
                _encCur.CodeValue     = procCode.ProcCode;
                textCodeSystem.Text   = "CDT";
                textCodeValue.Text    = procCode.ProcCode;
                textCodeDescript.Text = procCode.Descript;
            }
        }
Ejemplo n.º 18
0
        private void butEncCdt_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult == DialogResult.OK)
            {
                EncCodeSystem = "CDT";
                comboEncCodes.SelectedIndex = -1;
                ProcedureCode procCur = ProcedureCodes.GetProcCode(FormP.SelectedCodeNum);
                textEncCodeValue.Text    = procCur.ProcCode;
                textEncCodeDescript.Text = procCur.Descript;
                labelEncWarning.Visible  = true;
            }
        }
Ejemplo n.º 19
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);
        }
Ejemplo n.º 20
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();
        }
Ejemplo n.º 21
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;
     }
 }
Ejemplo n.º 22
0
        private void butAddTrigger_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.OK)
            {
                return;
            }
            RecallTrigger trigger = new RecallTrigger();

            trigger.CodeNum = FormP.SelectedCodeNum;
            //RecallTypeNum handled during save.
            TriggerList.Add(trigger);
            FillTriggers();
        }
Ejemplo 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();
        }
Ejemplo n.º 24
0
        private void butDownloadClaimform_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            //Application.DoEvents();
            string      remoteUri = textWebsitePath.Text + textRegClaimform.Text + "/";
            WebRequest  wr;
            WebResponse webResp;

            //int fileSize;
            //copy image file-------------------------------------------------------------------------------
            if (BackgroundImg != "")
            {
                myStringWebResource = remoteUri + BackgroundImg;
                WriteToFile         = PrefB.GetString("DocPath") + BackgroundImg;
                if (File.Exists(WriteToFile))
                {
                    File.Delete(WriteToFile);
                }
                wr = WebRequest.Create(myStringWebResource);
                int fileSize;
                try{
                    webResp  = wr.GetResponse();
                    fileSize = (int)webResp.ContentLength / 1024;
                }
                catch (Exception ex) {
                    Cursor = Cursors.Default;
                    MessageBox.Show("Error downloading " + BackgroundImg + ". " + ex.Message);
                    return;
                    //fileSize=0;
                }
                if (fileSize > 0)
                {
                    //start the thread that will perform the download
                    Thread workerThread = new Thread(new ThreadStart(InstanceMethod));
                    workerThread.Start();
                    //display the progress dialog to the user:
                    FormP        = new FormProgress();
                    FormP.MaxVal = (double)fileSize / 1024;
                    FormP.NumberMultiplication = 100;
                    FormP.DisplayText          = "?currentVal MB of ?maxVal MB copied";
                    FormP.NumberFormat         = "F";
                    FormP.ShowDialog();
                    if (FormP.DialogResult == DialogResult.Cancel)
                    {
                        workerThread.Abort();
                        Cursor = Cursors.Default;
                        return;
                    }
                    MsgBox.Show(this, "Image file downloaded successfully.");
                }
            }
            Cursor = Cursors.WaitCursor;          //have to do this again for some reason.
            //Import ClaimForm.xml----------------------------------------------------------------------------------
            myStringWebResource = remoteUri + "ClaimForm.xml";
            WriteToFile         = PrefB.GetString("DocPath") + "ClaimForm.xml";
            if (File.Exists(WriteToFile))
            {
                File.Delete(WriteToFile);
            }
            try{
                InstanceMethod();
            }
            catch {
            }
            int rowsAffected;

            if (File.Exists(WriteToFile))
            {
                int newclaimformnum = 0;
                try{
                    newclaimformnum = FormClaimForms.ImportForm(WriteToFile, true);
                }
                catch (ApplicationException ex) {
                    Cursor = Cursors.Default;
                    MessageBox.Show(ex.Message);
                    return;
                }
                finally{
                    File.Delete(WriteToFile);
                }
                if (newclaimformnum != 0)
                {
                    Prefs.UpdateInt("DefaultClaimForm", newclaimformnum);
                }
                //switch all insplans over to new claimform
                ClaimForm oldform = null;
                for (int i = 0; i < ClaimForms.ListLong.Length; i++)
                {
                    if (ClaimForms.ListLong[i].UniqueID == OldClaimFormID)
                    {
                        oldform = ClaimForms.ListLong[i];
                    }
                }
                if (oldform != null)
                {
                    rowsAffected = InsPlans.ConvertToNewClaimform(oldform.ClaimFormNum, newclaimformnum);
                    MessageBox.Show("Number of insurance plans changed to new form: " + rowsAffected.ToString());
                }
                DataValid.SetInvalid(InvalidTypes.ClaimForms | InvalidTypes.Prefs);
            }
            //Import ProcCodes.xml------------------------------------------------------------------------------------
            myStringWebResource = remoteUri + "ProcCodes.xml";
            WriteToFile         = PrefB.GetString("DocPath") + "ProcCodes.xml";
            if (File.Exists(WriteToFile))
            {
                File.Delete(WriteToFile);
            }
            try {
                InstanceMethod();
            }
            catch {
            }
            if (File.Exists(WriteToFile))
            {
                //move T codes over to a new "Obsolete" category which is hidden
                ProcedureCodes.TcodesMove();
                rowsAffected = 0;
                try {
                    rowsAffected = FormProcCodes.ImportProcCodes(WriteToFile, false);
                }
                catch (ApplicationException ex) {
                    Cursor = Cursors.Default;
                    MessageBox.Show(ex.Message);
                    return;
                }
                finally {
                    File.Delete(WriteToFile);
                }
                ProcedureCodes.Refresh();                //?
                MessageBox.Show("Procedure codes inserted: " + rowsAffected.ToString());
                //Change all procbuttons and autocodes from T to D.
                ProcedureCodes.TcodesAlter();
                DataValid.SetInvalid(InvalidTypes.AutoCodes | InvalidTypes.Defs | InvalidTypes.ProcCodes | InvalidTypes.ProcButtons);
            }
            MsgBox.Show(this, "Done");
            Cursor = Cursors.Default;
        }
Ejemplo n.º 25
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.");
            }
        }
Ejemplo n.º 26
0
		private void butCdt_Click(object sender,EventArgs e) {
			FormProcCodes formPCs=new FormProcCodes();
			formPCs.IsSelectionMode=true;
			if(formPCs.ShowDialog()==DialogResult.OK) {
				_encCur.CodeSystem="CDT";
				ProcedureCode procCode=ProcedureCodes.GetProcCode(formPCs.SelectedCodeNum);
				_encCur.CodeValue=procCode.ProcCode;
				textCodeSystem.Text="CDT";
				textCodeValue.Text=procCode.ProcCode;
				textCodeDescript.Text=procCode.Descript;
			}
		}
Ejemplo n.º 27
0
		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));  
      } 
		}
Ejemplo n.º 28
0
        private void FormRepeatChargeEdit_Load(object sender, EventArgs e)
        {
            SetPatient();
            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 &&
                    procCode.TreatArea != TreatmentArea.None)
                {
                    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;
            _isErx        = false;
            if (PrefC.GetBool(PrefName.DistributorKey) && Regex.IsMatch(RepeatCur.ProcCode, "^Z[0-9]{3,}$"))            //Is eRx if HQ and a using an eRx Z code.
            {
                _isErx = true;
                labelPatNum.Visible       = true;
                textPatNum.Visible        = true;
                butMoveTo.Visible         = true;
                labelNpi.Visible          = true;
                textNpi.Visible           = true;
                labelProviderName.Visible = true;
                textProvName.Visible      = true;
                labelErxAccountId.Visible = true;
                textErxAccountId.Visible  = true;
                if (!IsNew)                 //Existing eRx repeating charge.
                {
                    textNpi.Text              = RepeatCur.Npi;
                    textErxAccountId.Text     = RepeatCur.ErxAccountId;
                    textProvName.Text         = RepeatCur.ProviderName;
                    textNpi.ReadOnly          = true;
                    textErxAccountId.ReadOnly = true;
                    textProvName.ReadOnly     = true;
                }
            }
            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;
            }
            if (PrefC.IsODHQ && EServiceCodeLink.IsProcCodeAnEService(RepeatCur.ProcCode))
            {
                if (IsNew)
                {
                    MsgBox.Show(this, "You cannot manually create any eService repeating charges.\r\n"
                                + "Use the Signup Portal instead.\r\n\r\n"
                                + "The Charge Amount can be manually edited after the Signup Portal has created the desired eService repeating charge.");
                    DialogResult = DialogResult.Abort;
                    return;
                }
                //The only things that users should be able to do for eServices are:
                //1. Change the repeating charge amount.
                //2. Manipulate the Start Date.
                //3. Manipulate the Note.
                //4. Manipulate Billing Day because not all customers will have a non-eService repeating charge in order to manipulate.
                //This is because legacy users (versions prior to 17.1) need the ability to manually set their monthly charge amount, etc.
                SetFormReadOnly(this, butOK, butCancel
                                , textChargeAmt, labelChargeAmount
                                , textDateStart, labelDateStart
                                , textNote, labelNote
                                , textBillingDay, labelBillingCycleDay);
            }
            Patient pat = Patients.GetPat(RepeatCur.PatNum);          //pat should never be null. If it is, this will fail.

            //If this is a new repeat charge and no other active repeat charges exist, set the billing cycle day to today
            if (IsNew && !RepeatCharges.ActiveRepeatChargeExists(RepeatCur.PatNum))
            {
                textBillingDay.Text = DateTimeOD.Today.Day.ToString();
            }
            else
            {
                textBillingDay.Text = pat.BillingCycleDay.ToString();
            }
            if (PrefC.GetBool(PrefName.BillingUseBillingCycleDay))
            {
                labelBillingCycleDay.Visible = true;
                textBillingDay.Visible       = true;
            }
            checkUsePrepay.Checked = RepeatCur.UsePrepay;
        }
Ejemplo n.º 29
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);
		}
Ejemplo n.º 30
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();
 }
Ejemplo n.º 31
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);
			}
		}
Ejemplo n.º 32
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.OK)
            {
                return;
            }
            Procedure ProcCur;

            ProcCur         = new Procedure();  //going to be an insert, so no need to set Procedures.CurOld
            ProcCur.CodeNum = FormP.SelectedCodeNum;
            //procnum
            ProcCur.PatNum = AptCur.PatNum;
            //aptnum
            //proccode
            //ProcCur.CodeNum=ProcedureCodes.GetProcCode(ProcCur.OldCode).CodeNum;//already set
            ProcCur.ProcDate = DateTime.Today;
            ProcCur.DateTP   = ProcCur.ProcDate;
            //int totUnits = ProcCur.BaseUnits + ProcCur.UnitQty;
            InsPlan        priplan     = null;
            InsSub         prisub      = null;
            Family         fam         = Patients.GetFamily(AptCur.PatNum);
            Patient        pat         = fam.GetPatient(AptCur.PatNum);
            List <InsSub>  subList     = InsSubs.RefreshForFam(fam);
            List <InsPlan> planList    = InsPlans.RefreshForSubList(subList);
            List <PatPlan> patPlanList = PatPlans.Refresh(pat.PatNum);

            if (patPlanList.Count > 0)
            {
                prisub  = InsSubs.GetSub(patPlanList[0].InsSubNum, subList);
                priplan = InsPlans.GetPlan(prisub.PlanNum, planList);
            }
            //Check if it's a medical procedure.
            double insfee;
            bool   isMed = false;

            ProcCur.MedicalCode = ProcedureCodes.GetProcCode(ProcCur.CodeNum).MedicalCode;
            if (ProcCur.MedicalCode != null && ProcCur.MedicalCode != "")
            {
                isMed = true;
            }
            //Get fee schedule for medical or dental.
            long feeSch;

            if (isMed)
            {
                feeSch = Fees.GetMedFeeSched(pat, planList, patPlanList, subList);
            }
            else
            {
                feeSch = Fees.GetFeeSched(pat, planList, patPlanList, subList);
            }
            //Get the fee amount for medical or dental.
            if (PrefC.GetBool(PrefName.MedicalFeeUsedForNewProcs) && isMed)
            {
                insfee = Fees.GetAmount0(ProcedureCodes.GetProcCode(ProcCur.MedicalCode).CodeNum, feeSch);
            }
            else
            {
                insfee = Fees.GetAmount0(ProcCur.CodeNum, feeSch);
            }
            if (priplan != null && priplan.PlanType == "p")         //PPO
            {
                double standardfee = Fees.GetAmount0(ProcCur.CodeNum, Providers.GetProv(Patients.GetProvNum(pat)).FeeSched);
                if (standardfee > insfee)
                {
                    ProcCur.ProcFee = standardfee;
                }
                else
                {
                    ProcCur.ProcFee = insfee;
                }
            }
            else
            {
                ProcCur.ProcFee = insfee;
            }
            //surf
            //ToothNum
            //Procedures.Cur.ToothRange
            //ProcCur.NoBillIns=ProcedureCodes.GetProcCode(ProcCur.ProcCode).NoBillIns;
            ProcCur.Priority   = 0;
            ProcCur.ProcStatus = ProcStat.TP;
            if (ProcedureCodes.GetProcCode(ProcCur.CodeNum).IsHygiene &&
                pat.SecProv != 0)
            {
                ProcCur.ProvNum = pat.SecProv;
            }
            else
            {
                ProcCur.ProvNum = pat.PriProv;
            }
            ProcCur.Note      = "";
            ProcCur.ClinicNum = pat.ClinicNum;
            //dx
            //nextaptnum
            ProcCur.DateEntryC     = DateTime.Now;
            ProcCur.BaseUnits      = ProcedureCodes.GetProcCode(ProcCur.CodeNum).BaseUnits;
            ProcCur.SiteNum        = pat.SiteNum;
            ProcCur.RevCode        = ProcedureCodes.GetProcCode(ProcCur.CodeNum).RevenueCodeDefault;
            ProcCur.DiagnosticCode = PrefC.GetString(PrefName.ICD9DefaultForNewProcs);
            Procedures.Insert(ProcCur);
            List <Benefit> benefitList = Benefits.Refresh(patPlanList, subList);

            Procedures.ComputeEstimates(ProcCur, pat.PatNum, new List <ClaimProc>(), true, planList, patPlanList, benefitList, pat.Age, subList);
            FormProcEdit FormPE = new FormProcEdit(ProcCur, pat.Copy(), fam);

            FormPE.IsNew = true;
            FormPE.ShowDialog();
            if (FormPE.DialogResult == DialogResult.Cancel)
            {
                //any created claimprocs are automatically deleted from within procEdit window.
                try{
                    Procedures.Delete(ProcCur.ProcNum);                    //also deletes the claimprocs
                }
                catch (Exception ex) {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (Programs.UsingOrion)
            {
                //No need to synch with Orion mode.
            }
            else
            {
                //Default is set to TP, so Synch is usually not needed.
                if (ProcCur.ProcStatus == ProcStat.C || ProcCur.ProcStatus == ProcStat.EC || ProcCur.ProcStatus == ProcStat.EO)
                {
                    Recalls.Synch(pat.PatNum);
                }
            }
            FillGrid();
        }
Ejemplo n.º 33
0
 private void butAddTrigger_Click(object sender,EventArgs e)
 {
     FormProcCodes FormP=new FormProcCodes();
     FormP.IsSelectionMode=true;
     FormP.ShowDialog();
     if(FormP.DialogResult!=DialogResult.OK){
         return;
     }
     RecallTrigger trigger=new RecallTrigger();
     trigger.CodeNum=FormP.SelectedCodeNum;
     //RecallTypeNum handled during save.
     TriggerList.Add(trigger);
     FillTriggers();
 }
Ejemplo n.º 34
0
		private void butChange_Click(object sender, System.EventArgs e) {
			FormProcCodes FormP=new FormProcCodes();
      FormP.IsSelectionMode=true;
      FormP.ShowDialog();
      if(FormP.DialogResult!=DialogResult.OK){
				return;
			}
			ProcedureCode procCodeOld=ProcedureCodes.GetProcCode(ProcCur.CodeNum);
			ProcedureCode procCodeNew=ProcedureCodes.GetProcCode(FormP.SelectedCodeNum);
			if(procCodeOld.TreatArea != procCodeNew.TreatArea) {
				MsgBox.Show(this,"Not allowed due to treatment area mismatch.");
				return;
			}
      ProcCur.CodeNum=FormP.SelectedCodeNum;
      ProcedureCode2=ProcedureCodes.GetProcCode(FormP.SelectedCodeNum);
      textDesc.Text=ProcedureCode2.Descript;
			long priSubNum=PatPlans.GetInsSubNum(PatPlanList,1);
			InsSub prisub=InsSubs.GetSub(priSubNum,SubList);//can handle an inssubnum=0
			//long priPlanNum=PatPlans.GetPlanNum(PatPlanList,1);
			InsPlan priplan=InsPlans.GetPlan(prisub.PlanNum,PlanList);//can handle a plannum=0
			double insfee=Fees.GetAmount0(ProcCur.CodeNum,Fees.GetFeeSched(PatCur,PlanList,PatPlanList,SubList));
			if(priplan!=null && priplan.PlanType=="p") {//PPO
				double standardfee=Fees.GetAmount0(ProcCur.CodeNum,Providers.GetProv(Patients.GetProvNum(PatCur)).FeeSched);
				if(standardfee>insfee) {
					ProcCur.ProcFee=standardfee;
				}
				else {
					ProcCur.ProcFee=insfee;
				}
			}
			else {
				ProcCur.ProcFee=insfee;
			}
			switch(ProcedureCode2.TreatArea){ 
				case TreatmentArea.Quad:
					ProcCur.Surf="UR";
					radioUR.Checked=true;
					break;
				case TreatmentArea.Sextant:
					ProcCur.Surf="1";
					radioS1.Checked=true;
					break;
				case TreatmentArea.Arch:
					ProcCur.Surf="U";
					radioU.Checked=true;
					break;
			}
			for(int i=0;i<ClaimProcsForProc.Count;i++) {
				if(ClaimProcsForProc[i].ClaimPaymentNum!=0) {
					continue;//this shouldn't be possible, but it's a good check to make.
				}
				ClaimProcs.Delete(ClaimProcsForProc[i]);//that way, completely new ones will be added back, and NoBillIns will be accurate.
			}
			ClaimProcsForProc=new List<ClaimProc>();
			Procedures.ComputeEstimates(ProcCur,PatCur.PatNum,ClaimProcsForProc,false,PlanList,PatPlanList,BenefitList,PatCur.Age,SubList);
			FillIns();
      SetControlsUpperLeft();
		}
Ejemplo n.º 35
0
		private void butAddProc_Click(object sender,System.EventArgs e) {
			orionProvNum=0;
			if(newStatus==ProcStat.C) {
				if(!Security.IsAuthorized(Permissions.ProcComplCreate,PIn.Date(textDate.Text))) {
					return;
				}
			}
			bool isValid;
			TreatmentArea tArea;
			FormProcCodes FormP=new FormProcCodes();
			FormP.IsSelectionMode=true;
			FormP.ShowDialog();
			if(FormP.DialogResult!=DialogResult.OK) {
				return;
			}
			List<string> procCodes=new List<string>();
			Procedures.SetDateFirstVisit(DateTimeOD.Today,1,PatCur);
			Procedure ProcCur;
			for(int n=0;n==0 || n<toothChart.SelectedTeeth.Count;n++) {
				isValid=true;
				ProcCur=new Procedure();//going to be an insert, so no need to set Procedures.CurOld
				//Procedure
				ProcCur.CodeNum = FormP.SelectedCodeNum;
				//Procedures.Cur.ProcCode=ProcButtonItems.CodeList[i];
				tArea=ProcedureCodes.GetProcCode(ProcCur.CodeNum).TreatArea;
				if((tArea==TreatmentArea.Arch
					|| tArea==TreatmentArea.Mouth
					|| tArea==TreatmentArea.Quad
					|| tArea==TreatmentArea.Sextant
					|| tArea==TreatmentArea.ToothRange)
					&& n>0) {//the only two left are tooth and surf
					continue;//only entered if n=0, so they don't get entered more than once.
				}
				else if(tArea==TreatmentArea.Quad) {
					//This is optimized for single proc like a space maintainer.  User can select a tooth to set quadrant.
					if(toothChart.SelectedTeeth.Count>0) {
						ProcCur.Surf=Tooth.GetQuadrant(toothChart.SelectedTeeth[0]);
					}
					AddProcedure(ProcCur);
				}
				else if(tArea==TreatmentArea.Surf) {
					if(toothChart.SelectedTeeth.Count==0) {
						isValid=false;
					}
					else {
						ProcCur.ToothNum=toothChart.SelectedTeeth[n];
						//Procedures.Cur=ProcCur;
					}
					if(textSurf.Text=="") {
						isValid=false;
					}
					else {
						ProcCur.Surf=Tooth.SurfTidyFromDisplayToDb(textSurf.Text,ProcCur.ToothNum);
					}
					if(isValid) {
						AddQuick(ProcCur);
					}
					else {
						AddProcedure(ProcCur);
					}
				}
				else if(tArea==TreatmentArea.Tooth) {
					if(toothChart.SelectedTeeth.Count==0) {
						//Procedures.Cur=ProcCur;
						AddProcedure(ProcCur);
					}
					else {
						ProcCur.ToothNum=toothChart.SelectedTeeth[n];
						//Procedures.Cur=ProcCur;
						AddQuick(ProcCur);
					}
				}
				else if(tArea==TreatmentArea.ToothRange) {
					if(toothChart.SelectedTeeth.Count==0) {
						//Procedures.Cur=ProcCur;
						AddProcedure(ProcCur);
					}
					else {
						ProcCur.ToothRange="";
						for(int b=0;b<toothChart.SelectedTeeth.Count;b++) {
							if(b!=0) ProcCur.ToothRange+=",";
							ProcCur.ToothRange+=toothChart.SelectedTeeth[b];
						}
						//Procedures.Cur=ProcCur;
						AddProcedure(ProcCur);//it's nice to see the procedure to verify the range
					}
				}
				else if(tArea==TreatmentArea.Arch) {
					if(toothChart.SelectedTeeth.Count==0) {
						//Procedures.Cur=ProcCur;
						AddProcedure(ProcCur);
						continue;
					}
					if(Tooth.IsMaxillary(toothChart.SelectedTeeth[0])) {
						ProcCur.Surf="U";
					}
					else {
						ProcCur.Surf="L";
					}
					//Procedures.Cur=ProcCur;
					AddQuick(ProcCur);
				}
				else if(tArea==TreatmentArea.Sextant) {
					//Procedures.Cur=ProcCur;
					AddProcedure(ProcCur);
				}
				else {//mouth
					//Procedures.Cur=ProcCur;
					AddQuick(ProcCur);
				}
				procCodes.Add(ProcedureCodes.GetProcCode(ProcCur.CodeNum).ProcCode);
			}//for n
			//this was requiring too many irrelevant queries and going too slowly   //ModuleSelected(PatCur.PatNum);
			string teeth = "";
			if(newStatus==ProcStat.C) {
				for(int i=0;i<toothChart.SelectedTeeth.Count;i++) {
					if(i>0) {
						teeth+=", ";
					}
					teeth+=toothChart.SelectedTeeth[i].ToString();
				}
			}
			ToothInitialList=ToothInitials.Refresh(PatCur.PatNum);
			FillToothChart(false);
			ClearButtons();
			FillProgNotes();
			if(newStatus==ProcStat.C) {
				string descript="";
				if(procCodes.Count!=0) {//probably overkill
					descript=ProcedureCodes.GetProcCode(procCodes[0]).Descript;
				}
				if(teeth!="") {
					SecurityLogs.MakeLogEntry(Permissions.ProcComplCreate,PatCur.PatNum,descript+" created for the following teeth: "+teeth);
				}
				else {
					SecurityLogs.MakeLogEntry(Permissions.ProcComplCreate,PatCur.PatNum,descript);
				}
				AutomationL.Trigger(AutomationTrigger.CompleteProcedure,procCodes,PatCur.PatNum);
			}
		}
Ejemplo n.º 36
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.");
        }
Ejemplo n.º 37
0
		private void butAdd_Click(object sender,EventArgs e) {
			if(comboProvNum.SelectedIndex==-1) {
				MsgBox.Show(this,"Please select a dentist.");
				return;
			}
			FormProcCodes FormP=new FormProcCodes();
			FormP.IsSelectionMode=true;
			FormP.ShowDialog();
			if(FormP.DialogResult!=DialogResult.OK) {
				return;
			}
			Procedure ProcCur;
			ProcCur=new Procedure();//going to be an insert, so no need to set Procedures.CurOld
			ProcCur.CodeNum = FormP.SelectedCodeNum;
			//procnum
			ProcCur.PatNum=AptCur.PatNum;
			//aptnum
			//proccode
			//ProcCur.CodeNum=ProcedureCodes.GetProcCode(ProcCur.OldCode).CodeNum;//already set
			ProcCur.ProcDate=DateTimeOD.Today;
			ProcCur.DateTP=ProcCur.ProcDate;
			//int totUnits = ProcCur.BaseUnits + ProcCur.UnitQty;
			InsPlan priplan=null;
			InsSub prisub=null;
			//Family fam=Patients.GetFamily(AptCur.PatNum);
			//Patient pat=fam.GetPatient(AptCur.PatNum);
			//InsPlan[] planList=InsPlans.Refresh(fam);
			List<PatPlan> patPlanList=PatPlans.Refresh(pat.PatNum);
			if(patPlanList.Count>0) {
				prisub=InsSubs.GetSub(patPlanList[0].InsSubNum,SubList);
				priplan=InsPlans.GetPlan(prisub.PlanNum,PlanList);
			}
			//Check if it's a medical procedure.
			double insfee;
			bool isMed = false;
			ProcCur.MedicalCode=ProcedureCodes.GetProcCode(ProcCur.CodeNum).MedicalCode;
			if(ProcCur.MedicalCode != null && ProcCur.MedicalCode != "") {
				isMed = true;
			}
			//Get fee schedule for medical or dental.
			long feeSch;
			if(isMed) {
				feeSch=Fees.GetMedFeeSched(pat,PlanList,patPlanList,SubList);
			}
			else {
				feeSch=Fees.GetFeeSched(pat,PlanList,patPlanList,SubList);
			}
			//Get the fee amount for medical or dental.
			if(PrefC.GetBool(PrefName.MedicalFeeUsedForNewProcs) && isMed) {
				insfee=Fees.GetAmount0(ProcedureCodes.GetProcCode(ProcCur.MedicalCode).CodeNum,feeSch);
			}
			else {
				insfee=Fees.GetAmount0(ProcCur.CodeNum,feeSch);
			}
			if(priplan!=null && priplan.PlanType=="p") {//PPO
				double standardfee=Fees.GetAmount0(ProcCur.CodeNum,Providers.GetProv(Patients.GetProvNum(pat)).FeeSched);
				if(standardfee>insfee) {
					ProcCur.ProcFee=standardfee;
				}
				else {
					ProcCur.ProcFee=insfee;
				}
			}
			else {
				ProcCur.ProcFee=insfee;
			}
			//surf
			//ToothNum
			//Procedures.Cur.ToothRange
			//ProcCur.NoBillIns=ProcedureCodes.GetProcCode(ProcCur.ProcCode).NoBillIns;
			ProcCur.Priority=0;
			ProcCur.ProcStatus=ProcStat.TP;
			long aptProvNum=ProviderC.ListShort[0].ProvNum;
			if(comboProvNum.SelectedIndex!=-1) {
				aptProvNum=ProviderC.ListShort[comboProvNum.SelectedIndex].ProvNum;
			}
			long aptProvHyg=0;
			if(comboProvHyg.SelectedIndex>0) {
				aptProvHyg=ProviderC.ListShort[comboProvHyg.SelectedIndex-1].ProvNum;
			}
			if(ProcedureCodes.GetProcCode(ProcCur.CodeNum).IsHygiene
				&& aptProvHyg != 0) {
				ProcCur.ProvNum=aptProvHyg;
			}
			else {
				ProcCur.ProvNum=aptProvNum;
			}
			if(ProcedureCodes.GetProcCode(ProcCur.CodeNum).ProvNumDefault!=0) {//Override provider for procedures with a default provider
				ProcCur.ProvNum=ProcedureCodes.GetProcCode(ProcCur.CodeNum).ProvNumDefault;
			}
			ProcCur.Note="";
			ProcCur.ClinicNum=pat.ClinicNum;
			//dx
			//nextaptnum
			ProcCur.DateEntryC=DateTime.Now;
			ProcCur.BaseUnits=ProcedureCodes.GetProcCode(ProcCur.CodeNum).BaseUnits;
			ProcCur.SiteNum=pat.SiteNum;
			ProcCur.RevCode=ProcedureCodes.GetProcCode(ProcCur.CodeNum).RevenueCodeDefault;
			ProcCur.DiagnosticCode=PrefC.GetString(PrefName.ICD9DefaultForNewProcs);
			Procedures.Insert(ProcCur);
			List<Benefit> benefitList=Benefits.Refresh(patPlanList,SubList);
			Procedures.ComputeEstimates(ProcCur,pat.PatNum,new List<ClaimProc>(),true,PlanList,patPlanList,benefitList,pat.Age,SubList);
			FormProcEdit FormPE=new FormProcEdit(ProcCur,pat.Copy(),fam);
			FormPE.IsNew=true;
			if(Programs.UsingOrion) {
				FormPE.OrionProvNum=ProviderC.ListShort[comboProvNum.SelectedIndex].ProvNum;
				FormPE.OrionDentist=true;
			}
			FormPE.ShowDialog();
			if(FormPE.DialogResult==DialogResult.Cancel) {
				//any created claimprocs are automatically deleted from within procEdit window.
				try {
					Procedures.Delete(ProcCur.ProcNum);//also deletes the claimprocs
				}
				catch(Exception ex) {
					MessageBox.Show(ex.Message);
				}
				return;
			}
			else if(Programs.UsingOrion) {
				//No need to synch with Orion mode.
			}
			else {
				//Default is set to TP, so Synch is usually not needed.
				if(ProcCur.ProcStatus==ProcStat.C||ProcCur.ProcStatus==ProcStat.EC||ProcCur.ProcStatus==ProcStat.EO) {
					Recalls.Synch(pat.PatNum);
				}
			}
			/*
			FormApptProcs FormAP=new FormApptProcs();
			FormAP.AptCur=AptCur.Clone();
			//but we do need the status to be accurate:
			if (AptCur.AptStatus == ApptStatus.Planned) {
				;
			}
			else if(comboStatus.SelectedIndex==-1) {
				FormAP.AptCur.AptStatus=ApptStatus.Scheduled;
			}
			else if (AptCur.AptStatus == ApptStatus.PtNote | AptCur.AptStatus == ApptStatus.PtNoteCompleted){
				FormAP.AptCur.AptStatus = (ApptStatus)comboStatus.SelectedIndex + 7;
			}
			else {
				FormAP.AptCur.AptStatus=(ApptStatus)comboStatus.SelectedIndex+1;
			}
			FormAP.ShowDialog();
			if(FormAP.DialogResult!=DialogResult.OK){
				return;
			}*/
			bool isPlanned=AptCur.AptStatus==ApptStatus.Planned;
			Procedures.AttachToApt(ProcCur.ProcNum,AptCur.AptNum,isPlanned);
			Recalls.Synch(AptCur.PatNum);//might not be needed because TP?
			DS.Tables.Remove("Procedure");
			DS.Tables.Add(Appointments.GetApptEdit(AptCur.AptNum).Tables["Procedure"].Copy());
			FillProcedures();
			CalculateTime();
			FillTime();
		}
Ejemplo n.º 38
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.OK)
            {
                return;
            }
            Procedure ProcCur;

            ProcCur         = new Procedure();  //going to be an insert, so no need to set Procedures.CurOld
            ProcCur.CodeNum = FormP.SelectedCodeNum;
            //procnum
            ProcCur.PatNum = AptCur.PatNum;
            //aptnum
            //proccode
            //ProcCur.CodeNum=ProcedureCodes.GetProcCode(ProcCur.OldCode).CodeNum;//already set
            ProcCur.ProcDate = DateTime.Today;
            ProcCur.DateTP   = ProcCur.ProcDate;
            //int totUnits = ProcCur.BaseUnits + ProcCur.UnitQty;
            Family         fam         = Patients.GetFamily(AptCur.PatNum);
            Patient        pat         = fam.GetPatient(AptCur.PatNum);
            List <InsSub>  subList     = InsSubs.RefreshForFam(fam);
            List <InsPlan> planList    = InsPlans.RefreshForSubList(subList);
            List <PatPlan> patPlanList = PatPlans.Refresh(pat.PatNum);
            ProcedureCode  procCodeCur = ProcedureCodes.GetProcCode(ProcCur.CodeNum);

            ProcCur.MedicalCode = procCodeCur.MedicalCode;
            if (procCodeCur.IsHygiene && pat.SecProv != 0)
            {
                ProcCur.ProvNum = pat.SecProv;
            }
            else
            {
                ProcCur.ProvNum = pat.PriProv;
            }
            ProcCur.ClinicNum = pat.ClinicNum;
            ProcCur.ProcFee   = Procedures.GetProcFee(pat, patPlanList, subList, planList, ProcCur.CodeNum, ProcCur.ProvNum, ProcCur.ClinicNum, ProcCur.MedicalCode);
            //surf
            //ToothNum
            //Procedures.Cur.ToothRange
            //ProcCur.NoBillIns=ProcedureCodes.GetProcCode(ProcCur.ProcCode).NoBillIns;
            ProcCur.Priority   = 0;
            ProcCur.ProcStatus = ProcStat.TP;
            ProcCur.Note       = "";
            //dx
            //nextaptnum
            ProcCur.DateEntryC     = DateTime.Now;
            ProcCur.BaseUnits      = procCodeCur.BaseUnits;
            ProcCur.SiteNum        = pat.SiteNum;
            ProcCur.RevCode        = procCodeCur.RevenueCodeDefault;
            ProcCur.DiagnosticCode = PrefC.GetString(PrefName.ICD9DefaultForNewProcs);
            ProcCur.PlaceService   = (PlaceOfService)PrefC.GetInt(PrefName.DefaultProcedurePlaceService);        //Default proc place of service for the Practice is used.
            if (Userods.IsUserCpoe(Security.CurUser))
            {
                //This procedure is considered CPOE because the provider is the one that has added it.
                ProcCur.IsCpoe = true;
            }
            Procedures.Insert(ProcCur);
            List <Benefit> benefitList = Benefits.Refresh(patPlanList, subList);

            Procedures.ComputeEstimates(ProcCur, pat.PatNum, new List <ClaimProc>(), true, planList, patPlanList, benefitList, pat.Age, subList);
            FormProcEdit FormPE = new FormProcEdit(ProcCur, pat.Copy(), fam);

            FormPE.IsNew = true;
            FormPE.ShowDialog();
            if (FormPE.DialogResult == DialogResult.Cancel)
            {
                //any created claimprocs are automatically deleted from within procEdit window.
                try{
                    Procedures.Delete(ProcCur.ProcNum);                    //also deletes the claimprocs
                }
                catch (Exception ex) {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (Programs.UsingOrion)
            {
                //No need to synch with Orion mode.
            }
            else
            {
                //Default is set to TP, so Synch is usually not needed.
                if (ProcCur.ProcStatus == ProcStat.C || ProcCur.ProcStatus == ProcStat.EC || ProcCur.ProcStatus == ProcStat.EO)
                {
                    Recalls.Synch(pat.PatNum);
                }
            }
            FillGrid();
        }
Ejemplo n.º 39
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.");
            }
        }
Ejemplo n.º 40
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;
			}
		}
Ejemplo n.º 41
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;
 }
Ejemplo n.º 42
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;
			}
		}
Ejemplo n.º 43
0
 //Lists
 private void menuItemProcCodes_Click(object sender, System.EventArgs e)
 {
     //security handled within form
     FormProcCodes FormP=new FormProcCodes();
     FormP.ShowDialog();
 }
Ejemplo n.º 44
0
 private void butAdd_Click(object sender,EventArgs e)
 {
     FormProcCodes FormP=new FormProcCodes();
     FormP.IsSelectionMode=true;
     FormP.ShowDialog();
     if(FormP.DialogResult!=DialogResult.OK){
         return;
     }
     Procedure ProcCur;
     ProcCur=new Procedure();//going to be an insert, so no need to set Procedures.CurOld
     ProcCur.CodeNum = FormP.SelectedCodeNum;
     //procnum
     ProcCur.PatNum=AptCur.PatNum;
     //aptnum
     //proccode
     //ProcCur.CodeNum=ProcedureCodes.GetProcCode(ProcCur.OldCode).CodeNum;//already set
     ProcCur.ProcDate=DateTime.Today;
     ProcCur.DateTP=ProcCur.ProcDate;
     //int totUnits = ProcCur.BaseUnits + ProcCur.UnitQty;
     InsPlan priplan=null;
     InsSub prisub=null;
     Family fam=Patients.GetFamily(AptCur.PatNum);
     Patient pat=fam.GetPatient(AptCur.PatNum);
     List<InsSub> subList=InsSubs.RefreshForFam(fam);
     List<InsPlan> planList=InsPlans.RefreshForSubList(subList);
     List<PatPlan> patPlanList=PatPlans.Refresh(pat.PatNum);
     if(patPlanList.Count>0) {
         prisub=InsSubs.GetSub(patPlanList[0].InsSubNum,subList);
         priplan=InsPlans.GetPlan(prisub.PlanNum,planList);
     }
     //Check if it's a medical procedure.
     double insfee;
     bool isMed = false;
     ProcCur.MedicalCode=ProcedureCodes.GetProcCode(ProcCur.CodeNum).MedicalCode;
     if(ProcCur.MedicalCode != null && ProcCur.MedicalCode != "") {
         isMed = true;
     }
     //Get fee schedule for medical or dental.
     long feeSch;
     if(isMed) {
         feeSch=Fees.GetMedFeeSched(pat,planList,patPlanList,subList);
     }
     else {
         feeSch=Fees.GetFeeSched(pat,planList,patPlanList,subList);
     }
     //Get the fee amount for medical or dental.
     if(PrefC.GetBool(PrefName.MedicalFeeUsedForNewProcs) && isMed) {
         insfee=Fees.GetAmount0(ProcedureCodes.GetProcCode(ProcCur.MedicalCode).CodeNum,feeSch);
     }
     else {
         insfee=Fees.GetAmount0(ProcCur.CodeNum,feeSch);
     }
     if(priplan!=null && priplan.PlanType=="p") {//PPO
         double standardfee=Fees.GetAmount0(ProcCur.CodeNum,Providers.GetProv(Patients.GetProvNum(pat)).FeeSched);
         if(standardfee>insfee) {
             ProcCur.ProcFee=standardfee;
         }
         else {
             ProcCur.ProcFee=insfee;
         }
     }
     else {
         ProcCur.ProcFee=insfee;
     }
     //surf
     //ToothNum
     //Procedures.Cur.ToothRange
     //ProcCur.NoBillIns=ProcedureCodes.GetProcCode(ProcCur.ProcCode).NoBillIns;
     ProcCur.Priority=0;
     ProcCur.ProcStatus=ProcStat.TP;
     if(ProcedureCodes.GetProcCode(ProcCur.CodeNum).IsHygiene
         && pat.SecProv != 0){
         ProcCur.ProvNum=pat.SecProv;
     }
     else{
         ProcCur.ProvNum=pat.PriProv;
     }
     ProcCur.Note="";
     ProcCur.ClinicNum=pat.ClinicNum;
     //dx
     //nextaptnum
     ProcCur.DateEntryC=DateTime.Now;
     ProcCur.BaseUnits=ProcedureCodes.GetProcCode(ProcCur.CodeNum).BaseUnits;
     ProcCur.SiteNum=pat.SiteNum;
     ProcCur.RevCode=ProcedureCodes.GetProcCode(ProcCur.CodeNum).RevenueCodeDefault;
     Procedures.Insert(ProcCur);
     List <Benefit> benefitList=Benefits.Refresh(patPlanList,subList);
     Procedures.ComputeEstimates(ProcCur,pat.PatNum,new List<ClaimProc>(),true,planList,patPlanList,benefitList,pat.Age,subList);
     FormProcEdit FormPE=new FormProcEdit(ProcCur,pat.Copy(),fam);
     FormPE.IsNew=true;
     FormPE.ShowDialog();
     if(FormPE.DialogResult==DialogResult.Cancel){
         //any created claimprocs are automatically deleted from within procEdit window.
         try{
             Procedures.Delete(ProcCur.ProcNum);//also deletes the claimprocs
         }
         catch(Exception ex){
             MessageBox.Show(ex.Message);
         }
     }
     else if(Programs.UsingOrion){
         //No need to synch with Orion mode.
     }
     else{
         //Default is set to TP, so Synch is usually not needed.
         if(ProcCur.ProcStatus==ProcStat.C||ProcCur.ProcStatus==ProcStat.EC||ProcCur.ProcStatus==ProcStat.EO){
             Recalls.Synch(pat.PatNum);
         }
     }
     FillGrid();
 }