/// <summary> /// 初始化下拉列表 查询数据等 /// </summary> /// <returns> -1 出错</returns> public int InitInfo() { //初始化表,并绑定数据源 InitDateTable(); InitList(); fpEnter1_Sheet1.GrayAreaBackColor = System.Drawing.Color.White; Neusoft.HISFC.BizLogic.HealthRecord.ICD icdMgr = new Neusoft.HISFC.BizLogic.HealthRecord.ICD(); ArrayList icdList = icdMgr.Query(ICDTypes.ICD10, QueryTypes.Valid); this.fpEnter1.SetColumnList(this.fpEnter1_Sheet1, 6, icdList); this.fpEnter1.SetColumnList(this.fpEnter1_Sheet1, 7, icdList); return(0); }
/// <summary> /// 获得相应查询类别的ICD信息 /// </summary> /// <param name="ICDType">诊断类型枚举</param> /// <param name="queryType">查询类型枚举</param> public ArrayList ICDQuery(ICDTypes ICDType, QueryTypes queryType) { this.SetDB(icdMgr); return(icdMgr.Query(ICDType, queryType)); }
/// <summary> /// 实例化 Table 查询数据 并填充数据 /// </summary> private void LoadAndAddDateToICD10() { dtICD10 = new DataTable("ICD 10维护"); //如果配置文件存在,通过配置文件生成DataTable dtICD列信息,并绑定fp if (File.Exists(filePath10)) { //定义DataTable Function.CreatColumnByXML(filePath10, dtICD10, ref dvICD10, this.fpSpread1_Sheet1); //设置主键为sequence_no列 CreateKeys(dtICD10); } else//如果配置文件不存在,代码生成配置文件 { Type strType = typeof(System.String); Type intType = typeof(System.Int32); Type dtType = typeof(System.DateTime); Type boolType = typeof(System.Boolean); dtICD10.Columns.AddRange(new DataColumn[] { new DataColumn("sequence_no", strType), new DataColumn("诊断码", strType), new DataColumn("医保中心代码", strType), new DataColumn("统计代码", strType), new DataColumn("拼音码", strType), new DataColumn("五笔码", strType), new DataColumn("诊断名称", strType), new DataColumn("第二诊断名称", strType), new DataColumn("第三诊断名称", strType), new DataColumn("死亡原因", strType), new DataColumn("疾病分类", strType), new DataColumn("标准住院日", intType), new DataColumn("30种疾病", boolType), new DataColumn("传染病", boolType), new DataColumn("肿瘤", boolType), new DataColumn("住院等级", strType), new DataColumn("有效性", boolType), new DataColumn("序号", strType), new DataColumn("操作员编码", strType), new DataColumn("操作员", strType), new DataColumn("操作时间", dtType) }); //设置主键为sequence_no列 CreateKeys(dtICD10); dvICD10 = new DataView(dtICD10); this.fpSpread1_Sheet1.DataSource = dvICD10; Neusoft.FrameWork.WinForms.Classes.CustomerFp.SaveColumnProperty(this.fpSpread1_Sheet1, filePath10); } ArrayList alReturn = new ArrayList();//返回的ICD信息; //获得有效的ICD10信息 alReturn = myICD.Query(ICDTypes.ICD10, QueryTypes.Valid); if (alReturn == null) { MessageBox.Show("获得ICD信息出错!" + myICD.Err); return; } //循环插入信息 foreach (Neusoft.HISFC.Models.HealthRecord.ICD obj in alReturn) { DataRow row = dtICD10.NewRow(); SetRow(obj, row); dtICD10.Rows.Add(row); } dtICD10.AcceptChanges(); //设置fpSpread1 的属性 if (System.IO.File.Exists(filePath10)) { Neusoft.FrameWork.WinForms.Classes.CustomerFp.ReadColumnProperty(this.fpSpread1_Sheet1, filePath10); } }
/// <summary> /// 加载数据 /// </summary> private void LoadInfo() { try { //如果是none 直接返回 if (ICDTypes.None == type) { return; } //等待窗口 Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在查询数据,请稍候..."); Application.DoEvents(); // // dtICD = new DataTable(); // //如果配置文件存在,通过配置文件生成DataTable dtICD列信息,并绑定fp // // Type strType = typeof(System.String); // Type intType = typeof(System.Int32); // Type dtType = typeof(System.DateTime); // Type boolType = typeof(System.Boolean); // // dtICD.Columns.AddRange(new DataColumn[]{new DataColumn( "诊断码", strType), // new DataColumn("副诊断码", strType), // new DataColumn("诊断名称", strType), // new DataColumn("统计代码", strType), // new DataColumn("拼音码", strType), // new DataColumn("五笔码", strType), // new DataColumn("医保中心代码", strType), // new DataColumn("第二诊断名称", strType), // new DataColumn("第三诊断名称", strType), // new DataColumn("死亡原因", strType), // new DataColumn("疾病分类", strType), // new DataColumn("标准住院日", intType), // new DataColumn("30种疾病", boolType), // new DataColumn("传染病", boolType), // new DataColumn("肿瘤", boolType), // new DataColumn("住院等级", strType), // new DataColumn("有效性", boolType), // new DataColumn("序号", strType), // new DataColumn("操作员编码", strType), // new DataColumn("操作员", strType), // new DataColumn("操作时间", dtType), // new DataColumn("适用性别", strType), // new DataColumn("sequence_no", strType)}); // // //设置主键为sequence_no列 // CreateKeys(); // dvICD = new DataView(dtICD); // this.fpSpread1_Sheet1.DataSource = dvICD; // if(!File.Exists(this.filePath)) // { // Neusoft.FrameWork.WinForms.Classes.CustomerFp.SaveColumnProperty(this.fpSpread1_Sheet1, this.filePath); // } // ArrayList alReturn = new ArrayList();//返回的ICD信息; // //获得ICD信息 // alReturn = myICD.Query(type, queryType); // if(alReturn == null) // { // MessageBox.Show("获得ICD信息出错!" + myICD.Err); // return; // } // //循环插入信息 // foreach(Neusoft.HISFC.Models.HealthRecord.ICD obj in alReturn) // { // DataRow row = dtICD.NewRow(); // SetRow(obj, row); // dtICD.Rows.Add(row); // } // //排序 // this.dvICD.Sort = "诊断码 ASC"; // //设置fpSpread1 的属性 // if(System.IO.File.Exists(this.filePath)) // { // Neusoft.FrameWork.WinForms.Classes.CustomerFp.ReadColumnProperty(this.fpSpread1_Sheet1, this.filePath); // LockFp(); // } myICD.Query(type, queryType, ref ds); //查询 if (ds.Tables.Count == 1) { DataColumn[] keys = new DataColumn[] { ds.Tables[0].Columns["sequence_no"] }; //z设置主键 ds.Tables[0].PrimaryKey = keys; this.dvICD = new DataView(ds.Tables[0]); } this.fpSpread1_Sheet1.DataSource = dvICD; LockFp(); Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 根据输入的类型,显示不同的输入控件 /// </summary> /// <param name="type"></param> /// <param name="defaultValue"></param> protected void insertValueBox(string type, string defaultValue) { //Neusoft.FrameWork.WinForms.Controls.NeuComboBox combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); Control combox = null; if (type == "INT") { combox = new Neusoft.FrameWork.WinForms.Controls.ValidatedTextBox1(); ((Neusoft.FrameWork.WinForms.Controls.ValidatedTextBox1)combox).TextFormatType = (Neusoft.FrameWork.WinForms.Controls.ValidatedTextBox1.TextFormatTypes) 1; } else if (type == "BOOL") { combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); ArrayList al = new ArrayList(); Neusoft.FrameWork.Models.NeuObject objtrue = new Neusoft.FrameWork.Models.NeuObject(); objtrue.ID = "1"; objtrue.Name = "是"; objtrue.Memo = "true"; al.Add(objtrue); Neusoft.FrameWork.Models.NeuObject objfalse = new Neusoft.FrameWork.Models.NeuObject(); objfalse.ID = "0"; objfalse.Name = "否"; objfalse.Memo = "false"; al.Add(objfalse); ((Neusoft.FrameWork.WinForms.Controls.NeuComboBox)combox).AddItems(al); } else if (type == "DATETIME") { combox = new DateTimePicker(); ((DateTimePicker)combox).CustomFormat = "yyyy-MM-dd HH:mm"; ((DateTimePicker)combox).Format = DateTimePickerFormat.Custom; } else if (type == "DEPARTMENT")//科室 { combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); ((Neusoft.FrameWork.WinForms.Controls.NeuComboBox)combox).AddItems(deptManager.GetDeptmentAll()); } else if (type == "SEX")//性别 { combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); ((Neusoft.FrameWork.WinForms.Controls.NeuComboBox)combox).AddItems(Neusoft.HISFC.Models.Base.SexEnumService.List()); } else if (type == "MARI")//婚姻状况 { combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); ((Neusoft.FrameWork.WinForms.Controls.NeuComboBox)combox).AddItems(Neusoft.HISFC.Models.RADT.MaritalStatusEnumService.List()); } else if (type == "OPERATOR")//人员 { combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); ((Neusoft.FrameWork.WinForms.Controls.NeuComboBox)combox).AddItems(personManager.GetEmployeeAll()); } else if (type == "STRING")//字符串 { combox = new TextBox(); } else if (type == "DIAGNOSE")//诊断 { combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); ArrayList alList = new ArrayList(); ((Neusoft.FrameWork.WinForms.Controls.NeuComboBox)combox).AddItems(icdMgr.Query(Neusoft.HISFC.Models.HealthRecord.EnumServer.ICDTypes.ICD10, Neusoft.HISFC.Models.HealthRecord.EnumServer.QueryTypes.Valid)); } else if (type == "OPEDIAGNOSE")//手术诊断 { combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); ArrayList alList = new ArrayList(); ((Neusoft.FrameWork.WinForms.Controls.NeuComboBox)combox).AddItems(icdMgr.Query(Neusoft.HISFC.Models.HealthRecord.EnumServer.ICDTypes.ICDOperation, Neusoft.HISFC.Models.HealthRecord.EnumServer.QueryTypes.Valid)); } else//其它用户定义 { combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); ArrayList alList = new ArrayList(); string[] s = type.Split(','); try { for (int iList = 0; iList < s.Length; iList++) { Neusoft.FrameWork.Models.NeuObject obj = new Neusoft.FrameWork.Models.NeuObject(); obj.ID = s[iList].Split(' ')[0]; obj.Name = s[iList].Split(' ')[1]; alList.Add(obj); } } catch { } ((Neusoft.FrameWork.WinForms.Controls.NeuComboBox)combox).AddItems(alList); } if (this.myDirection == enuDirection.H) { combox.Location = new Point(iBlankWidth * 3 + 50 + iConditionWidth, iCurrentRow * 21 + (iCurrentRow + 1) * iRowBlank); } else { combox.Location = new Point(iBlankWidth + 10, iRowBlank * 2 + iCurrentRow * 21 + (iCurrentRow + 1) * (iRowBlank * 3)); combox.ForeColor = Color.Red; } try { //((Neusoft.FrameWork.WinForms.Controls.NeuComboBox)combox).IsShowCustomerList = true; } catch { } combox.TabIndex = iCurrentRow * 10 + 3; combox.Width = this.ValueWidth; //combox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right |System.Windows.Forms.AnchorStyles.Left ))); combox.KeyPress += new KeyPressEventHandler(combox_KeyPress); combox.Visible = true; combox.Name = "value" + iCurrentRow.ToString().PadLeft(2, '0'); this.panel1.Controls.Add(combox); }