コード例 #1
0
ファイル: FormAutoItemEdit.cs プロジェクト: royedwards/DRDNet
        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);
            }
        }
コード例 #2
0
ファイル: FormEhrSettings.cs プロジェクト: kjb7749/testImport
        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;
            }
        }
コード例 #3
0
        private void butChange_Click(object sender, System.EventArgs e)
        {
            FormProcCodes FormP = new FormProcCodes();

            FormP.IsSelectionMode = true;
            FormP.ShowDialog();
            if (FormP.DialogResult == DialogResult.Cancel)
            {
                textADA.Text = 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;
                }
            }
        }
コード例 #4
0
        ///<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)));
        }
コード例 #5
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.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;
 }
コード例 #6
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();
        }
コード例 #7
0
ファイル: FormProcButtonQuickEdit.cs プロジェクト: mnisl/OD
		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;
		}
コード例 #8
0
ファイル: FormResellerServiceEdit.cs プロジェクト: mnisl/OD
		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);
			}
		}
コード例 #9
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));
            }
        }
コード例 #10
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();
        }
コード例 #11
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);
            }
        }
コード例 #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;
        }
コード例 #13
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)));
        }
コード例 #14
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();
        }
コード例 #15
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);
            }
        }
コード例 #16
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;
            }
        }
コード例 #17
0
        private void butProcCode_Click(object sender, EventArgs e)
        {
            FormProcCodes formp = new FormProcCodes();

            formp.IsSelectionMode = true;
            formp.ShowDialog();
            if (formp.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (textProcCodes.Text != "")
            {
                textProcCodes.Text += ",";
            }
            textProcCodes.Text += ProcedureCodes.GetStringProcCode(formp.SelectedCodeNum);
        }
コード例 #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;
            }
        }
コード例 #19
0
ファイル: FormRecallTypeEdit.cs プロジェクト: nampn/ODental
        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();
        }
コード例 #20
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;
     }
 }
コード例 #21
0
ファイル: FormRecallTypeEdit.cs プロジェクト: nampn/ODental
        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();
        }
コード例 #22
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();
        }
コード例 #23
0
ファイル: FormProcButtonEdit.cs プロジェクト: mnisl/OD
		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));  
      } 
		}
コード例 #24
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();
		}
コード例 #25
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);
		}
コード例 #26
0
ファイル: FormEncounterEdit.cs プロジェクト: mnisl/OD
		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;
			}
		}
コード例 #27
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();
        }
コード例 #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;
        }
コード例 #29
0
ファイル: FormApptProcs.cs プロジェクト: kjb7749/testImport
        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();
        }
コード例 #30
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);
			}
		}
コード例 #31
0
ファイル: FormRecallTypeEdit.cs プロジェクト: nampn/ODental
 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();
 }
コード例 #32
0
ファイル: FormRecallTypeEdit.cs プロジェクト: nampn/ODental
 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();
 }
コード例 #33
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();
		}
コード例 #34
0
ファイル: FormAutoItemEdit.cs プロジェクト: mnisl/OD
		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);
			}
		}
コード例 #35
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;
			}
		}
コード例 #36
0
ファイル: FormRepeatChargeEdit.cs プロジェクト: nampn/ODental
 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;
 }
コード例 #37
0
ファイル: FormRepeatChargeEdit.cs プロジェクト: mnisl/OD
		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;
			}
		}
コード例 #38
0
ファイル: FormOpenDental.cs プロジェクト: nampn/ODental
 //Lists
 private void menuItemProcCodes_Click(object sender, System.EventArgs e)
 {
     //security handled within form
     FormProcCodes FormP=new FormProcCodes();
     FormP.ShowDialog();
 }
コード例 #39
0
ファイル: FormApptProcs.cs プロジェクト: nampn/ODental
 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();
 }