/// <summary> /// 从本地读取挂号级别,权限控制 /// </summary> /// <returns></returns> private ArrayList getRegLevelFromXML() { ArrayList alLists = new ArrayList(); XmlDocument doc = new XmlDocument(); try { doc.Load(Neusoft.FrameWork.WinForms.Classes.Function.SettingPath + "/RegLevelList.xml"); } catch { return(alLists); } try { XmlNodeList nodes = doc.SelectNodes(@"//Level"); foreach (XmlNode node in nodes) { Neusoft.HISFC.Models.Registration.RegLevel level = new Neusoft.HISFC.Models.Registration.RegLevel(); level.ID = node.Attributes["ID"].Value;// level.Name = node.Attributes["Name"].Value; level.IsExpert = Neusoft.FrameWork.Function.NConvert.ToBoolean(node.Attributes["IsExpert"].Value); level.IsFaculty = Neusoft.FrameWork.Function.NConvert.ToBoolean(node.Attributes["IsFaculty"].Value); level.IsSpecial = Neusoft.FrameWork.Function.NConvert.ToBoolean(node.Attributes["IsSpecial"].Value); level.IsDefault = Neusoft.FrameWork.Function.NConvert.ToBoolean(node.Attributes["IsDefault"].Value); alLists.Add(level); } } catch (Exception e) { MessageBox.Show("获取挂号级别出错!" + e.Message); return(null); } return(alLists); }
/// <summary> /// 插入一条挂号级别 /// </summary> /// <param name="regLevel"></param> /// <returns></returns> public int Insert(Neusoft.HISFC.Models.Registration.RegLevel regLevel) { string sql = ""; if (this.Sql.GetSql("Registration.RegLevel.Insert", ref sql) == -1) { return(-1); } try { sql = string.Format(sql, regLevel.ID, regLevel.Name, regLevel.UserCode, regLevel.SortID.ToString(), Neusoft.FrameWork.Function.NConvert.ToInt32(regLevel.IsValid).ToString(), Neusoft.FrameWork.Function.NConvert.ToInt32(regLevel.IsExpert).ToString(), Neusoft.FrameWork.Function.NConvert.ToInt32(regLevel.IsFaculty).ToString(), Neusoft.FrameWork.Function.NConvert.ToInt32(regLevel.IsDefault).ToString(), regLevel.Oper.ID, regLevel.Oper.OperTime.ToString(), Neusoft.FrameWork.Function.NConvert.ToInt32(regLevel.IsSpecial)); } catch (Exception e) { this.Err = "[Registration.RegLevel.Insert]格式不匹配!" + e.Message; this.ErrCode = e.Message; return(-1); } return(this.ExecNoQuery(sql)); }
/// <summary> /// 根据sql查询挂号级别信息 /// </summary> /// <param name="sql"></param> /// <returns></returns> private ArrayList queryBase(string sql) { if (this.ExecQuery(sql) == -1) { return(null); } try { this.al = new ArrayList(); while (this.Reader.Read()) { this.regLvl = new Neusoft.HISFC.Models.Registration.RegLevel(); //序号 this.regLvl.ID = this.Reader[2].ToString(); //名称 this.regLvl.Name = this.Reader[3].ToString(); //助记码 this.regLvl.UserCode = this.Reader[4].ToString(); //显示顺序 this.regLvl.SortID = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[5].ToString()); //是否有效 this.regLvl.IsValid = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[6].ToString()); //是否专家号 this.regLvl.IsExpert = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[7].ToString()); //是否专科号 this.regLvl.IsFaculty = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[8].ToString()); //是否特诊号 this.regLvl.IsSpecial = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[9].ToString()); //是否默认 this.regLvl.IsDefault = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[10].ToString()); //操作员 this.regLvl.Oper.ID = this.Reader[11].ToString(); //操作时间 this.regLvl.Oper.OperTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[12].ToString()); this.al.Add(this.regLvl); } this.Reader.Close(); } catch (Exception e) { this.Err = "查询挂号级别出错!" + e.Message; this.ErrCode = e.Message; return(null); } return(al); }
/// <summary> /// 设置相应挂号信息(模板,已挂,剩余等信息) /// </summary> private void QueryRegLevl() { //恢复初始状态 this.cmbDept.Tag = ""; this.cmbDoctor.Tag = ""; #region 生成挂号级别对应的科室、医生列表 Neusoft.HISFC.Models.Registration.RegLevel Level = (Neusoft.HISFC.Models.Registration.RegLevel) this.cmbRegLevel.SelectedItem; if (Level == null) { return; } if (Level.IsExpert || Level.IsSpecial)//专家、特诊 { #region 专家 //生成右侧出诊专家的科室列表 this.GetSchemaDept(Neusoft.HISFC.Models.Base.EnumSchemaType.Doct); //生成Combox下拉列表 //{920686B9-AD51-496e-9240-5A6DA098404E} this.addRegDeptToCombox(); //清空医生列表,等选择科室后再检索出诊专家 ArrayList al = new ArrayList(); this.cmbDoctor.AddItems(al); #endregion } else if (Level.IsFaculty)//专科 { #region 专科 //获取出诊专科列表 this.GetSchemaDept(Neusoft.HISFC.Models.Base.EnumSchemaType.Dept); this.addRegDeptToCombox(); //清空医生列表,专科不需要选择医生 ArrayList al = new ArrayList(); this.cmbDoctor.AddItems(al); #endregion } else//普通 { //显示科室列表 this.cmbDept.AddItems(this.al); } #endregion }
/// <summary> /// 删除行 /// </summary> /// <returns></returns> public int Delete() { int row = this.fpSpread1_Sheet1.ActiveRowIndex; if (row < 0 || this.fpSpread1_Sheet1.RowCount == 0) { return(0); } if (MessageBox.Show("是否删除该记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return(0); } if (this.fpSpread1_Sheet1.Rows[row].Tag != null) { Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); //Neusoft.FrameWork.Management.Transaction SQLCA = new Neusoft.FrameWork.Management.Transaction(this.regLvlMgr.Connection); //SQLCA.BeginTransaction(); try { Neusoft.HISFC.Models.Registration.RegLevel regLvl = (Neusoft.HISFC.Models.Registration.RegLevel) this.fpSpread1_Sheet1.Rows[row].Tag; this.regLvlMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); if (this.regLvlMgr.Delete(regLvl.ID) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(this.regLvlMgr.Err, "提示"); return(-1); } Neusoft.FrameWork.Management.PublicTrans.Commit(); } catch (Exception e) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(e.Message, "提示"); return(-1); } } this.fpSpread1_Sheet1.Rows.Remove(row, 1); MessageBox.Show("删除成功!", "提示"); return(0); }
//private void SelectItem(Neusoft.HISFC.Models.Nurse.Queue queue, Neusoft.HISFC.Models.Registration.Register register) private void SelectItem(Neusoft.HISFC.Models.Registration.Register register) { for (int i = 0; i < this.queues.Count; i++) { //ArrayList al = new ArrayList(); Neusoft.HISFC.Models.Nurse.Queue queue = new Neusoft.HISFC.Models.Nurse.Queue(); queue = queues[i] as Neusoft.HISFC.Models.Nurse.Queue; //判断是不是专家号 this.regLevel = this.registrationIntergrade.QueryRegLevelByCode(register.DoctorInfo.Templet.RegLevel.ID); register.RegLvlFee.RegLevel.IsExpert = this.regLevel.IsExpert; //全都符合 if (Neusoft.FrameWork.Function.NConvert.ToBoolean(queue.ExpertFlag) == register.RegLvlFee.RegLevel.IsExpert && queue.Doctor.ID == register.DoctorInfo.Templet.Doct.ID && queue.AssignDept.ID == register.DoctorInfo.Templet.Dept.ID) { this.cmbQueue.SelectedIndex = i; return; } } for (int i = 0; i < this.queues.Count; i++) { //ArrayList al = new ArrayList(); Neusoft.HISFC.Models.Nurse.Queue queue = new Neusoft.HISFC.Models.Nurse.Queue(); queue = queues[i] as Neusoft.HISFC.Models.Nurse.Queue; //判断是不是专家号 this.regLevel = this.registrationIntergrade.QueryRegLevelByCode(register.DoctorInfo.Templet.RegLevel.ID); register.RegLvlFee.RegLevel.IsExpert = this.regLevel.IsExpert; //号别相同(指是否专家)科室相同 if (Neusoft.FrameWork.Function.NConvert.ToBoolean(queue.ExpertFlag) == register.RegLvlFee.RegLevel.IsExpert && queue.AssignDept.ID == register.DoctorInfo.Templet.Dept.ID) { this.cmbQueue.SelectedIndex = i; return; } } #region {4600A33C-8065-4b2c-93D2-9B26B24F61CF} if (this.cmbQueue.Items.Count > 0) { this.cmbQueue.SelectedIndex = 0; // return; } #endregion //this.cmbQueue.SelectedIndex = 0; }
/// <summary> /// 判断超出挂号限额是否允许挂号 /// </summary> /// <param name="schMgr"></param> /// <param name="regType"></param> /// <param name="schemaID"></param> /// <param name="level"></param> /// <param name="seeNo"></param> /// <param name="Err"></param> /// <returns></returns> private int IsPermitOverrun(Neusoft.HISFC.Models.Base.EnumRegType regType, string schemaID, Neusoft.HISFC.Models.Registration.RegLevel level, ref int seeNo, ref string Err) { bool isOverrun = false;//是否超额 Neusoft.HISFC.Models.Registration.Schema schema = this.SchemaMgr.GetByID(schemaID); if (schema == null || schema.Templet.ID == "") { Err = "查询排班信息出错!" + SchemaMgr.Err; return(-1); } if (level.IsExpert || level.IsFaculty)//专家、专科判断限额是否大于已挂号 { if (schema.Templet.RegQuota - schema.RegedQTY < 0) { isOverrun = true; } seeNo = schema.SeeNO; } else if (level.IsSpecial)//特诊判断特诊限额是否超表 { if (schema.Templet.SpeQuota - schema.SpedQTY < 0) { isOverrun = true; } seeNo = schema.SeeNO; } if (isOverrun) { //加号不用提示 if (schema.Templet.IsAppend) { return(0); } Err = "已经超出出诊排班限额,不能挂号!"; return(-1); } return(0); }
private int valid() { if (this.cmbRegLevel.Tag == null || this.cmbRegLevel.Tag.ToString() == "") { MessageBox.Show("请选择挂号级别!", "提示"); this.cmbRegLevel.Focus(); return(-1); } //得到挂号级别情况 Neusoft.HISFC.Models.Registration.RegLevel level = (Neusoft.HISFC.Models.Registration.RegLevel) this.cmbRegLevel.SelectedItem; if ((this.cmbDept.Tag == null || this.cmbDept.Tag.ToString() == "")) { MessageBox.Show("请输入挂号科室!", "提示"); this.cmbDept.Focus(); return(-1); } if (this.cmbDept.SelectedItem == null) { MessageBox.Show("请选择挂号科室!", "提示"); this.cmbDept.Focus(); return(-1); } //感觉挂号科室不应该让手写,应该是选择得到的 if (this.cmbDept.Text != this.cmbDept.SelectedItem.Name && this.cmbDept.Text != this.cmbDept.Tag.ToString()) { MessageBox.Show("请输入正确的挂号科室!", "提示"); this.cmbDept.Focus(); return(-1); } //专家号或者特诊号必须指定医生 if ((level.IsExpert || level.IsSpecial) && (this.cmbDoctor.Tag == null || this.cmbDoctor.Tag.ToString() == "")) { //提示应该是专家号或者特诊号必须指定看诊医生 MessageBox.Show("专家号必须指定看诊医生!", "提示"); this.cmbDoctor.Focus(); return(-1); } return(0); }
/// <summary> /// 更新看诊限额 /// </summary> /// <param name="SchMgr"></param> /// <param name="regType"></param> /// <param name="seeNo"></param> /// <param name="Err"></param> /// <returns></returns> private int UpdateSchema(Neusoft.HISFC.Models.Base.EnumRegType regType, ref int seeNo, ref string Err, Neusoft.HISFC.Models.Registration.RegLevel level) { int rtn = 1; //挂号级别 if (level.IsFaculty || level.IsExpert)//专家、专科,扣挂号限额 { //判断限额是否允许挂号 if (this.IsPermitOverrun(regType, (this.dtBookingDate.Tag as Neusoft.HISFC.Models.Registration.Schema).Templet.ID, level, ref seeNo, ref Err) == -1) { return(-1); } } else if (level.IsSpecial)//特诊扣特诊限额 { rtn = SchemaMgr.Increase( (this.dtBookingDate.Tag as Neusoft.HISFC.Models.Registration.Schema).Templet.ID, false, false, false, true); //判断限额是否允许挂号 if (this.IsPermitOverrun(regType, (this.dtBookingDate.Tag as Neusoft.HISFC.Models.Registration.Schema).Templet.ID, level, ref seeNo, ref Err) == -1) { return(-1); } } if (rtn == -1) { Err = "更新排班看诊限额时出错!" + SchemaMgr.Err; return(-1); } if (rtn == 0) { Err = "医生排班信息已经改变,请重新选择看诊时段!"; return(-1); } return(0); }
/// <summary> /// 保存 /// </summary> /// <returns></returns> public int Save() { this.fpSpread1.StopCellEditing(); if (this.Valid() == -1) { return(-1); } Neusoft.HISFC.Models.Registration.RegLevel regLevel; DateTime operDate = this.regLvlMgr.GetDateTimeFromSysDateTime(); Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); //Neusoft.FrameWork.Management.Transaction SQLCA = new Neusoft.FrameWork.Management.Transaction(this.regLvlMgr.Connection); //SQLCA.BeginTransaction(); try { this.regLvlMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); for (int i = 0; i < this.fpSpread1_Sheet1.RowCount; i++) { if (this.fpSpread1_Sheet1.Rows[i].Tag != null) { regLevel = (Neusoft.HISFC.Models.Registration.RegLevel) this.fpSpread1_Sheet1.Rows[i].Tag; if (this.regLvlMgr.Delete(regLevel.ID) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(this.regLvlMgr.Err, "提示"); return(-1); } } else { regLevel = new Neusoft.HISFC.Models.Registration.RegLevel(); } #region 赋值 regLevel.ID = this.fpSpread1_Sheet1.GetText(i, 0); //代码 regLevel.Name = this.fpSpread1_Sheet1.GetText(i, 1); //名称 regLevel.UserCode = this.fpSpread1_Sheet1.GetText(i, 2); //助记码 regLevel.SortID = int.Parse(this.fpSpread1_Sheet1.GetText(i, 3)); //显示顺序 //是否停用 if (this.fpSpread1_Sheet1.GetText(i, 4).ToUpper() == "TRUE") { regLevel.IsValid = false; } else { regLevel.IsValid = true; } //是否专家号 if (this.fpSpread1_Sheet1.GetText(i, 5).ToUpper() == "TRUE") { regLevel.IsExpert = true; } else { regLevel.IsExpert = false; } //是否专科号 if (this.fpSpread1_Sheet1.GetText(i, 6).ToUpper() == "TRUE") { regLevel.IsFaculty = true; } else { regLevel.IsFaculty = false; } //是否特诊号 if (this.fpSpread1_Sheet1.GetText(i, 7).ToUpper() == "TRUE") { regLevel.IsSpecial = true; } else { regLevel.IsSpecial = false; } //是否默认项 if (this.fpSpread1_Sheet1.GetText(i, 8).ToUpper() == "TRUE") { regLevel.IsDefault = true; } else { regLevel.IsDefault = false; } regLevel.Oper.ID = this.regLvlMgr.Operator.ID; regLevel.Oper.OperTime = operDate; #endregion if (this.regLvlMgr.Insert(regLevel) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(this.regLvlMgr.Err, "提示"); return(-1); } this.fpSpread1_Sheet1.Rows[i].Tag = regLevel; } Neusoft.FrameWork.Management.PublicTrans.Commit(); } catch (Exception e) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(e.Message, "提示"); return(-1); } MessageBox.Show("保存成功!", "提示"); return(0); }
/// <summary> /// 添加患者信息 /// </summary> /// <param name="obj"></param> private void AddPatientToTree(Neusoft.HISFC.Models.Registration.Register obj) { #region donggq--原来的加载当前医生患者的判断是不对的,这个是新改的---{ED85797A-9B62-40a7-8BB9-1C74929B85A8} if (obj == null) { return; } if (obj.DoctorInfo.Templet.Doct.ID != Neusoft.FrameWork.Management.Connection.Operator.ID) { return; } #endregion TreeNode patientNode = new TreeNode(); int image = 0; if (obj.Sex.ID.ToString() == "F")//女 { if (obj.IsBaby) { image = 10; } else { image = 6; } } else //男 { if (obj.IsBaby) { image = 8; } else { image = 4; } } patientNode.ImageIndex = image; patientNode.SelectedImageIndex = image + 1; string before = ""; bool isExpert = false; Neusoft.HISFC.Models.Registration.RegLevel reglv = null; reglv = this.regManagement.QueryRegLevelByCode(obj.DoctorInfo.Templet.RegLevel.ID); isExpert = reglv.IsExpert; if (obj.RegType == Neusoft.HISFC.Models.Base.EnumRegType.Pre) { before = "预约"; } if (obj.DoctorInfo.Templet.Doct.ID != "" && isExpert) { patientNode.Text = "*专*" + obj.Name + "【" + before + obj.DoctorInfo.SeeNO + "】" + More; } else { patientNode.Text = obj.Name + "【" + before + obj.DoctorInfo.SeeNO + "】" + More; } obj.DoctorInfo.SeeNO = -1; patientNode.Tag = obj; this.neuTreeView1.Nodes[0].Nodes.Add(patientNode); #region {6E95A004-5A76-4fb7-9217-81DE7897F079} 门诊医生站读卡操作--选中患者 by guanyx this.neuTreeView1.SelectedNode = patientNode; #endregion this.neuTreeView1.ExpandAll(); }