public void ShowCharting(DataSet ds) { this.ds = ds; chart1.Type = ChartType.Combo; //init Series ArrayList CollectIdList = this.getCollectIdList(); foreach (string CollectId in CollectIdList) { Series series = new Series(CollectId); series.Type = SeriesType.Line; foreach (DataRow row in ds.Tables[0].Rows) { if (CollectId == row["CollectId"].ToString()) { Element elem = new Element(); //elem.XDateTime = Convert.ToDateTime(row["DataTime"].ToString()); elem.YValue = Convert.ToDouble(row["DataValue"].ToString()); series.AddElements(elem); } } this.chart1.SeriesCollection.Add(series); } }
private void LoadChart() { SeriesCollection sc = new SeriesCollection(); Series mmrpro_colon_series = new Series("MMRPRO - Colon Cancer"); Series mmrpro_endo_series = new Series("MMRPRO - Endometrial Cancer"); Series CCRAT_series = new Series("CCRAT - Colon Cancer"); mmrpro_colon_series.LegendEntry.Value = ""; mmrpro_endo_series.LegendEntry.Value = ""; CCRAT_series.LegendEntry.Value = ""; int cap = 5; for (int i = 0; i < cap; i++) { Element mmrpro_colon = new Element(); mmrpro_colon.Name = GetElementName(i); if (i == cap) { mmrpro_colon.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Colon >= i).Count(); } else { mmrpro_colon.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Colon == i).Count(); } mmrpro_colon_series.AddElements(mmrpro_colon); Element mmrpro_endo = new Element(); mmrpro_endo.Name = GetElementName(i); if (i == cap) { mmrpro_endo.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Endo >= i).Count(); } else { mmrpro_endo.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Endo == i).Count(); } mmrpro_endo_series.AddElements(mmrpro_endo); Element ccrat_elem = new Element(); ccrat_elem.Name = GetElementName(i); if (i == cap) { ccrat_elem.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).CCRAT >= i).Count(); } else { ccrat_elem.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).CCRAT == i).Count(); } CCRAT_series.AddElements(ccrat_elem); } sc.Add(mmrpro_colon_series); sc.Add(mmrpro_endo_series); sc.Add(CCRAT_series); chart1.SeriesCollection.Add(sc); }
private void LoadChart() { SeriesCollection sc = new SeriesCollection(); Series ColoRectal = new Series("Lynch Syndrome Cancers"); ColoRectal.DefaultElement.Color = Color.LightBlue; Element coloRectal_elem = new Element(); coloRectal_elem.Name = "ColoRectal Cancer"; coloRectal_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).ColoRectalCount > 0 && ((LynchCancerFrequency.LynchCancerStat)mr).EndoUterineCount == 0).Count(); colorectal += (int)coloRectal_elem.YValue; ColoRectal.AddElements(coloRectal_elem); Element endoUterine_elem = new Element(); endoUterine_elem.Name = "Endometrial or Uterine Cancer"; endoUterine_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).EndoUterineCount > 0 && ((LynchCancerFrequency.LynchCancerStat)mr).ColoRectalCount == 0).Count(); endouterine += (int)endoUterine_elem.YValue; ColoRectal.AddElements(endoUterine_elem); Element both_elem = new Element(); both_elem.Name = "Both"; both_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).EndoUterineCount > 0 && ((LynchCancerFrequency.LynchCancerStat)mr).ColoRectalCount > 0).Count(); both += (int)both_elem.YValue; ColoRectal.AddElements(both_elem); Element hr_elem = new Element(); hr_elem.Name = "Early Age of Dx"; hr_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).EarlyDx > 0).Count(); hr += (int)both_elem.YValue; ColoRectal.AddElements(hr_elem); sc.Add(ColoRectal); chart1.SeriesCollection.Add(sc); }
public void ShowCharting2(DataSet ds) { this.ds = ds; chart1.Type = ChartType.Combo; //init Series Series series = new Series(); series.Type = SeriesType.Line; foreach (DataRow row in ds.Tables[0].Rows) { Element elem = new Element(); //elem.XValue = Convert.ToInt16(row["CollectId"].ToString()); elem.YValue = Convert.ToDouble(row["DataValue"].ToString()); series.AddElements(elem); } this.chart1.SeriesCollection.Add(series); }
public static ChartViewModel BuildBurndownChart(Iteration iteration, List<Assignable> tasks) { SeriesCollection sc; Series s; sc = new SeriesCollection(); s = new Series(); s.Name = "Effort"; s.Type = SeriesType.Bar; //s.DefaultElement.ShowValue = true; for (var day = iteration.StartDate.Date; day.Date <= iteration.EndDate.AddDays(1).Date; day = day.AddDays(1)) { var remainingTime = 0.0; //Do not show values for future dates. if (day <= DateTime.Today.AddDays(1)) { foreach (var task in tasks) { if (task.Times.Items.Count == 0) { remainingTime += task.Effort; } else { //NOTE: The Remain property on a Time object represents only the remaining time for that role (ie/ developer/qa) so we can't use it here. var timeSpent = task.Times.Items.Where(t => t.Date.Date < day).Sum(t => t.Spent); remainingTime += task.Effort - timeSpent; } } } s.AddElements(new Element(day.ToShortDateString(), remainingTime)); } sc.Add(s); var chart = InitializeBarGraph(sc, "Time Remaining"); return new ChartViewModel { ImageFileName = string.Format("{0:s}/{1:s}.png", chart.TempDirectory, chart.FileName) }; }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { SeriesCollection sc = new SeriesCollection(); foreach (object o in ethnicities) { if (o is EthnicityFrequency.EthnicityStat) { Series theSeries = new Series(); EthnicityFrequency.EthnicityStat stat = (EthnicityFrequency.EthnicityStat)o; Element elem = new Element(); theSeries.Name = stat.racialBackground; elem.Name = stat.racialBackground; elem.YValue = stat.frequency; total += stat.frequency; theSeries.AddElements(elem); sc.Add(theSeries); } } e.Result = sc; }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { SeriesCollection sc = new SeriesCollection(); foreach (object o in ethnicities) { if (o is EthnicityFrequency.EthnicityStat) { Series theSeries = new Series(); EthnicityFrequency.EthnicityStat stat = (EthnicityFrequency.EthnicityStat)o; Element elem = new Element(); theSeries.Name = stat.racialBackground; elem.Name = stat.racialBackground; elem.YValue = stat.frequency; total += stat.frequency; theSeries.AddElements(elem); sc.Add(theSeries); } } e.Result = sc; }
private void LoadChart() { all = breastRisk.Count(); non = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0).Count(); low = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 0 ).Count(); mid = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ( ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 1 ) && !( ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 2 ) ).Count(); high = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ( ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 2 ) ).Count(); passed = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ( ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1 ) ).Count(); SeriesCollection sc = new SeriesCollection(); Series brcapro = new Series("BRCAPRO"); Series claus = new Series("Claus"); Series TC6 = new Series("TC6"); Series TC7 = new Series("TC7"); brcapro.LegendEntry.Value = ""; claus.LegendEntry.Value = ""; TC6.LegendEntry.Value = ""; TC7.LegendEntry.Value = ""; Element brcapro_elem0 = new Element(); brcapro_elem0.Name = "0-14%"; brcapro_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 0).Count(); brcapro.AddElements(brcapro_elem0); Element brcapro_elem1 = new Element(); brcapro_elem1.Name = "15-19%"; brcapro_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 1).Count(); brcapro.AddElements(brcapro_elem1); Element brcapro_elem2 = new Element(); brcapro_elem2.Name = "20% or Greater"; brcapro_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 2).Count(); brcapro.AddElements(brcapro_elem2); Element claus_elem0 = new Element(); claus_elem0.Name = "0-14%"; claus_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 0).Count(); claus.AddElements(claus_elem0); Element claus_elem1 = new Element(); claus_elem1.Name = "15-19%"; claus_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 1).Count(); claus.AddElements(claus_elem1); Element claus_elem2 = new Element(); claus_elem2.Name = "20% or Greater"; claus_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 2).Count(); claus.AddElements(claus_elem2); Element TC6_elem0 = new Element(); TC6_elem0.Name = "0-14%"; TC6_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 0).Count(); TC6.AddElements(TC6_elem0); Element TC6_elem1 = new Element(); TC6_elem1.Name = "15-19%"; TC6_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 1).Count(); TC6.AddElements(TC6_elem1); Element TC6_elem2 = new Element(); TC6_elem2.Name = "20% or Greater"; TC6_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 2).Count(); TC6.AddElements(TC6_elem2); Element TC7_elem0 = new Element(); TC7_elem0.Name = "0-14%"; TC7_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 0).Count(); TC7.AddElements(TC7_elem0); Element TC7_elem1 = new Element(); TC7_elem1.Name = "15-19%"; TC7_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 1).Count(); TC7.AddElements(TC7_elem1); Element TC7_elem2 = new Element(); TC7_elem2.Name = "20% or Greater"; TC7_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 2).Count(); TC7.AddElements(TC7_elem2); sc.Add(brcapro); sc.Add(claus); sc.Add(TC6); sc.Add(TC7); chart1.SeriesCollection.Add(sc); double denominator = breastRisk.Count(); SeriesCollection passedCollection = new SeriesCollection(); Series brcapro_passed = new Series("BRCAPRO"); Series claus_passed = new Series("Claus"); Series TC6_passed = new Series("TC6"); Series TC7_passed = new Series("TC7"); Element brcapro_yes = new Element(); brcapro_yes.Color = Color.Red; brcapro_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1).Count(); brcaproCount = brcapro_yes.YValue; brcaproPercent = Math.Round(brcapro_yes.YValue / denominator * 100, 1).ToString() + "%"; brcapro_yes.Name = brcaproPercent; brcapro_passed.AddElements(brcapro_yes); Element brcapro_no = new Element(); brcapro_no.Color = Color.White; brcapro_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 0).Count(); brcapro_no.Name = Math.Round(brcapro_no.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passed.AddElements(brcapro_no); Element claus_yes = new Element(); claus_yes.Color = Color.Red; claus_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1).Count(); clausCount = claus_yes.YValue; clausPercent = Math.Round(claus_yes.YValue / denominator * 100, 1).ToString() + "%"; claus_yes.Name = clausPercent; claus_passed.AddElements(claus_yes); Element claus_no = new Element(); claus_no.Color = Color.White; claus_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 0).Count(); claus_no.Name = Math.Round(claus_no.YValue / denominator * 100, 1).ToString() + "%"; claus_passed.AddElements(claus_no); Element TC6_yes = new Element(); TC6_yes.Color = Color.Red; TC6_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1).Count(); tc6Count = TC6_yes.YValue; tc6Percent = Math.Round(TC6_yes.YValue / denominator * 100, 1).ToString() + "%"; TC6_yes.Name = tc6Percent; TC6_passed.AddElements(TC6_yes); Element TC6_no = new Element(); TC6_no.Color = Color.White; TC6_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 0).Count(); TC6_no.Name = Math.Round(TC6_no.YValue / denominator * 100, 1).ToString() + "%"; TC6_passed.AddElements(TC6_no); Element TC7_yes = new Element(); TC7_yes.Color = Color.Red; TC7_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1).Count(); tc7Count = TC7_yes.YValue; tc7Percent = Math.Round(TC7_yes.YValue / denominator * 100, 1).ToString() + "%"; TC7_yes.Name = tc7Percent; TC7_passed.AddElements(TC7_yes); Element TC7_no = new Element(); TC7_no.Color = Color.White; TC7_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 0).Count(); TC7_no.Name = Math.Round(TC7_no.YValue / denominator * 100, 1).ToString() + "%"; TC7_passed.AddElements(TC7_no); passedCollection.Add(brcapro_passed); passedCollection.Add(claus_passed); passedCollection.Add(TC6_passed); passedCollection.Add(TC7_passed); chart2.SeriesCollection.Add(passedCollection); denominator = passed; SeriesCollection passedbyModelCollection = new SeriesCollection(); Series brcapro_passedbyModel = new Series("BRCAPRO"); Series claus_passedbyModel = new Series("Claus"); Series TC6_passedbyModel = new Series("TC6"); Series TC7_passedbyModel = new Series("TC7"); Element brcapropassedby_yes = new Element(); brcapropassedby_yes.Color = Color.Red; brcapropassedby_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); brcapropassedby_yes.Name = Math.Round(brcapropassedby_yes.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passedbyModel.AddElements(brcapropassedby_yes); Element brcapropassedby_no = new Element(); brcapropassedby_no.Color = Color.White; brcapropassedby_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 0 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); brcapropassedby_no.Name = Math.Round(brcapropassedby_no.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passedbyModel.AddElements(brcapropassedby_no); Element clauspassedby_yes = new Element(); clauspassedby_yes.Color = Color.Red; clauspassedby_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); clauspassedby_yes.Name = Math.Round(clauspassedby_yes.YValue / denominator * 100, 1).ToString() + "%"; claus_passedbyModel.AddElements(clauspassedby_yes); Element clauspassedby_no = new Element(); clauspassedby_no.Color = Color.White; clauspassedby_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 0 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); clauspassedby_no.Name = Math.Round(clauspassedby_no.YValue / denominator * 100, 1).ToString() + "%"; claus_passedbyModel.AddElements(clauspassedby_no); Element TC6passedby_yes = new Element(); TC6passedby_yes.Color = Color.Red; TC6passedby_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); TC6passedby_yes.Name = Math.Round(TC6passedby_yes.YValue / denominator * 100, 1).ToString() + "%"; TC6_passedbyModel.AddElements(TC6passedby_yes); Element TC6passedby_no = new Element(); TC6passedby_no.Color = Color.White; TC6passedby_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 0 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); TC6passedby_no.Name = Math.Round(TC6passedby_no.YValue / denominator * 100, 1).ToString() + "%"; TC6_passedbyModel.AddElements(TC6passedby_no); Element TC7passedby_yes = new Element(); TC7passedby_yes.Color = Color.Red; TC7passedby_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); TC7passedby_yes.Name = Math.Round(TC7passedby_yes.YValue / denominator * 100, 1).ToString() + "%"; TC7_passedbyModel.AddElements(TC7passedby_yes); Element TC7passedby_no = new Element(); TC7passedby_no.Color = Color.White; TC7passedby_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 0 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); TC7passedby_no.Name = Math.Round(TC7passedby_no.YValue / denominator * 100, 1).ToString() + "%"; TC7_passedbyModel.AddElements(TC7passedby_no); passedbyModelCollection.Add(brcapro_passedbyModel); passedbyModelCollection.Add(claus_passedbyModel); passedbyModelCollection.Add(TC6_passedbyModel); passedbyModelCollection.Add(TC7_passedbyModel); chart3.SeriesCollection.Add(passedbyModelCollection); }
private void LoadChart() { SeriesCollection sc = new SeriesCollection(); Series cancerSeries = new Series("Breast Cancer"); cancerSeries.DefaultElement.Color = Color.LightBlue; Element unilateral_elem = new Element(); unilateral_elem.Name = "Unilateral Breast Cancer"; unilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 1 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 0).Count(); uni_bc = (int)unilateral_elem.YValue; total_bc += uni_bc; cancerSeries.AddElements(unilateral_elem); Element bilateral_elem = new Element(); bilateral_elem.Name = "Bilateral Breast Cancer"; bilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 2 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 0).Count(); bil_bc = (int)bilateral_elem.YValue; total_bc += bil_bc; cancerSeries.AddElements(bilateral_elem); Element ovarian_elem = new Element(); ovarian_elem.Name = "Ovarian Cancers"; ovarian_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 1 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 0).Count(); oc = (int)ovarian_elem.YValue; cancerSeries.AddElements(ovarian_elem); Element ovarian_unilateral_elem = new Element(); ovarian_unilateral_elem.Name = "Ovarian and Unilateral Breast Cancer"; ovarian_unilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 1 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 1).Count(); oc_uni = (int)ovarian_unilateral_elem.YValue; total_bc += oc_uni; cancerSeries.AddElements(ovarian_unilateral_elem); Element ovarian_bilateral_elem = new Element(); ovarian_bilateral_elem.Name = "Ovarian and Bilateral Breast Cancer"; ovarian_bilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 1 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 2).Count(); oc_bil = (int)ovarian_bilateral_elem.YValue; total_bc += oc_bil; cancerSeries.AddElements(ovarian_bilateral_elem); sc.Add(cancerSeries); chart1.SeriesCollection.Add(sc); SeriesCollection sc2 = new SeriesCollection(); Series passed_series = new Series(); passed_series.DefaultElement.Color = Color.Red; Element bc_passed = new Element(); bc_passed.Name = "High Risk by Age of Breast Cancer"; bc_passed.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcPassed == 1).Count(); hr_bc = (int)bc_passed.YValue; passed_series.Elements.Add(bc_passed); Element oc_passed = new Element(); oc_passed.Name = "High Risk by Ovarian Cancer Dx"; oc_passed.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcPassed == 1).Count(); hr_oc = (int)oc_passed.YValue; passed_series.Elements.Add(oc_passed); Element either_passed = new Element(); either_passed.Name = "High Risk by Breast Cancer Age or Ovarian Cancer Dx"; either_passed.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcPassed == 1 || ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcPassed == 1).Count(); hr_both = (int)either_passed.YValue; passed_series.Elements.Add(either_passed); sc2.Add(passed_series); chart2.SeriesCollection.Add(sc2); }
private void LoadChart() { all = mutationRisk.Count(); low = mutationRisk.Where(mr => ((MutationRiskFrequency.MutationRisk)mr).Myriad == 0 && ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 0 && ((MutationRiskFrequency.MutationRisk)mr).TC6 == 0 && ((MutationRiskFrequency.MutationRisk)mr).TC7 == 0 ).Count(); mid = mutationRisk.Where(mr => ( ((MutationRiskFrequency.MutationRisk)mr).Myriad == 1 || ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 1 || ((MutationRiskFrequency.MutationRisk)mr).TC6 == 1 || ((MutationRiskFrequency.MutationRisk)mr).TC7 == 1 ) && !( ((MutationRiskFrequency.MutationRisk)mr).Myriad == 2 || ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 2 || ((MutationRiskFrequency.MutationRisk)mr).TC6 == 2 || ((MutationRiskFrequency.MutationRisk)mr).TC7 == 2 ) ).Count(); high = mutationRisk.Where(mr => ( ((MutationRiskFrequency.MutationRisk)mr).Myriad == 2 || ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 2 || ((MutationRiskFrequency.MutationRisk)mr).TC6 == 2 || ((MutationRiskFrequency.MutationRisk)mr).TC7 == 2 ) ).Count(); passed = mutationRisk.Where(mr => ( ((MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1 ) ).Count(); SeriesCollection sc = new SeriesCollection(); Series brcapro = new Series("BRCAPRO"); Series myriad = new Series("Myriad"); Series TC6 = new Series("TC6"); Series TC7 = new Series("TC7"); brcapro.LegendEntry.Value = ""; myriad.LegendEntry.Value = ""; TC6.LegendEntry.Value = ""; TC7.LegendEntry.Value = ""; Element brcapro_elem0 = new Element(); brcapro_elem0.Name = "0-4%"; brcapro_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 0).Count(); brcapro.AddElements(brcapro_elem0); Element brcapro_elem1 = new Element(); brcapro_elem1.Name = "5-9%"; brcapro_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 1).Count(); brcapro.AddElements(brcapro_elem1); Element brcapro_elem2 = new Element(); brcapro_elem2.Name = "10% or Greater"; brcapro_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 2).Count(); brcapro.AddElements(brcapro_elem2); Element myriad_elem0 = new Element(); myriad_elem0.Name = "0-4%"; myriad_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad == 0).Count(); myriad.AddElements(myriad_elem0); Element myriad_elem1 = new Element(); myriad_elem1.Name = "5-9%"; myriad_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad == 1).Count(); myriad.AddElements(myriad_elem1); Element myriad_elem2 = new Element(); myriad_elem2.Name = "10% or Greater"; myriad_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad == 2).Count(); myriad.AddElements(myriad_elem2); Element TC6_elem0 = new Element(); TC6_elem0.Name = "0-4%"; TC6_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6 == 0).Count(); TC6.AddElements(TC6_elem0); Element TC6_elem1 = new Element(); TC6_elem1.Name = "5-9%"; TC6_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6 == 1).Count(); TC6.AddElements(TC6_elem1); Element TC6_elem2 = new Element(); TC6_elem2.Name = "10% or Greater"; TC6_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6 == 2).Count(); TC6.AddElements(TC6_elem2); Element TC7_elem0 = new Element(); TC7_elem0.Name = "0-4%"; TC7_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7 == 0).Count(); TC7.AddElements(TC7_elem0); Element TC7_elem1 = new Element(); TC7_elem1.Name = "5-9%"; TC7_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7 == 1).Count(); TC7.AddElements(TC7_elem1); Element TC7_elem2 = new Element(); TC7_elem2.Name = "10% or Greater"; TC7_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7 == 2).Count(); TC7.AddElements(TC7_elem2); sc.Add(brcapro); sc.Add(myriad); sc.Add(TC6); sc.Add(TC7); chart1.SeriesCollection.Add(sc); SeriesCollection passedCollection = new SeriesCollection(); Series brcapro_passed = new Series("BRCAPRO"); Series myriad_passed = new Series("Myriad"); Series TC6_passed = new Series("TC6"); Series TC7_passed = new Series("TC7"); Element brcapro_yes = new Element(); brcapro_yes.Color = Color.Red; brcapro_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1).Count(); brcaproCount = brcapro_yes.YValue; brcaproPercent = Math.Round(brcapro_yes.YValue / all * 100, 1).ToString() + "%"; brcapro_yes.Name = brcaproPercent; brcapro_passed.AddElements(brcapro_yes); Element brcapro_no = new Element(); brcapro_no.Color = Color.White; brcapro_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 0).Count(); brcapro_no.Name = Math.Round(brcapro_no.YValue / all * 100, 1).ToString() + "%"; brcapro_passed.AddElements(brcapro_no); Element myriad_yes = new Element(); myriad_yes.Color = Color.Red; myriad_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1).Count(); myriadCount = myriad_yes.YValue; myriadPercent = Math.Round(myriad_yes.YValue / all * 100, 1).ToString() + "%"; myriad_yes.Name = myriadPercent; myriad_passed.AddElements(myriad_yes); Element myriad_no = new Element(); myriad_no.Color = Color.White; myriad_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 0).Count(); myriad_no.Name = Math.Round(myriad_no.YValue / all * 100, 1).ToString() + "%"; myriad_passed.AddElements(myriad_no); Element TC6_yes = new Element(); TC6_yes.Color = Color.Red; TC6_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1).Count(); tc6Count = TC6_yes.YValue; tc6Percent = Math.Round(TC6_yes.YValue / all * 100, 1).ToString() + "%"; TC6_yes.Name = tc6Percent; TC6_passed.AddElements(TC6_yes); Element TC6_no = new Element(); TC6_no.Color = Color.White; TC6_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 0).Count(); TC6_no.Name = Math.Round(TC6_no.YValue / all * 100, 1).ToString() + "%"; TC6_passed.AddElements(TC6_no); Element TC7_yes = new Element(); TC7_yes.Color = Color.Red; TC7_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1).Count(); tc7Count = TC7_yes.YValue; tc7Percent = Math.Round(TC7_yes.YValue / all * 100, 1).ToString() + "%"; TC7_yes.Name = tc7Percent; TC7_passed.AddElements(TC7_yes); Element TC7_no = new Element(); TC7_no.Color = Color.White; TC7_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 0).Count(); TC7_no.Name = Math.Round(TC7_no.YValue / all * 100, 1).ToString() + "%"; TC7_passed.AddElements(TC7_no); passedCollection.Add(brcapro_passed); passedCollection.Add(myriad_passed); passedCollection.Add(TC6_passed); passedCollection.Add(TC7_passed); chart2.SeriesCollection.Add(passedCollection); double denominator = passed; SeriesCollection passedbyModelCollection = new SeriesCollection(); Series brcapro_passedbyModel = new Series("BRCAPRO"); Series myriad_passedbyModel = new Series("Myriad"); Series TC6_passedbyModel = new Series("TC6"); Series TC7_passedbyModel = new Series("TC7"); Element brcapropassedby_yes = new Element(); //brcapropassedby_yes.Name = "At or Above Threshold"; brcapropassedby_yes.Color = Color.Red; brcapropassedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); brcapropassedby_yes.Name = Math.Round(brcapropassedby_yes.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passedbyModel.AddElements(brcapropassedby_yes); Element brcapropassedby_no = new Element(); //brcapropassedby_no.Name = "Below Threshold"; brcapropassedby_no.Color = Color.White; brcapropassedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 0 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); brcapropassedby_no.Name = Math.Round(brcapropassedby_no.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passedbyModel.AddElements(brcapropassedby_no); Element myriadpassedby_yes = new Element(); //myriadpassedby_yes.Name = "At or Above Threshold"; myriadpassedby_yes.Color = Color.Red; myriadpassedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); myriadpassedby_yes.Name = Math.Round(myriadpassedby_yes.YValue / denominator * 100, 1).ToString() + "%"; myriad_passedbyModel.AddElements(myriadpassedby_yes); Element myriadpassedby_no = new Element(); //myriadpassedby_no.Name = "Below Threshold"; myriadpassedby_no.Color = Color.White; myriadpassedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 0 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); myriadpassedby_no.Name = Math.Round(myriadpassedby_no.YValue / denominator * 100, 1).ToString() + "%"; myriad_passedbyModel.AddElements(myriadpassedby_no); Element TC6passedby_yes = new Element(); //TC6passedby_yes.Name = "At or Above Threshold"; TC6passedby_yes.Color = Color.Red; TC6passedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); TC6passedby_yes.Name = Math.Round(TC6passedby_yes.YValue / denominator * 100, 1).ToString() + "%"; TC6_passedbyModel.AddElements(TC6passedby_yes); Element TC6passedby_no = new Element(); //TC6passedby_no.Name = "Below Threshold"; TC6passedby_no.Color = Color.White; TC6passedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 0 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); TC6passedby_no.Name = Math.Round(TC6passedby_no.YValue / denominator * 100, 1).ToString() + "%"; TC6_passedbyModel.AddElements(TC6passedby_no); Element TC7passedby_yes = new Element(); //TC7passedby_yes.Name = "At or Above Threshold"; TC7passedby_yes.Color = Color.Red; TC7passedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); TC7passedby_yes.Name = Math.Round(TC7passedby_yes.YValue / denominator * 100, 1).ToString() + "%"; TC7_passedbyModel.AddElements(TC7passedby_yes); Element TC7passedby_no = new Element(); //TC7passedby_no.Name = "Below Threshold"; TC7passedby_no.Color = Color.White; TC7passedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 0 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); TC7passedby_no.Name = Math.Round(TC7passedby_no.YValue / denominator * 100, 1).ToString() + "%"; TC7_passedbyModel.AddElements(TC7passedby_no); passedbyModelCollection.Add(brcapro_passedbyModel); passedbyModelCollection.Add(myriad_passedbyModel); passedbyModelCollection.Add(TC6_passedbyModel); passedbyModelCollection.Add(TC7_passedbyModel); chart3.SeriesCollection.Add(passedbyModelCollection); }
private void LoadChart() { SeriesCollection sc = new SeriesCollection(); Series cancerSeries = new Series("Breast Cancer"); cancerSeries.DefaultElement.Color = Color.LightBlue; Element unilateral_elem = new Element(); unilateral_elem.Name = "Unilateral Breast Cancer"; unilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 1 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 0).Count(); uni_bc = (int)unilateral_elem.YValue; total_bc += uni_bc; cancerSeries.AddElements(unilateral_elem); Element bilateral_elem = new Element(); bilateral_elem.Name = "Bilateral Breast Cancer"; bilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 2 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 0).Count(); bil_bc = (int)bilateral_elem.YValue; total_bc += bil_bc; cancerSeries.AddElements(bilateral_elem); Element ovarian_elem = new Element(); ovarian_elem.Name = "Ovarian Cancers"; ovarian_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 1 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 0).Count(); oc = (int)ovarian_elem.YValue; cancerSeries.AddElements(ovarian_elem); Element ovarian_unilateral_elem = new Element(); ovarian_unilateral_elem.Name = "Ovarian and Unilateral Breast Cancer"; ovarian_unilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 1 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 1).Count(); oc_uni = (int)ovarian_unilateral_elem.YValue; total_bc += oc_uni; cancerSeries.AddElements(ovarian_unilateral_elem); Element ovarian_bilateral_elem = new Element(); ovarian_bilateral_elem.Name = "Ovarian and Bilateral Breast Cancer"; ovarian_bilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 1 && ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 2).Count(); oc_bil = (int)ovarian_bilateral_elem.YValue; total_bc += oc_bil; cancerSeries.AddElements(ovarian_bilateral_elem); sc.Add(cancerSeries); chart1.SeriesCollection.Add(sc); SeriesCollection sc2 = new SeriesCollection(); Series passed_series = new Series(); passed_series.DefaultElement.Color = Color.Red; Element bc_passed = new Element(); bc_passed.Name = "High Risk by Age of Breast Cancer"; bc_passed.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcPassed == 1).Count(); hr_bc = (int)bc_passed.YValue; passed_series.Elements.Add(bc_passed); Element oc_passed = new Element(); oc_passed.Name = "High Risk by Ovarian Cancer Dx"; oc_passed.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcPassed == 1).Count(); hr_oc = (int)oc_passed.YValue; passed_series.Elements.Add(oc_passed); Element either_passed = new Element(); either_passed.Name = "High Risk by Breast Cancer Age or Ovarian Cancer Dx"; either_passed.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcPassed == 1 || ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcPassed == 1).Count(); hr_both = (int)either_passed.YValue; passed_series.Elements.Add(either_passed); sc2.Add(passed_series); chart2.SeriesCollection.Add(sc2); }
private void LoadChart() { all = mutationRisk.Count(); low = mutationRisk.Where(mr => ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro== 0 && ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 0 ).Count(); mid = mutationRisk.Where(mr => ( ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 1 || ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 1 ) && !( ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 2 || ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 2 ) ).Count(); high = mutationRisk.Where(mr => ( ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 2 || ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 2 ) ).Count(); passed = mutationRisk.Where(mr => ( ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1 || ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 ) ).Count(); SeriesCollection sc = new SeriesCollection(); Series mmrpro = new Series("MMRPro"); Series premm = new Series("PREMM"); mmrpro.LegendEntry.Value = ""; premm.LegendEntry.Value = ""; Element mmrpro_elem0 = new Element(); mmrpro_elem0.Name = "0-4%"; mmrpro_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 0).Count(); mmrpro.AddElements(mmrpro_elem0); Element mmrpro_elem1 = new Element(); mmrpro_elem1.Name = "5-9%"; mmrpro_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 1).Count(); mmrpro.AddElements(mmrpro_elem1); Element mmrpro_elem2 = new Element(); mmrpro_elem2.Name = "10% or Greater"; mmrpro_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 2).Count(); mmrpro.AddElements(mmrpro_elem2); Element premm__elem0 = new Element(); premm__elem0.Name = "0-4%"; premm__elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 0).Count(); premm.AddElements(premm__elem0); Element premm__elem1 = new Element(); premm__elem1.Name = "5-9%"; premm__elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 1).Count(); premm.AddElements(premm__elem1); Element premm__elem2 = new Element(); premm__elem2.Name = "10% or Greater"; premm__elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 2).Count(); premm.AddElements(premm__elem2); sc.Add(mmrpro); sc.Add(premm); chart1.SeriesCollection.Add(sc); SeriesCollection passedCollection = new SeriesCollection(); Series mmrpro_passed = new Series("MMRPro"); Series premm__passed = new Series("PREMM"); Element mmrpro_yes = new Element(); mmrpro_yes.Name = "At or Above Threshold"; mmrpro_yes.Color = Color.Red; mmrpro_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1).Count(); mmrpro_passed.AddElements(mmrpro_yes); Element mmrpro_no = new Element(); mmrpro_no.Name = "Below Threshold"; mmrpro_no.Color = Color.White; mmrpro_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 0).Count(); mmrpro_passed.AddElements(mmrpro_no); Element premm__yes = new Element(); premm__yes.Name = "At or Above Threshold"; premm__yes.Color = Color.Red; premm__yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1).Count(); premm__passed.AddElements(premm__yes); Element premm__no = new Element(); premm__no.Name = "Below Threshold"; premm__no.Color = Color.White; premm__no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 0).Count(); premm__passed.AddElements(premm__no); passedCollection.Add(mmrpro_passed); passedCollection.Add(premm__passed); chart2.SeriesCollection.Add(passedCollection); SeriesCollection passedbyModelCollection = new SeriesCollection(); Series mmrpro_passedbyModel = new Series("MMRPro"); Series premm__passedbyModel = new Series("PREMM"); Element brcapropassedby_yes = new Element(); brcapropassedby_yes.Name = "At or Above Threshold"; brcapropassedby_yes.Color = Color.Red; brcapropassedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1 && (((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 || ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1)).Count(); mmrpro_passedbyModel.AddElements(brcapropassedby_yes); Element brcapropassedby_no = new Element(); brcapropassedby_no.Name = "Below Threshold"; brcapropassedby_no.Color = Color.White; brcapropassedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 0 && (((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 || ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1)).Count(); mmrpro_passedbyModel.AddElements(brcapropassedby_no); Element myriadpassedby_yes = new Element(); myriadpassedby_yes.Name = "At or Above Threshold"; myriadpassedby_yes.Color = Color.Red; myriadpassedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 && (((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 || ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1)).Count(); premm__passedbyModel.AddElements(myriadpassedby_yes); Element myriadpassedby_no = new Element(); myriadpassedby_no.Name = "Below Threshold"; myriadpassedby_no.Color = Color.White; myriadpassedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 0 && (((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 || ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1)).Count(); premm__passedbyModel.AddElements(myriadpassedby_no); passedbyModelCollection.Add(mmrpro_passedbyModel); passedbyModelCollection.Add(premm__passedbyModel); chart3.SeriesCollection.Add(passedbyModelCollection); }
private void LoadChart() { SeriesCollection sc = new SeriesCollection(); Series ColoRectal = new Series("Lynch Syndrome Cancers"); ColoRectal.DefaultElement.Color = Color.LightBlue; Element coloRectal_elem = new Element(); coloRectal_elem.Name = "ColoRectal Cancer"; coloRectal_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).ColoRectalCount > 0 && ((LynchCancerFrequency.LynchCancerStat)mr).EndoUterineCount == 0).Count(); colorectal += (int)coloRectal_elem.YValue; ColoRectal.AddElements(coloRectal_elem); Element endoUterine_elem = new Element(); endoUterine_elem.Name = "Endometrial or Uterine Cancer"; endoUterine_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).EndoUterineCount > 0 && ((LynchCancerFrequency.LynchCancerStat)mr).ColoRectalCount == 0).Count(); endouterine += (int)endoUterine_elem.YValue; ColoRectal.AddElements(endoUterine_elem); Element both_elem = new Element(); both_elem.Name = "Both"; both_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).EndoUterineCount > 0 && ((LynchCancerFrequency.LynchCancerStat)mr).ColoRectalCount > 0).Count(); both += (int)both_elem.YValue; ColoRectal.AddElements(both_elem); Element hr_elem = new Element(); hr_elem.Name = "Early Age of Dx"; hr_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).EarlyDx > 0).Count(); hr += (int)both_elem.YValue; ColoRectal.AddElements(hr_elem); sc.Add(ColoRectal); chart1.SeriesCollection.Add(sc); }
private void LoadChart() { all = mutationRisk.Count(); low = mutationRisk.Where(mr => ((MutationRiskFrequency.MutationRisk)mr).Myriad == 0 && ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 0 && ((MutationRiskFrequency.MutationRisk)mr).TC6 == 0 && ((MutationRiskFrequency.MutationRisk)mr).TC7 == 0 ).Count(); mid = mutationRisk.Where(mr => ( ((MutationRiskFrequency.MutationRisk)mr).Myriad == 1 || ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 1 || ((MutationRiskFrequency.MutationRisk)mr).TC6 == 1 || ((MutationRiskFrequency.MutationRisk)mr).TC7 == 1 ) && !( ((MutationRiskFrequency.MutationRisk)mr).Myriad == 2 || ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 2 || ((MutationRiskFrequency.MutationRisk)mr).TC6 == 2 || ((MutationRiskFrequency.MutationRisk)mr).TC7 == 2 ) ).Count(); high = mutationRisk.Where(mr => ( ((MutationRiskFrequency.MutationRisk)mr).Myriad == 2 || ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 2 || ((MutationRiskFrequency.MutationRisk)mr).TC6 == 2 || ((MutationRiskFrequency.MutationRisk)mr).TC7 == 2 ) ).Count(); passed = mutationRisk.Where(mr => ( ((MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1 ) ).Count(); SeriesCollection sc = new SeriesCollection(); Series brcapro = new Series("BRCAPRO"); Series myriad = new Series("Myriad"); Series TC6 = new Series("TC6"); Series TC7 = new Series("TC7"); brcapro.LegendEntry.Value = ""; myriad.LegendEntry.Value = ""; TC6.LegendEntry.Value = ""; TC7.LegendEntry.Value = ""; Element brcapro_elem0 = new Element(); brcapro_elem0.Name = "0-4%"; brcapro_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 0).Count(); brcapro.AddElements(brcapro_elem0); Element brcapro_elem1 = new Element(); brcapro_elem1.Name = "5-9%"; brcapro_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 1).Count(); brcapro.AddElements(brcapro_elem1); Element brcapro_elem2 = new Element(); brcapro_elem2.Name = "10% or Greater"; brcapro_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 2).Count(); brcapro.AddElements(brcapro_elem2); Element myriad_elem0 = new Element(); myriad_elem0.Name = "0-4%"; myriad_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad == 0).Count(); myriad.AddElements(myriad_elem0); Element myriad_elem1 = new Element(); myriad_elem1.Name = "5-9%"; myriad_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad == 1).Count(); myriad.AddElements(myriad_elem1); Element myriad_elem2 = new Element(); myriad_elem2.Name = "10% or Greater"; myriad_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad == 2).Count(); myriad.AddElements(myriad_elem2); Element TC6_elem0 = new Element(); TC6_elem0.Name = "0-4%"; TC6_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6 == 0).Count(); TC6.AddElements(TC6_elem0); Element TC6_elem1 = new Element(); TC6_elem1.Name = "5-9%"; TC6_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6 == 1).Count(); TC6.AddElements(TC6_elem1); Element TC6_elem2 = new Element(); TC6_elem2.Name = "10% or Greater"; TC6_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6 == 2).Count(); TC6.AddElements(TC6_elem2); Element TC7_elem0 = new Element(); TC7_elem0.Name = "0-4%"; TC7_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7 == 0).Count(); TC7.AddElements(TC7_elem0); Element TC7_elem1 = new Element(); TC7_elem1.Name = "5-9%"; TC7_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7 == 1).Count(); TC7.AddElements(TC7_elem1); Element TC7_elem2 = new Element(); TC7_elem2.Name = "10% or Greater"; TC7_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7 == 2).Count(); TC7.AddElements(TC7_elem2); sc.Add(brcapro); sc.Add(myriad); sc.Add(TC6); sc.Add(TC7); chart1.SeriesCollection.Add(sc); SeriesCollection passedCollection = new SeriesCollection(); Series brcapro_passed = new Series("BRCAPRO"); Series myriad_passed = new Series("Myriad"); Series TC6_passed = new Series("TC6"); Series TC7_passed = new Series("TC7"); Element brcapro_yes = new Element(); brcapro_yes.Color = Color.Red; brcapro_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1).Count(); brcaproCount = brcapro_yes.YValue; brcaproPercent = Math.Round(brcapro_yes.YValue / all * 100, 1).ToString() + "%"; brcapro_yes.Name = brcaproPercent; brcapro_passed.AddElements(brcapro_yes); Element brcapro_no = new Element(); brcapro_no.Color = Color.White; brcapro_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 0).Count(); brcapro_no.Name = Math.Round(brcapro_no.YValue / all * 100, 1).ToString() + "%"; brcapro_passed.AddElements(brcapro_no); Element myriad_yes = new Element(); myriad_yes.Color = Color.Red; myriad_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1).Count(); myriadCount = myriad_yes.YValue; myriadPercent = Math.Round(myriad_yes.YValue / all * 100, 1).ToString() + "%"; myriad_yes.Name = myriadPercent; myriad_passed.AddElements(myriad_yes); Element myriad_no = new Element(); myriad_no.Color = Color.White; myriad_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 0).Count(); myriad_no.Name = Math.Round(myriad_no.YValue / all * 100, 1).ToString() + "%"; myriad_passed.AddElements(myriad_no); Element TC6_yes = new Element(); TC6_yes.Color = Color.Red; TC6_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1).Count(); tc6Count = TC6_yes.YValue; tc6Percent = Math.Round(TC6_yes.YValue / all * 100, 1).ToString() + "%"; TC6_yes.Name = tc6Percent; TC6_passed.AddElements(TC6_yes); Element TC6_no = new Element(); TC6_no.Color = Color.White; TC6_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 0).Count(); TC6_no.Name = Math.Round(TC6_no.YValue / all * 100, 1).ToString() + "%"; TC6_passed.AddElements(TC6_no); Element TC7_yes = new Element(); TC7_yes.Color = Color.Red; TC7_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1).Count(); tc7Count = TC7_yes.YValue; tc7Percent = Math.Round(TC7_yes.YValue / all * 100, 1).ToString() + "%"; TC7_yes.Name = tc7Percent; TC7_passed.AddElements(TC7_yes); Element TC7_no = new Element(); TC7_no.Color = Color.White; TC7_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 0).Count(); TC7_no.Name = Math.Round(TC7_no.YValue / all * 100, 1).ToString() + "%"; TC7_passed.AddElements(TC7_no); passedCollection.Add(brcapro_passed); passedCollection.Add(myriad_passed); passedCollection.Add(TC6_passed); passedCollection.Add(TC7_passed); chart2.SeriesCollection.Add(passedCollection); double denominator = passed; SeriesCollection passedbyModelCollection = new SeriesCollection(); Series brcapro_passedbyModel = new Series("BRCAPRO"); Series myriad_passedbyModel = new Series("Myriad"); Series TC6_passedbyModel = new Series("TC6"); Series TC7_passedbyModel = new Series("TC7"); Element brcapropassedby_yes = new Element(); //brcapropassedby_yes.Name = "At or Above Threshold"; brcapropassedby_yes.Color = Color.Red; brcapropassedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); brcapropassedby_yes.Name = Math.Round(brcapropassedby_yes.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passedbyModel.AddElements(brcapropassedby_yes); Element brcapropassedby_no = new Element(); //brcapropassedby_no.Name = "Below Threshold"; brcapropassedby_no.Color = Color.White; brcapropassedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 0 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); brcapropassedby_no.Name = Math.Round(brcapropassedby_no.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passedbyModel.AddElements(brcapropassedby_no); Element myriadpassedby_yes = new Element(); //myriadpassedby_yes.Name = "At or Above Threshold"; myriadpassedby_yes.Color = Color.Red; myriadpassedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); myriadpassedby_yes.Name = Math.Round(myriadpassedby_yes.YValue / denominator * 100, 1).ToString() + "%"; myriad_passedbyModel.AddElements(myriadpassedby_yes); Element myriadpassedby_no = new Element(); //myriadpassedby_no.Name = "Below Threshold"; myriadpassedby_no.Color = Color.White; myriadpassedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 0 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); myriadpassedby_no.Name = Math.Round(myriadpassedby_no.YValue / denominator * 100, 1).ToString() + "%"; myriad_passedbyModel.AddElements(myriadpassedby_no); Element TC6passedby_yes = new Element(); //TC6passedby_yes.Name = "At or Above Threshold"; TC6passedby_yes.Color = Color.Red; TC6passedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); TC6passedby_yes.Name = Math.Round(TC6passedby_yes.YValue / denominator * 100, 1).ToString() + "%"; TC6_passedbyModel.AddElements(TC6passedby_yes); Element TC6passedby_no = new Element(); //TC6passedby_no.Name = "Below Threshold"; TC6passedby_no.Color = Color.White; TC6passedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 0 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); TC6passedby_no.Name = Math.Round(TC6passedby_no.YValue / denominator * 100, 1).ToString() + "%"; TC6_passedbyModel.AddElements(TC6passedby_no); Element TC7passedby_yes = new Element(); //TC7passedby_yes.Name = "At or Above Threshold"; TC7passedby_yes.Color = Color.Red; TC7passedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); TC7passedby_yes.Name = Math.Round(TC7passedby_yes.YValue / denominator * 100, 1).ToString() + "%"; TC7_passedbyModel.AddElements(TC7passedby_yes); Element TC7passedby_no = new Element(); //TC7passedby_no.Name = "Below Threshold"; TC7passedby_no.Color = Color.White; TC7passedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 0 && (((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 || ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1)).Count(); TC7passedby_no.Name = Math.Round(TC7passedby_no.YValue / denominator * 100, 1).ToString() + "%"; TC7_passedbyModel.AddElements(TC7passedby_no); passedbyModelCollection.Add(brcapro_passedbyModel); passedbyModelCollection.Add(myriad_passedbyModel); passedbyModelCollection.Add(TC6_passedbyModel); passedbyModelCollection.Add(TC7_passedbyModel); chart3.SeriesCollection.Add(passedbyModelCollection); }
private void LoadChart() { all = breastRisk.Count(); non = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0).Count(); low = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 0 ).Count(); mid = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ( ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 1 ) && !( ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 2 ) ).Count(); high = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ( ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 2 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 2 ) ).Count(); passed = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ( ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1 ) ).Count(); SeriesCollection sc = new SeriesCollection(); Series brcapro = new Series("BRCAPRO"); Series claus = new Series("Claus"); Series TC6 = new Series("TC6"); Series TC7 = new Series("TC7"); brcapro.LegendEntry.Value = ""; claus.LegendEntry.Value = ""; TC6.LegendEntry.Value = ""; TC7.LegendEntry.Value = ""; Element brcapro_elem0 = new Element(); brcapro_elem0.Name = "0-14%"; brcapro_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 0).Count(); brcapro.AddElements(brcapro_elem0); Element brcapro_elem1 = new Element(); brcapro_elem1.Name = "15-19%"; brcapro_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 1).Count(); brcapro.AddElements(brcapro_elem1); Element brcapro_elem2 = new Element(); brcapro_elem2.Name = "20% or Greater"; brcapro_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 2).Count(); brcapro.AddElements(brcapro_elem2); Element claus_elem0 = new Element(); claus_elem0.Name = "0-14%"; claus_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 0).Count(); claus.AddElements(claus_elem0); Element claus_elem1 = new Element(); claus_elem1.Name = "15-19%"; claus_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 1).Count(); claus.AddElements(claus_elem1); Element claus_elem2 = new Element(); claus_elem2.Name = "20% or Greater"; claus_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 2).Count(); claus.AddElements(claus_elem2); Element TC6_elem0 = new Element(); TC6_elem0.Name = "0-14%"; TC6_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 0).Count(); TC6.AddElements(TC6_elem0); Element TC6_elem1 = new Element(); TC6_elem1.Name = "15-19%"; TC6_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 1).Count(); TC6.AddElements(TC6_elem1); Element TC6_elem2 = new Element(); TC6_elem2.Name = "20% or Greater"; TC6_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 2).Count(); TC6.AddElements(TC6_elem2); Element TC7_elem0 = new Element(); TC7_elem0.Name = "0-14%"; TC7_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 0).Count(); TC7.AddElements(TC7_elem0); Element TC7_elem1 = new Element(); TC7_elem1.Name = "15-19%"; TC7_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 1).Count(); TC7.AddElements(TC7_elem1); Element TC7_elem2 = new Element(); TC7_elem2.Name = "20% or Greater"; TC7_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 2).Count(); TC7.AddElements(TC7_elem2); sc.Add(brcapro); sc.Add(claus); sc.Add(TC6); sc.Add(TC7); chart1.SeriesCollection.Add(sc); double denominator = breastRisk.Count(); SeriesCollection passedCollection = new SeriesCollection(); Series brcapro_passed = new Series("BRCAPRO"); Series claus_passed = new Series("Claus"); Series TC6_passed = new Series("TC6"); Series TC7_passed = new Series("TC7"); Element brcapro_yes = new Element(); brcapro_yes.Color = Color.Red; brcapro_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1).Count(); brcaproCount = brcapro_yes.YValue; brcaproPercent = Math.Round(brcapro_yes.YValue / denominator * 100, 1).ToString() + "%"; brcapro_yes.Name = brcaproPercent; brcapro_passed.AddElements(brcapro_yes); Element brcapro_no = new Element(); brcapro_no.Color = Color.White; brcapro_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 0).Count(); brcapro_no.Name = Math.Round(brcapro_no.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passed.AddElements(brcapro_no); Element claus_yes = new Element(); claus_yes.Color = Color.Red; claus_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1).Count(); clausCount = claus_yes.YValue; clausPercent = Math.Round(claus_yes.YValue / denominator * 100, 1).ToString() + "%"; claus_yes.Name = clausPercent; claus_passed.AddElements(claus_yes); Element claus_no = new Element(); claus_no.Color = Color.White; claus_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 0).Count(); claus_no.Name = Math.Round(claus_no.YValue / denominator * 100, 1).ToString() + "%"; claus_passed.AddElements(claus_no); Element TC6_yes = new Element(); TC6_yes.Color = Color.Red; TC6_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1).Count(); tc6Count = TC6_yes.YValue; tc6Percent = Math.Round(TC6_yes.YValue / denominator * 100, 1).ToString() + "%"; TC6_yes.Name = tc6Percent; TC6_passed.AddElements(TC6_yes); Element TC6_no = new Element(); TC6_no.Color = Color.White; TC6_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 0).Count(); TC6_no.Name = Math.Round(TC6_no.YValue / denominator * 100, 1).ToString() + "%"; TC6_passed.AddElements(TC6_no); Element TC7_yes = new Element(); TC7_yes.Color = Color.Red; TC7_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1).Count(); tc7Count = TC7_yes.YValue; tc7Percent = Math.Round(TC7_yes.YValue / denominator * 100, 1).ToString() + "%"; TC7_yes.Name = tc7Percent; TC7_passed.AddElements(TC7_yes); Element TC7_no = new Element(); TC7_no.Color = Color.White; TC7_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 0).Count(); TC7_no.Name = Math.Round(TC7_no.YValue / denominator * 100, 1).ToString() + "%"; TC7_passed.AddElements(TC7_no); passedCollection.Add(brcapro_passed); passedCollection.Add(claus_passed); passedCollection.Add(TC6_passed); passedCollection.Add(TC7_passed); chart2.SeriesCollection.Add(passedCollection); denominator = passed; SeriesCollection passedbyModelCollection = new SeriesCollection(); Series brcapro_passedbyModel = new Series("BRCAPRO"); Series claus_passedbyModel = new Series("Claus"); Series TC6_passedbyModel = new Series("TC6"); Series TC7_passedbyModel = new Series("TC7"); Element brcapropassedby_yes = new Element(); brcapropassedby_yes.Color = Color.Red; brcapropassedby_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); brcapropassedby_yes.Name = Math.Round(brcapropassedby_yes.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passedbyModel.AddElements(brcapropassedby_yes); Element brcapropassedby_no = new Element(); brcapropassedby_no.Color = Color.White; brcapropassedby_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 0 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); brcapropassedby_no.Name = Math.Round(brcapropassedby_no.YValue / denominator * 100, 1).ToString() + "%"; brcapro_passedbyModel.AddElements(brcapropassedby_no); Element clauspassedby_yes = new Element(); clauspassedby_yes.Color = Color.Red; clauspassedby_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); clauspassedby_yes.Name = Math.Round(clauspassedby_yes.YValue / denominator * 100, 1).ToString() + "%"; claus_passedbyModel.AddElements(clauspassedby_yes); Element clauspassedby_no = new Element(); clauspassedby_no.Color = Color.White; clauspassedby_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 0 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); clauspassedby_no.Name = Math.Round(clauspassedby_no.YValue / denominator * 100, 1).ToString() + "%"; claus_passedbyModel.AddElements(clauspassedby_no); Element TC6passedby_yes = new Element(); TC6passedby_yes.Color = Color.Red; TC6passedby_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); TC6passedby_yes.Name = Math.Round(TC6passedby_yes.YValue / denominator * 100, 1).ToString() + "%"; TC6_passedbyModel.AddElements(TC6passedby_yes); Element TC6passedby_no = new Element(); TC6passedby_no.Color = Color.White; TC6passedby_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 0 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); TC6passedby_no.Name = Math.Round(TC6passedby_no.YValue / denominator * 100, 1).ToString() + "%"; TC6_passedbyModel.AddElements(TC6passedby_no); Element TC7passedby_yes = new Element(); TC7passedby_yes.Color = Color.Red; TC7passedby_yes.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); TC7passedby_yes.Name = Math.Round(TC7passedby_yes.YValue / denominator * 100, 1).ToString() + "%"; TC7_passedbyModel.AddElements(TC7passedby_yes); Element TC7passedby_no = new Element(); TC7passedby_no.Color = Color.White; TC7passedby_no.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 && ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 0 && (((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 || ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1)).Count(); TC7passedby_no.Name = Math.Round(TC7passedby_no.YValue / denominator * 100, 1).ToString() + "%"; TC7_passedbyModel.AddElements(TC7passedby_no); passedbyModelCollection.Add(brcapro_passedbyModel); passedbyModelCollection.Add(claus_passedbyModel); passedbyModelCollection.Add(TC6_passedbyModel); passedbyModelCollection.Add(TC7_passedbyModel); chart3.SeriesCollection.Add(passedbyModelCollection); }
private void LoadChart() { SeriesCollection sc = new SeriesCollection(); Series mmrpro_colon_series = new Series("MMRPRO - Colon Cancer"); Series mmrpro_endo_series = new Series("MMRPRO - Endometrial Cancer"); Series CCRAT_series = new Series("CCRAT - Colon Cancer"); mmrpro_colon_series.LegendEntry.Value = ""; mmrpro_endo_series.LegendEntry.Value = ""; CCRAT_series.LegendEntry.Value = ""; int cap = 5; for (int i = 0; i < cap; i++) { Element mmrpro_colon = new Element(); mmrpro_colon.Name = GetElementName(i); if (i == cap) { mmrpro_colon.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Colon >= i).Count(); } else { mmrpro_colon.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Colon == i).Count(); } mmrpro_colon_series.AddElements(mmrpro_colon); Element mmrpro_endo = new Element(); mmrpro_endo.Name = GetElementName(i); if (i == cap) { mmrpro_endo.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Endo >= i).Count(); } else { mmrpro_endo.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Endo == i).Count(); } mmrpro_endo_series.AddElements(mmrpro_endo); Element ccrat_elem = new Element(); ccrat_elem.Name = GetElementName(i); if (i == cap) { ccrat_elem.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).CCRAT >= i).Count(); } else { ccrat_elem.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).CCRAT == i).Count(); } CCRAT_series.AddElements(ccrat_elem); } sc.Add(mmrpro_colon_series); sc.Add(mmrpro_endo_series); sc.Add(CCRAT_series); chart1.SeriesCollection.Add(sc); }
SeriesCollection GetResponseData (OrganizationMetadata metadata) { Organization organization = Organization.PPSE; CommunicationTurnarounds turnarounds = CommunicationTurnarounds.ForOrganization(organization, true); SeriesCollection collection = new SeriesCollection(); DateTime today = DateTime.Today; DateTime dateIterator = today.AddDays(-90); int currentIndex = 0; // Prepare averages DateTime now = DateTime.Now; Dictionary<DateTime, int> caseCountOpen = new Dictionary<DateTime, int>(); Dictionary<DateTime, int> caseCountResponded = new Dictionary<DateTime, int>(); Dictionary<DateTime, double> caseTimeOpen = new Dictionary<DateTime, double>(); Dictionary<DateTime, double> caseTimeResponded = new Dictionary<DateTime, double>(); foreach (CommunicationTurnaround turnaround in turnarounds) { if (turnaround.Open) { if (!caseCountOpen.ContainsKey(turnaround.DateTimeOpened.Date)) { caseCountOpen[turnaround.DateTimeOpened.Date] = 0; caseTimeOpen[turnaround.DateTimeOpened.Date] = 0.0; } caseCountOpen[turnaround.DateTimeOpened.Date]++; caseTimeOpen[turnaround.DateTimeOpened.Date] += (now - turnaround.DateTimeOpened).TotalHours; } else if (turnaround.Responded) { if (!caseCountResponded.ContainsKey(turnaround.DateTimeOpened.Date)) { caseCountResponded[turnaround.DateTimeOpened.Date] = 0; caseTimeResponded[turnaround.DateTimeOpened.Date] = 0.0; } caseCountResponded[turnaround.DateTimeOpened.Date]++; caseTimeResponded[turnaround.DateTimeOpened.Date] += (turnaround.DateTimeFirstResponse-turnaround.DateTimeOpened).TotalHours; } } Series seriesOpen = new Series(); seriesOpen.Name = "Still open"; seriesOpen.DefaultElement.Color = Color.Orange; Series seriesResponded = new Series(); seriesResponded.Name = "Responded"; seriesResponded.DefaultElement.Color = Color.DarkGreen; int dateLabel = -90; while (dateIterator < today) { double avgTimeResponded = 0.0; double avgTimeOpen = 0.0; if (caseCountOpen.ContainsKey(dateIterator)) { avgTimeOpen = caseTimeOpen[dateIterator]/(double) caseCountOpen[dateIterator]; } if (caseCountResponded.ContainsKey(dateIterator)) { avgTimeResponded = caseTimeResponded[dateIterator]/(double) caseCountResponded[dateIterator]; } Element elementOpen = new Element(); elementOpen.XValue = dateLabel; elementOpen.YValue = avgTimeOpen - avgTimeResponded; seriesOpen.AddElements(elementOpen); Element elementResponded = new Element(); elementResponded.XValue = dateLabel; elementResponded.YValue = avgTimeResponded; seriesResponded.AddElements(elementResponded); dateIterator = dateIterator.AddDays(1); dateLabel++; } collection.Add(seriesResponded); collection.Add(seriesOpen); return collection; }
SeriesCollection GetResponseData(OrganizationMetadata metadata) { Organization organization = Organization.PPSE; CommunicationTurnarounds turnarounds = CommunicationTurnarounds.ForOrganization(organization, true); SeriesCollection collection = new SeriesCollection(); DateTime today = DateTime.Today; DateTime dateIterator = today.AddDays(-90); int currentIndex = 0; // Prepare averages DateTime now = DateTime.Now; Dictionary <DateTime, int> caseCountOpen = new Dictionary <DateTime, int>(); Dictionary <DateTime, int> caseCountResponded = new Dictionary <DateTime, int>(); Dictionary <DateTime, double> caseTimeOpen = new Dictionary <DateTime, double>(); Dictionary <DateTime, double> caseTimeResponded = new Dictionary <DateTime, double>(); foreach (CommunicationTurnaround turnaround in turnarounds) { if (turnaround.Open) { if (!caseCountOpen.ContainsKey(turnaround.DateTimeOpened.Date)) { caseCountOpen[turnaround.DateTimeOpened.Date] = 0; caseTimeOpen[turnaround.DateTimeOpened.Date] = 0.0; } caseCountOpen[turnaround.DateTimeOpened.Date]++; caseTimeOpen[turnaround.DateTimeOpened.Date] += (now - turnaround.DateTimeOpened).TotalHours; } else if (turnaround.Responded) { if (!caseCountResponded.ContainsKey(turnaround.DateTimeOpened.Date)) { caseCountResponded[turnaround.DateTimeOpened.Date] = 0; caseTimeResponded[turnaround.DateTimeOpened.Date] = 0.0; } caseCountResponded[turnaround.DateTimeOpened.Date]++; caseTimeResponded[turnaround.DateTimeOpened.Date] += (turnaround.DateTimeFirstResponse - turnaround.DateTimeOpened).TotalHours; } } Series seriesOpen = new Series(); seriesOpen.Name = "Still open"; seriesOpen.DefaultElement.Color = Color.Orange; Series seriesResponded = new Series(); seriesResponded.Name = "Responded"; seriesResponded.DefaultElement.Color = Color.DarkGreen; int dateLabel = -90; while (dateIterator < today) { double avgTimeResponded = 0.0; double avgTimeOpen = 0.0; if (caseCountOpen.ContainsKey(dateIterator)) { avgTimeOpen = caseTimeOpen[dateIterator] / (double)caseCountOpen[dateIterator]; } if (caseCountResponded.ContainsKey(dateIterator)) { avgTimeResponded = caseTimeResponded[dateIterator] / (double)caseCountResponded[dateIterator]; } Element elementOpen = new Element(); elementOpen.XValue = dateLabel; elementOpen.YValue = avgTimeOpen - avgTimeResponded; seriesOpen.AddElements(elementOpen); Element elementResponded = new Element(); elementResponded.XValue = dateLabel; elementResponded.YValue = avgTimeResponded; seriesResponded.AddElements(elementResponded); dateIterator = dateIterator.AddDays(1); dateLabel++; } collection.Add(seriesResponded); collection.Add(seriesOpen); return(collection); }
private void LoadChart() { all = mutationRisk.Count(); low = mutationRisk.Where(mr => ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 0 && ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 0 ).Count(); mid = mutationRisk.Where(mr => ( ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 1 || ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 1 ) && !( ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 2 || ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 2 ) ).Count(); high = mutationRisk.Where(mr => ( ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 2 || ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 2 ) ).Count(); passed = mutationRisk.Where(mr => ( ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1 || ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 ) ).Count(); SeriesCollection sc = new SeriesCollection(); Series mmrpro = new Series("MMRPro"); Series premm = new Series("PREMM"); mmrpro.LegendEntry.Value = ""; premm.LegendEntry.Value = ""; Element mmrpro_elem0 = new Element(); mmrpro_elem0.Name = "0-4%"; mmrpro_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 0).Count(); mmrpro.AddElements(mmrpro_elem0); Element mmrpro_elem1 = new Element(); mmrpro_elem1.Name = "5-9%"; mmrpro_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 1).Count(); mmrpro.AddElements(mmrpro_elem1); Element mmrpro_elem2 = new Element(); mmrpro_elem2.Name = "10% or Greater"; mmrpro_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 2).Count(); mmrpro.AddElements(mmrpro_elem2); Element premm__elem0 = new Element(); premm__elem0.Name = "0-4%"; premm__elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 0).Count(); premm.AddElements(premm__elem0); Element premm__elem1 = new Element(); premm__elem1.Name = "5-9%"; premm__elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 1).Count(); premm.AddElements(premm__elem1); Element premm__elem2 = new Element(); premm__elem2.Name = "10% or Greater"; premm__elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 2).Count(); premm.AddElements(premm__elem2); sc.Add(mmrpro); sc.Add(premm); chart1.SeriesCollection.Add(sc); SeriesCollection passedCollection = new SeriesCollection(); Series mmrpro_passed = new Series("MMRPro"); Series premm__passed = new Series("PREMM"); Element mmrpro_yes = new Element(); mmrpro_yes.Name = "At or Above Threshold"; mmrpro_yes.Color = Color.Red; mmrpro_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1).Count(); mmrpro_passed.AddElements(mmrpro_yes); Element mmrpro_no = new Element(); mmrpro_no.Name = "Below Threshold"; mmrpro_no.Color = Color.White; mmrpro_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 0).Count(); mmrpro_passed.AddElements(mmrpro_no); Element premm__yes = new Element(); premm__yes.Name = "At or Above Threshold"; premm__yes.Color = Color.Red; premm__yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1).Count(); premm__passed.AddElements(premm__yes); Element premm__no = new Element(); premm__no.Name = "Below Threshold"; premm__no.Color = Color.White; premm__no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 0).Count(); premm__passed.AddElements(premm__no); passedCollection.Add(mmrpro_passed); passedCollection.Add(premm__passed); chart2.SeriesCollection.Add(passedCollection); SeriesCollection passedbyModelCollection = new SeriesCollection(); Series mmrpro_passedbyModel = new Series("MMRPro"); Series premm__passedbyModel = new Series("PREMM"); Element brcapropassedby_yes = new Element(); brcapropassedby_yes.Name = "At or Above Threshold"; brcapropassedby_yes.Color = Color.Red; brcapropassedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1 && (((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 || ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1)).Count(); mmrpro_passedbyModel.AddElements(brcapropassedby_yes); Element brcapropassedby_no = new Element(); brcapropassedby_no.Name = "Below Threshold"; brcapropassedby_no.Color = Color.White; brcapropassedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 0 && (((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 || ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1)).Count(); mmrpro_passedbyModel.AddElements(brcapropassedby_no); Element myriadpassedby_yes = new Element(); myriadpassedby_yes.Name = "At or Above Threshold"; myriadpassedby_yes.Color = Color.Red; myriadpassedby_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 && (((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 || ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1)).Count(); premm__passedbyModel.AddElements(myriadpassedby_yes); Element myriadpassedby_no = new Element(); myriadpassedby_no.Name = "Below Threshold"; myriadpassedby_no.Color = Color.White; myriadpassedby_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 0 && (((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1 || ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1)).Count(); premm__passedbyModel.AddElements(myriadpassedby_no); passedbyModelCollection.Add(mmrpro_passedbyModel); passedbyModelCollection.Add(premm__passedbyModel); chart3.SeriesCollection.Add(passedbyModelCollection); }