private void butOK_Click(object sender, System.EventArgs e) { if (CultureInfo.CurrentCulture.Name == "en-US") { //if not match to D**** if (!Regex.IsMatch(textFrom.Text, @"^D\w{4}$") || !Regex.IsMatch(textTo.Text, @"^D\w{4}$")) { if (!MsgBox.Show(this, true, "One of the codes is not a standard ADA code. Use anyway?")) { return; } } } CovSpanCur.FromCode = textFrom.Text; CovSpanCur.ToCode = textTo.Text; try{ if (IsNew) { CovSpans.Insert(CovSpanCur); } else { CovSpans.Update(CovSpanCur); } } catch (ApplicationException ex) { MessageBox.Show(ex.Message); return; } DialogResult = DialogResult.OK; }
///<summary>Only use pri or sec, not tot. Used from ClaimProc.ComputeBaseEst. This is a low level function to get the percent to store in a claimproc. It does not consider any percentOverride. Always returns a number between 0 and 100. The supplied benefit list should be sorted frirst.</summary> public static int GetPercent(string myCode, InsPlan insPlan, PatPlan patPlan, Benefit[] benList) { if (insPlan.PlanType == "f" || insPlan.PlanType == "c") { return(100); //flat and cap are always covered 100% } CovSpan[] spansForCat; //loop through benefits starting at bottom (most specific) for (int i = benList.Length - 1; i >= 0; i--) { //if plan benefit, but no match if (benList[i].PlanNum != 0 && insPlan.PlanNum != benList[i].PlanNum) { continue; } //if patplan benefit, but no match if (benList[i].PatPlanNum != 0 && patPlan.PatPlanNum != benList[i].PatPlanNum) { continue; } if (benList[i].BenefitType != InsBenefitType.Percentage) { continue; } spansForCat = CovSpans.GetForCat(benList[i].CovCatNum); for (int j = 0; j < spansForCat.Length; j++) { if (String.Compare(myCode, spansForCat[j].FromCode) >= 0 && String.Compare(myCode, spansForCat[j].ToCode) <= 0) { return(benList[i].Percent); } } } return(0); }
private void butDelete_Click(object sender, EventArgs e) { if (IsNew) { DialogResult = DialogResult.Cancel; } else { CovSpans.Delete(CovSpanCur); DialogResult = DialogResult.OK; } }
///<summary>Pass in list of procedures and covCat, return the sum of all CanadaTimeUnits of the procedures in that covCat as a double.</summary> private double GetAmtUsedForCat(List <Procedure> listProcs, CovCat covCat) { List <ProcedureCode> listProcCodes = new List <ProcedureCode>(); for (int i = 0; i < listProcs.Count; i++) { listProcCodes.Add(ProcedureCodes.GetProcCode(listProcs[i].CodeNum)); //turn list of procedures into list of procedurecodes. } double total = 0; //CanadaTimeUnits can be decimal numbers, like 0.5. for (int i = 0; i < listProcCodes.Count; i++) //for every procedurecode //Can be null if the procedure doesn't fall within any spans (like note proc, the code is "clinical" so doesn't fall inside any spans) { CovCat benCat = CovCats.GetCovCat(CovSpans.GetCat(listProcCodes[i].ProcCode)); //if the covCat of that code is the same as the passed-in covCat if (benCat != null && benCat.EbenefitCat == covCat.EbenefitCat) { total += listProcCodes[i].CanadaTimeUnits; //add the Canada time units to the total. } } return(total); }
///<summary>Gets a deductible from the supplied list of benefits. Ignores benefits that do not match either the planNum or the patPlanNum. Because it starts at the bottom of the benefit list, it will get the most specific matching deductible first.</summary> public static double GetDeductibleByCode(Benefit[] benList, int planNum, int patPlanNum, string code) { CovSpan[] spansForCat; for (int i = benList.Length - 1; i >= 0; i--) { if (benList[i].PlanNum == 0 && benList[i].PatPlanNum != patPlanNum) { continue; } if (benList[i].PatPlanNum == 0 && benList[i].PlanNum != planNum) { continue; } if (benList[i].BenefitType != InsBenefitType.Deductible) { continue; } if (benList[i].QuantityQualifier != BenefitQuantity.None) { continue; } if (benList[i].TimePeriod != BenefitTimePeriod.CalendarYear && benList[i].TimePeriod != BenefitTimePeriod.ServiceYear) { continue; } spansForCat = CovSpans.GetForCat(benList[i].CovCatNum); for (int j = 0; j < spansForCat.Length; j++) { if (String.Compare(code, spansForCat[j].FromCode) >= 0 && String.Compare(code, spansForCat[j].ToCode) <= 0) { return(benList[i].MonetaryAmt); } } } return(0); }
private void FillSpans() { CovCats.RefreshCache(); CovSpans.RefreshCache(); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn("Category", 90); gridMain.Columns.Add(col); col = new ODGridColumn("From ADA", 70); gridMain.Columns.Add(col); col = new ODGridColumn("To ADA", 70); gridMain.Columns.Add(col); col = new ODGridColumn("Hidden", 45); gridMain.Columns.Add(col); col = new ODGridColumn("E-Benefit Category", 100); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; CovSpan[] spansForCat; for (int i = 0; i < CovCatC.Listt.Count; i++) { row = new ODGridRow(); row.Tag = CovCatC.Listt[i].Copy(); row.ColorBackG = Color.FromArgb(225, 225, 225); if (i != 0) { gridMain.Rows[gridMain.Rows.Count - 1].ColorLborder = Color.Black; } row.Cells.Add(CovCatC.Listt[i].Description); row.Cells.Add(""); row.Cells.Add(""); if (CovCatC.Listt[i].IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } if (CovCatC.Listt[i].EbenefitCat == EbenefitCategory.None) { row.Cells.Add(""); } else { row.Cells.Add(CovCatC.Listt[i].EbenefitCat.ToString()); } gridMain.Rows.Add(row); spansForCat = CovSpans.GetForCat(CovCatC.Listt[i].CovCatNum); for (int j = 0; j < spansForCat.Length; j++) { row = new ODGridRow(); row.Tag = spansForCat[j].Copy(); row.Cells.Add(""); row.Cells.Add(spansForCat[j].FromCode); row.Cells.Add(spansForCat[j].ToCode); row.Cells.Add(""); row.Cells.Add(""); gridMain.Rows.Add(row); } } gridMain.EndUpdate(); }