/// <summary> /// 初始化数据 --- 病种列表 /// </summary> /// <auth>Yanqiao.Cai</auth> /// <date>2012-12-28</date> private void InitData() { try { //获取所有病种列表 DataTable dt = DS_SqlService.GetDiagnosis(); dt.Columns.Add(new DataColumn("FLAG", typeof(bool))); DataRow[] listArry = dt.Select(" 1=1 "); if (allSource.Rows.Count == 0) { allSource = listArry.Length == 0 ? new DataTable() : listArry.CopyToDataTable(); } string searchStr = this.txt_search.Text.ToUpper(); if (groupID == -1) {//新增 foreach (DataRow dr in listArry) { dr["FLAG"] = false; } notCheckedList = listArry.ToList(); } else {//编辑 DataTable thisGroupDt = DS_SqlService.GetDiseaseGroupByID(groupID); if (null == thisGroupDt || thisGroupDt.Rows.Count == 0) { return; } this.txt_groupName.Text = null == thisGroupDt.Rows[0]["NAME"] ? "" : thisGroupDt.Rows[0]["NAME"].ToString(); this.txt_memo.Text = null == thisGroupDt.Rows[0]["MEMO"] ? "" : thisGroupDt.Rows[0]["MEMO"].ToString(); List <string> idList = thisGroupDt.Rows[0]["diseaseids"].ToString().Split('$').ToList(); checkedList.Clear(); notCheckedList.Clear(); //已勾选项 不过滤 var checkedEnu = listArry.Where(p => null != p["ICD"] && idList.Contains(p["ICD"].ToString())).OrderBy(q => q["NAME"]); foreach (DataRow dr in checkedEnu) { dr["FLAG"] = true; checkedList.Add(dr); } //对未勾选项进行过滤 var notCheckedEnu = listArry.Where(p => null != p["ICD"] && !idList.Contains(p["ICD"].ToString()) && (p["ICD"].ToString().Contains(searchStr) || p["NAME"].ToString().Contains(searchStr) || p["PY"].ToString().Contains(searchStr) || p["WB"].ToString().Contains(searchStr))).OrderBy(q => q["NAME"]); foreach (DataRow dr in notCheckedEnu) { dr["FLAG"] = false; notCheckedList.Add(dr); } RefreshDiseaseTextArea(); } DataTable endDt = checkedList.Union(notCheckedList).CopyToDataTable(); defaultSource = endDt.Copy(); this.gridControl_disease.DataSource = endDt; } catch (Exception ex) { throw new Exception(ex.Message); } }
/// <summary> /// 重置 /// </summary> /// <auth>Yanqiao.Cai</auth> /// <date>2013-01-06</date> private void Reset() { try { if (groupID == -1) { ClearPage(); } else { this.txt_search.Text = string.Empty; DataTable thisGroupDt = DS_SqlService.GetDiseaseGroupByID(groupID); if (null == thisGroupDt || thisGroupDt.Rows.Count == 0) { return; } this.txt_groupName.Text = null == thisGroupDt.Rows[0]["NAME"] ? "" : thisGroupDt.Rows[0]["NAME"].ToString(); this.txt_memo.Text = null == thisGroupDt.Rows[0]["MEMO"] ? "" : thisGroupDt.Rows[0]["MEMO"].ToString(); this.gridControl_disease.DataSource = defaultSource; checkedList = defaultSource.Select(" FLAG = " + true).ToList(); notCheckedList = defaultSource.Select(" FLAG = " + false).ToList(); RefreshDiseaseTextArea(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
/// <summary> /// 根据病种组合ID获取病种ICD集合 /// </summary> /// <auth>Yanqiao.Cai</auth> /// <date>2012-12-29</date> /// <param name="groupid">病种组合ID</param> /// <returns></returns> public static List <string> GetDiseaseIDsByGroupID(int groupid) { try { List <string> list = new List <string>(); DataTable dt = DS_SqlService.GetDiseaseGroupByID(groupid); if (null == dt || dt.Rows.Count == 0) { return(list); } string IDs = null == dt.Rows[0]["diseaseids"] ? "" : dt.Rows[0]["diseaseids"].ToString(); return(IDs.Split('$').ToList()); } catch (Exception ex) { throw new Exception(ex.Message); } }