/// <summary> /// 获取ICD9数据,填充到TexBox中 这里是暂存 /// </summary> private void AddinfoICD9() { if (fpSpread2_Sheet1.Rows.Count == 0) { return; } //获取要对照的数据 //当前活动行 int currRow = fpSpread2_Sheet1.ActiveRowIndex; string sICDCode = fpSpread2_Sheet1.Cells[currRow, GetColumnKey(fpSpread2_Sheet1, "诊断码")].Text; if (sICDCode == "" || sICDCode == null) { return; } Neusoft.HISFC.Models.HealthRecord.ICD icd9 = new Neusoft.HISFC.Models.HealthRecord.ICD(); ArrayList al = myICD.IsExistAndReturn(sICDCode, ICDTypes.ICD9, true); if (al == null) { MessageBox.Show("获得ICD9信息出错!"); return; } icd9 = al[0] as Neusoft.HISFC.Models.HealthRecord.ICD; //ICD9 编码 textBoxICD9.Text = icd9.ID; //ICD9 名称 textBoxICD9Name.Text = icd9.Name; //ICD 拼音 textBoxICD9.Tag = icd9; }
/// <summary> /// 修改ICD信息 /// </summary> private void ModifyInfo() { if (this.fpSpread1_Sheet1.RowCount <= 0) { return; } int currRow = fpSpread1_Sheet1.ActiveRowIndex;//当前行 if (currRow < 0) { return; } ArrayList alReturn = new ArrayList(); //返回的ICD信息 string sICDCode = ""; //选取的ICD编码 //定义变量,存储要修改的信息 Neusoft.HISFC.Models.HealthRecord.ICD orgICD = new Neusoft.HISFC.Models.HealthRecord.ICD(); ////获得有效性 //string IsValue = fpSpread1_Sheet1.Cells[currRow, GetColumnKey("有效性")].Value.ToString(); ////如果已经是无效,则不允许修改 //if (IsValue == "False") //{ // MessageBox.Show("此项目已经无效,不能再被修改"); // return; //} //获得ICD编码 sICDCode = fpSpread1_Sheet1.Cells[currRow, GetColumnKey("诊断码")].Text; if (sICDCode == "" || sICDCode == null) { return; } alReturn = myICD.IsExistAndReturn(sICDCode, type, true); if (alReturn == null) { MessageBox.Show("获得ICD信息出错!" + myICD.Err); return; } if (alReturn.Count == 0) { alReturn = myICD.IsExistAndReturn(sICDCode, type, false); } if (alReturn.Count == 0) { MessageBox.Show("获得ICD信息出错"); return; } try { orgICD = alReturn[0] as Neusoft.HISFC.Models.HealthRecord.ICD; } catch (Exception ex) { MessageBox.Show("获得ICD信息出错!" + ex.Message); return; } //实例化要弹出的窗口 frmICDInfo icdInfo = new frmICDInfo(); //显示待修改信息 icdInfo.OrgICD = orgICD; //赋值 ICD的类型 icdInfo.ICDType = type; //赋值 修改的类型 icdInfo.EditType = EditTypes.Modify; //保存修改类型 editType = EditTypes.Modify; //订制事件 。 icdInfo.SaveButtonClick += new frmICDInfo.SaveInfo(icdInfo_SaveButtonClick); //显示窗体 icdInfo.ShowDialog(); }
/// <summary> /// 判断输入数据的有效性 /// </summary> /// <returns>数据都合乎规则 返回TRUE 否则返回false </returns> private bool ValidCheck() { try { //定义数组 存储 ICD ArrayList alReturn = new ArrayList(); if (textICDid.Text == "") { textICDid.Focus(); MessageBox.Show("ICD 编码不能为空");// return(false); } if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(textICDid.Text, 20)) { textICDid.Focus(); MessageBox.Show("ICD编码过长"); //提示错误 return(false); } //如果是增加 ,则判断编码是否存在 ,修改不判断 if (editType == EditTypes.Add) { //判断ICD编码是否存在 alReturn = myICD.IsExistAndReturn(textICDid.Text, myICDType, true); if (alReturn == null) { MessageBox.Show("获得ICD信息出错!" + myICD.Err); return(false); } if (alReturn.Count > 0) { textICDid.Focus(); MessageBox.Show("编码 " + textICDid.Text + " 已经存在"); return(false); } } if (textICDName.Text == null || textICDName.Text == "") { textICDName.Focus(); MessageBox.Show("请输入名称"); return(false); } if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(textICDName.Text, 100)) { textICDName.Focus(); MessageBox.Show("ICD 名称过长"); return(false); } if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(textSpellCode.Text, 8)) { textSpellCode.Focus(); MessageBox.Show("拼音码 过长"); return(false); } if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(WBCode.Text, 8)) { WBCode.Focus(); MessageBox.Show("五笔码 过长"); return(false); } if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(textUserCode.Text, 8)) { textUserCode.Focus(); MessageBox.Show("统计码 过长"); return(false); } return(true); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }