/// <summary> /// Build a list of Adverse Events based on selected version /// </summary> private void PopulateAEs() { string catId = Categories.Value; if (!string.IsNullOrEmpty(catId)) { int categoryId = int.Parse(catId); CTCAEDa ae = new CTCAEDa(); DataView view = ae.GetToxCategoryAdverseEvents(categoryId).Tables[0].DefaultView; //SAESelect.DataSource = view; //SAESelect.DataBind(); //ToxicityTable.Visible = true; } else { //SAESelect.Items.Clear(); //ToxicityTable.Visible = false; } // hide next step //GradeTable.Visible = false; }
/// <summary> /// /// </summary> private void BuildAdverseClientEventDataSource() { if (!string.IsNullOrEmpty(Versions.Value)) { int?currentCatId = null; if (!string.IsNullOrEmpty(Categories.Value)) { currentCatId = int.Parse(Categories.Value); } CTCAEDa da = new CTCAEDa(); int termId = int.Parse(Versions.Value); DataTable dt = da.DoToxAdverseEventSearch(termId, ""); var data = from row in dt.AsEnumerable() let catId = (int)row["AE_CategoryID"] let sae = PageUtil.EscapeSingleQuotes(row["ToxDesc"].ToString()) let saeId = (int)row["CTC_AE_Toxicity_TermID"] let filter = currentCatId.HasValue ? currentCatId == catId : true where filter select "{ value: '" + sae + "', value: '" + sae + "', saeId: '" + saeId + "', catId: '" + catId + "'}"; // create CSV, list of json objects string SAE_DATA = "var SAE_DATA = [" + string.Join(",", data.ToArray()) + "];"; // register client data source Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "SAE_DATA", SAE_DATA, true); } }
/// <summary> /// Build a list of categories based on selected version /// </summary> private void PopulateAECategories() { string verId = Versions.Value; if (!string.IsNullOrEmpty(verId)) { int versionId = int.Parse(verId); CTCAEDa ae = new CTCAEDa(); DataView view = ae.GetToxCategories(versionId).Tables[0].DefaultView; Categories.DataSource = view; Categories.DataBind(); //CategoryTable.Visible = true; // update default version id UserController uc = new UserController(); if (!string.IsNullOrEmpty(verId)) { uc.UpdateUserAttribute("AE_TerminologyID", verId, "Default Terminology ID"); } } else { Categories.Items.Clear(); //CategoryTable.Visible = false; } // hide next steps //ToxicityTable.Visible = false; //GradeTable.Visible = false; }
/// <summary> /// Build a list of Versions /// </summary> private void PopulateAEVersions() { CTCAEDa ae = new CTCAEDa(); DataView view = ae.GetCTCAETerminlogyVersions().Tables[0].DefaultView; Versions.DataSource = view; Versions.DataBind(); // determine default version id UserController uc = new UserController(); string defaultToxId = uc.GetUserAttributeValue("AE_TerminologyID"); if (!string.IsNullOrEmpty(defaultToxId)) { Versions.Value = defaultToxId; } // hide next steps //CategoryTable.Visible = false; //ToxicityTable.Visible = false; //GradeTable.Visible = false; PopulateAECategories(); BuildAdverseClientEventDataSource(); }
private void Build() { int saeId = int.Parse(Request.Form["saeId"]); CTCAEDa ae = new CTCAEDa(); DataView dv = ae.GetToxAdverseEventGrades(saeId).Tables[0].DefaultView; GradeRptr.DataSource = dv; GradeRptr.DataBind(); }
/// <summary> /// Builds a lookup for CTCAE caregories, toxicities and grades /// </summary> private void BuildCTCAELookup() { string ctcaeVersion = CTCAEVersion.Value; if (!string.IsNullOrEmpty(ctcaeVersion)) { CTCAEDa da = new CTCAEDa(); var versions = da.GetCTCAETerminlogyVersions().Tables[0].DefaultView; // locate version by name versions.RowFilter = "AE_Terminology_ShortDesc = '" + PageUtil.EscapeSingleQuotesForSql(ctcaeVersion) + "'"; if (versions.Count > 0) { int termId = (int)versions[0]["AE_TerminologyID"]; // get a list of categories, toxicities, and grades by version var dt = da.GetCTCLookup(termId); // get a list of radio button groups on page, verify field names var radioButtonGroup = from rg in CICHelper.GetCaisisInputControls(this).OfType <EformRadioButtonGroup>() where rg.Table == "Toxicities" && rg.Field1 == "ToxCategory" && rg.Field2 == "ToxName" && rg.Field3 == "ToxScale" let category = rg.Value1 let tox = rg.Value2 select rg; // get a lookup of grades for each radio button group var radioGroupToCTC = from rg in radioButtonGroup let rgTox = rg.Value2 let rgCat = rg.Value1 // check if this toxicity and category has grade entries let foundGrades = from row in dt.AsEnumerable() let tox = row["CTC_AE_Toxicity_ShortDesc"].ToString() let cat = row["AE_Category_Description"].ToString() where tox.Contains(rg.Value2) && cat.Contains(rg.Value1) select new { Grade = Server.HtmlEncode(row["AE_Grade"].ToString()), GradeDesc = Server.HtmlEncode(row["AE_Grade_Description"].ToString()) } where foundGrades.Count() > 0 select new { ToxName = rgTox, // get normalized client lookup name (only alpha characters) //ToxNameLookupKey = new String(rgTox.Replace(" ", "").ToCharArray().Where(c => (c >= 'a' || c <= 'z') || (c >= 'A' || c <= 'Z')).ToArray()), ToxNameLookupKey = rgTox.Replace(" ", "").Replace("-", ""), ClientId = rg.ClientID, Grades = foundGrades }; // build outer rptr with tooltip for each radio group CTCAERptr.DataSource = radioGroupToCTC; CTCAERptr.DataBind(); // register a list of client ids used for mapping tooltip content var CTC_GRADE_LOOKUP = "var CTC_GRADE_LOOKUP = { " + string.Join(",", radioGroupToCTC.Select(c => "'" + c.ToxNameLookupKey + "': '" + c.ClientId + "'").ToArray()) + "};"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CTC_GRADE_LOOKUP", CTC_GRADE_LOOKUP, true); } } }
private void PopulateSpecialFields() { // popualte AE + categories by latest version CTCAEDa da = new CTCAEDa(); //populate AE DataTable adverseEvents = da.GetLatestAdverseEvents(); ToxNameField.BuildComboData(adverseEvents, "ToxDesc", "ToxDesc"); // populate categories DataTable categories = da.GetLatestCategories(); ToxCategoryField.DataTextField = "AE_Category_Description"; ToxCategoryField.DataValueField = "AE_Category_Description"; ToxCategoryField.DataSource = categories; ToxCategoryField.DataBind(); }