private void cmbDept_SelectedIndexChanged(object sender, System.EventArgs e) { this.RefreshQuery(); if (this.cmbDept.Tag != null) { Neusoft.HISFC.Models.Base.ExtendInfo obj = Classes.Function.IsDeptHaveDruged(this.cmbDept.Tag.ToString()); if (obj == null) { this.btnSend.Enabled = true; } else { this.btnSend.Enabled = !Neusoft.FrameWork.Function.NConvert.ToBoolean(obj.NumberProperty); string dateTimeTmp = obj.DateProperty.Date == new DateTime(1, 1, 1).Date ? string.Empty : obj.DateProperty.ToString(); if (!(obj.OperEnvironment.ID == "" && dateTimeTmp == "")) { this.lblSendInfo.Text = "发送人:" + obj.OperEnvironment.ID + " 发送时间:" + dateTimeTmp; } else { this.lblSendInfo.Text = ""; } } } }
/// <summary> /// 获取本科室上次日结时间 /// </summary> /// <returns></returns> protected int GetLastTime() { //获取本科室上次日结时间 this.deptExt = this.extManager.GetComExtInfo(Neusoft.HISFC.Models.Base.EnumExtendClass.DEPT, this.dayStoreTypeParam, this.privDept.ID); if (this.deptExt == null) { MessageBox.Show(Language.Msg("获取科室扩展属性内上次日结时间失败!")); return(-1); } if (deptExt.ID == "") { this.deptExt.Item.ID = this.privDept.ID; this.deptExt.PropertyCode = this.dayStoreTypeParam; this.deptExt.PropertyName = "科室上次日结时间"; } if (deptExt.DateProperty == System.DateTime.MinValue) { this.dtpBegin.Value = this.extManager.GetDateTimeFromSysDateTime().AddDays(-1); this.dtpBegin.Enabled = true; this.lbNotice.Visible = true; } else { this.dtpBegin.Value = this.deptExt.DateProperty; this.dtpBegin.Enabled = false; this.lbNotice.Visible = false; } return(1); }
/// <summary> /// 日报动态更新,在每次发生床位变动的时候更新 /// 先更新住院日报,如果没有找到数据则找昨天日报中的期末数和固定床位数,插入一条新数据 /// </summary> /// <returns></returns> public int DynamicUpdate(Neusoft.HISFC.Models.HealthRecord.InpatientDayReport dayReport) { try { int parm; //更新住院日报 parm = this.UpdateInpatientDayReport(dayReport); //如果没有找到当天数据,说明是本日第一次更新,则取昨日日报的期末数作为今日期初数和固定床位数等数据插入数据库 if (parm == 0) { //取昨日住院日报的期末数 Neusoft.HISFC.Models.HealthRecord.InpatientDayReport lastReport = this.GetInpatientDayReport(dayReport.DateStat.AddDays(-1), dayReport.ID, dayReport.NurseStation.ID); if (lastReport == null) { return(-1); } //如果没有找到昨天的数据则认为昨日期末数为0 if (lastReport.ID == "") { lastReport.EndNum = GetDeptPatientNum(dayReport.ID, dayReport.NurseStation.ID); } //今天期初数=昨日期末数 dayReport.BeginningNum = lastReport.EndNum; //今天期末数=今日期末数 + 昨日期末数(今日期初数) dayReport.EndNum = dayReport.EndNum + lastReport.EndNum; //取固定床位数 Neusoft.HISFC.Models.Base.ExtendInfo deptExt = managerExtendParam.GetComExtInfo(Neusoft.HISFC.Models.Base.EnumExtendClass.DEPT, "CASE_BED_STAND", dayReport.ID); if (deptExt == null) { return(-1); } dayReport.BedStand = Convert.ToInt32(deptExt.NumberProperty); //插入住院日报表中一条新记录 parm = this.InsertDayReportDetail(dayReport); } if (parm == -1) { return(parm); } //调用日报明细插入函数 return(this.SetDayReportDetail(dayReport)); //return parm; } catch (Exception ex) { this.Err = ex.Message; return(-1); } }
private void SetDepartmentExt(int a) { this.myExtendInfo = new Neusoft.HISFC.Models.Base.ExtendInfo(); this.myExtendInfo.ExtendClass = Neusoft.HISFC.Models.Base.EnumExtendClass.DEPT; this.myExtendInfo.Item.ID = this.fpSpread1_Sheet1.Cells[a, 0].Text; this.myExtendInfo.PropertyCode = "CASE_BED_STAND"; this.myExtendInfo.PropertyName = this.fpSpread1_Sheet1.Cells[a, 1].Text; this.myExtendInfo.NumberProperty = Neusoft.FrameWork.Function.NConvert.ToInt32(this.fpSpread1_Sheet1.Cells[a, 5].Value); this.myExtendInfo.Memo = this.fpSpread1_Sheet1.Cells[a, 7].Text; }
/// <summary> /// 取项目的字符属性 /// </summary> /// <param name="PropertyCode">属性类别</param> /// <param name="ItemCode">项目编码</param> /// <returns>字符属性</returns> public string GetComExtInfoString(Neusoft.HISFC.Models.Base.EnumExtendClass enuExtendClass, string PropertyCode, string ItemCode) { //取项目扩展属性实体 Neusoft.HISFC.Models.Base.ExtendInfo ext = this.GetComExtInfo(enuExtendClass, PropertyCode, ItemCode); if (ext == null) { return(""); } else { return(ext.StringProperty); } }
/// <summary> /// 取项目的数值属性 /// </summary> /// <param name="PropertyCode">属性类别</param> /// <param name="ItemCode">项目编码</param> /// <returns>数值属性</returns> public decimal GetComExtInfoNumber(Neusoft.HISFC.Models.Base.EnumExtendClass enuExtendClass, string PropertyCode, string ItemCode) { //取项目项目的扩展属性实体 Neusoft.HISFC.Models.Base.ExtendInfo ext = this.GetComExtInfo(enuExtendClass, PropertyCode, ItemCode); if (ext == null) { return(0M); } else { return(ext.NumberProperty); } }
/// <summary> /// 取项目的日期属性 /// </summary> /// <param name="PropertyCode">属性类别</param> /// <param name="ItemCode">项目编码</param> /// <returns>日期属性</returns> public DateTime GetComExtInfoDateTime(Neusoft.HISFC.Models.Base.EnumExtendClass enuExtendClass, string PropertyCode, string ItemCode) { //取项目扩展属性实体 Neusoft.HISFC.Models.Base.ExtendInfo ext = this.GetComExtInfo(enuExtendClass, PropertyCode, ItemCode); if (ext == null) { return(DateTime.MinValue); } else { return(ext.DateProperty); } }
/// <summary> /// 获得update或者insert项目属性表的传入参数数组 /// </summary> /// <param name="extendInfo"></param> /// <returns></returns> private string[] myGetParmComExtInfo(Neusoft.HISFC.Models.Base.ExtendInfo extendInfo) { string[] strParm = { extendInfo.ExtendClass.ToString(), extendInfo.Item.ID, //0 项目编码 extendInfo.PropertyCode.ToString(), //1 属性编码 extendInfo.PropertyName.ToString(), //2 属性名称 extendInfo.StringProperty.ToString(), //3 字符属性 extendInfo.NumberProperty.ToString(), //4 数值属性 extendInfo.DateProperty.ToString(), //5 日期属性 extendInfo.Memo.ToString(), //6 备注 this.Operator.ID, //7 操作员编码 }; return(strParm); }
/// <summary> /// 保存项目扩展属性数据--先执行更新操作,如果没有找到可以更新的数据,则插入一条新记录 /// </summary> /// <param name="extendInfo"></param> /// <returns></returns> public int SetComExtInfo(Neusoft.HISFC.Models.Base.ExtendInfo extendInfo) { int parm; //执行更新操作 parm = UpdateComExtInfo(extendInfo); //如果没有找到可以更新的数据,则插入一条新记录 if (parm == 0) { parm = InsertComExtInfo(extendInfo); } return(parm); }
/// <summary> /// 初始化配药调剂方式 0 平均 1 竞争 /// </summary> public void ShowAdjustType( ) { //Neusoft.HISFC.BizLogic.Manager.Controler controlerManager = new Neusoft.HISFC.BizLogic.Manager.Controler( ); //string ctrl = controlerManager.QueryControlerInfo( "500006" ); //if( ctrl == null || ctrl == "-1" || ctrl == "0" ) //{ // this.rbAverage.Checked = true; // this.adjustType = "0"; //} //else //{ // this.rbCompete.Checked = true; // this.adjustType = "1"; //} Neusoft.FrameWork.Management.ExtendParam extManager = new ExtendParam(); Neusoft.HISFC.Models.Base.ExtendInfo deptExt = extManager.GetComExtInfo(Neusoft.HISFC.Models.Base.EnumExtendClass.DEPT, "TerminalAdjust", this.privDept.ID); if (deptExt == null) { MessageBox.Show(Language.Msg("获取科室扩展属性内配药调剂参数失败!")); return; } if (deptExt.StringProperty == "1") //竞争 { this.rbCompete.Checked = true; } else { this.rbAverage.Checked = true; } deptExt = extManager.GetComExtInfo(Neusoft.HISFC.Models.Base.EnumExtendClass.DEPT, "AdjustGist", this.privDept.ID); if (deptExt == null) { MessageBox.Show(Language.Msg("获取科室扩展属性内配药调剂依据设定失败!")); return; } if (deptExt.StringProperty == "1") //发药 { this.rbSend.Checked = true; } else { this.rbDrug.Checked = true; } }
/// <summary> /// 取项目属性信息列表,可能是一条或者多条项目扩展属性 /// 私有方法,在其他方法中调用 /// writed by cuipeng /// 2005-1 /// </summary> /// <param name="SQLString">SQL语句</param> /// <returns>项目属性信息对象数组</returns> private ArrayList myGetComExtInfo(string SQLString) { ArrayList al = new ArrayList(); Neusoft.HISFC.Models.Base.ExtendInfo extendInfo; //项目属性信息实体 this.ProgressBarText = "正在检索项目属性单信息..."; this.ProgressBarValue = 0; //执行查询语句 if (this.ExecQuery(SQLString) == -1) { this.Err = "获得项目属性信息时,执行SQL语句出错!" + this.Err; this.ErrCode = "-1"; return(null); } try { while (this.Reader.Read()) { //取查询结果中的记录 extendInfo = new Neusoft.HISFC.Models.Base.ExtendInfo(); //extendInfo.ExtendClass = (Neusoft.HISFC.Models.Base.EnumExtendClass)this.Reader[0]; //0 项目编码 extendInfo.ExtendClass = (Neusoft.HISFC.Models.Base.EnumExtendClass)System.Enum.Parse(typeof(Neusoft.HISFC.Models.Base.EnumExtendClass), this.Reader[0].ToString()); extendInfo.Item.ID = this.Reader[1].ToString(); //0 项目编码 extendInfo.PropertyCode = this.Reader[2].ToString(); //2 属性编码 extendInfo.PropertyName = this.Reader[3].ToString(); //3 属性名称 extendInfo.StringProperty = this.Reader[4].ToString(); //4 字符属性 extendInfo.NumberProperty = NConvert.ToDecimal(this.Reader[5].ToString()); //5 数值属性 extendInfo.DateProperty = NConvert.ToDateTime(this.Reader[6].ToString()); //6 日期属性 extendInfo.Memo = this.Reader[7].ToString(); //7 备注 extendInfo.OperEnvironment.ID = this.Reader[8].ToString(); //8 操作日期 extendInfo.OperEnvironment.Memo = (this.Reader[9].ToString()); //9 操作时间 this.ProgressBarValue++; al.Add(extendInfo); } } //抛出错误 catch (Exception ex) { this.Err = "获得项目属性信息时出错!" + ex.Message; this.ErrCode = "-1"; return(null); } this.Reader.Close(); this.ProgressBarValue = -1; return(al); }
private void GetDepartmentExt() { this.alDepartExt = this.myDeptExt.GetComExtInfoList(Neusoft.HISFC.Models.Base.EnumExtendClass.DEPT, "CASE_BED_STAND"); Neusoft.HISFC.Models.Base.ExtendInfo departmentExt = new Neusoft.HISFC.Models.Base.ExtendInfo(); for (int i = 0; i < this.alDepartExt.Count; i++) { departmentExt = this.alDepartExt[i] as Neusoft.HISFC.Models.Base.ExtendInfo; this.htDepartment.Add(departmentExt.Item.ID, departmentExt.Item.ID); DataRow row = this.dtDepartmentExt.NewRow(); row["科室编码"] = departmentExt.Item.ID; row["科室名称"] = departmentExt.PropertyName; row["属性编码"] = "CASE_BED_STAND"; row["属性名称"] = "床位数"; row["床位数"] = departmentExt.NumberProperty; row["操作人"] = departmentExt.OperEnvironment.ID; row["操作时间"] = Neusoft.FrameWork.Function.NConvert.ToDateTime(departmentExt.OperEnvironment.Memo); this.dtDepartmentExt.Rows.Add(row); } }
/// <summary> /// 更新项目属性表中一条记录 /// </summary> /// <param name="extendInfo">项目扩展属性类</param> /// <returns>0没有更新 1成功 -1失败</returns> public int UpdateComExtInfo(Neusoft.HISFC.Models.Base.ExtendInfo extendInfo) { string strSQL = ""; //取更新操作的SQL语句 if (this.Sql.GetSql("Manager.ComExtInfo.UpdateComExtInfo", ref strSQL) == -1) { this.Err = "没有找到Manager.ComExtInfo.UpdateComExtInfo字段!"; return(-1); } try { string[] strParm = myGetParmComExtInfo(extendInfo); //取参数列表 strSQL = string.Format(strSQL, strParm); //替换SQL语句中的参数。 } catch (Exception ex) { this.Err = "格式化SQL语句时出错Manager.ComExtInfo.UpdateComExtInfo:" + ex.Message; this.WriteErr(); return(-1); } return(this.ExecNoQuery(strSQL)); }
/// <summary> /// 更新调剂方式 /// </summary> /// <param name="controlerManager"></param> /// <returns></returns> private bool SaveAdjustParam(Neusoft.FrameWork.Management.ExtendParam extManager) { #region 保存调剂方式 Neusoft.HISFC.Models.Base.ExtendInfo extAdjustType = extManager.GetComExtInfo(Neusoft.HISFC.Models.Base.EnumExtendClass.DEPT, "TerminalAdjust", this.privDept.ID); if (extAdjustType == null) { MessageBox.Show(Language.Msg("获取科室扩展属性内配药调剂参数失败!")); return(false); } if (extAdjustType.Item.ID == "") { #region 无此参数 初次插入 extAdjustType.Item.ID = this.privDept.ID; extAdjustType.StringProperty = this.rbAverage.Checked ? "0" : "1";; extAdjustType.PropertyCode = "TerminalAdjust"; extAdjustType.PropertyName = "门诊配药终端调剂方式0平均 1竞争"; if (extManager.SetComExtInfo(extAdjustType) == -1) { MessageBox.Show(Language.Msg("更新科室扩展属性内配药终端调剂方式失败!")); return(false); } #endregion } else { extAdjustType.Item.ID = this.privDept.ID; extAdjustType.StringProperty = this.rbAverage.Checked ? "0" : "1";; extAdjustType.PropertyCode = "TerminalAdjust"; extAdjustType.PropertyName = "门诊配药终端调剂方式0平均 1竞争"; if (extManager.SetComExtInfo(extAdjustType) == -1) { MessageBox.Show(Language.Msg("更新科室扩展属性内配药终端调剂方式失败!")); return(false); } } #endregion #region 保存调剂依据 Neusoft.HISFC.Models.Base.ExtendInfo extAdjustGist = extManager.GetComExtInfo(Neusoft.HISFC.Models.Base.EnumExtendClass.DEPT, "AdjustGist", this.privDept.ID); if (extAdjustGist == null) { MessageBox.Show(Language.Msg("获取科室扩展属性内配药调剂依据失败!")); return(false); } if (extAdjustGist.Item.ID == "") { #region 无此参数 初次插入 extAdjustGist.Item.ID = this.privDept.ID; extAdjustGist.StringProperty = this.rbDrug.Checked ? "0" : "1";; extAdjustGist.PropertyCode = "AdjustGist"; extAdjustGist.PropertyName = "门诊配药终端调剂依据 1 发药 0 配药"; if (extManager.SetComExtInfo(extAdjustGist) == -1) { MessageBox.Show("更新科室扩展属性内配药终端调剂依据失败!"); return(false); } #endregion } else { extAdjustGist.Item.ID = this.privDept.ID; extAdjustGist.StringProperty = this.rbDrug.Checked ? "0" : "1";; extAdjustGist.PropertyCode = "AdjustGist"; extAdjustGist.PropertyName = "门诊配药终端调剂依据 1 发药 0 配药"; if (extManager.SetComExtInfo(extAdjustGist) == -1) { MessageBox.Show("更新科室扩展属性内配药终端调剂依据失败!"); return(false); } } #endregion return(true); #region 屏蔽原保存方式 ////判断调剂方式是否变化,没有变化返回 //bool isChange = false; //if( ( this.adjustType == "0" ) && this.rbCompete.Checked ) //{ // isChange = true; //} //if( ( this.adjustType == "1" ) && this.rbAverage.Checked ) //{ // isChange = true; //} //if( isChange ) //{ // Neusoft.HISFC.Models.Base.Controler controler = new Neusoft.HISFC.Models.Base.Controler( ); // controler.ID = "500006"; // controler.Name = "配药调剂方式 0 平均 1 竞争"; // controler.ControlerValue = this.rbAverage.Checked ? "0" : "1"; // controler.VisibleFlag = true; // int parm = controlerManager.UpdateControlerInfo( controler ); // if( parm == -1 ) // { // MessageBox.Show( Language.Msg("更新配药调剂方式出错") + controlerManager.Err ); // return false; // } // else if( parm == 0 ) // { // if( controlerManager.AddControlerInfo( controler ) == -1 ) // { // MessageBox.Show( Language.Msg("更新配药调剂方式出错") + controlerManager.Err ); // return false; // } // } //} //return true; #endregion }
/// <summary> /// 初始化 /// </summary> public virtual void Init() { Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm(Neusoft.FrameWork.Management.Language.Msg("正在加载单据打印基础数据...")); Application.DoEvents(); #region 获取常数信息 用于界面数据显示 //获得所有频次信息 Neusoft.HISFC.BizLogic.Manager.Frequency frequencyManagement = new Neusoft.HISFC.BizLogic.Manager.Frequency(); ArrayList alFrequency = frequencyManagement.GetAll("Root"); this.frequencyHelper = new Neusoft.FrameWork.Public.ObjectHelper(alFrequency); //获取所用用法 Neusoft.HISFC.BizLogic.Manager.Constant c = new Neusoft.HISFC.BizLogic.Manager.Constant(); ArrayList alUsage = c.GetList(Neusoft.HISFC.Models.Base.EnumConstant.USAGE); if (alUsage == null) { MessageBox.Show("获取用法列表出错!"); return; } this.usageHelper = new Neusoft.FrameWork.Public.ObjectHelper(alUsage); Neusoft.HISFC.BizProcess.Integrate.Manager managerIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Manager(); //获取所有人员 ArrayList alEmployee = managerIntegrate.QueryEmployeeAll(); this.personHelper = new Neusoft.FrameWork.Public.ObjectHelper(alEmployee); //获取所有科室 ArrayList alDept = managerIntegrate.GetDepartment(); this.deptHelper = new Neusoft.FrameWork.Public.ObjectHelper(alDept); //获取所有门诊终端 Neusoft.HISFC.BizLogic.Pharmacy.DrugStore drugStoreManager = new Neusoft.HISFC.BizLogic.Pharmacy.DrugStore(); ArrayList alDruged = drugStoreManager.QueryDrugTerminalByDeptCode(this.OperDept.ID, "0"); ArrayList alSend = drugStoreManager.QueryDrugTerminalByDeptCode(this.OperDept.ID, "1"); alDruged.AddRange(alSend); this.terminalHelper = new Neusoft.FrameWork.Public.ObjectHelper(alDruged); #endregion #region 获取控制参数信息 用于控制调剂参数更新方式 Neusoft.FrameWork.Management.ExtendParam extManager = new Neusoft.FrameWork.Management.ExtendParam(); try { Neusoft.HISFC.Models.Base.ExtendInfo deptExt = extManager.GetComExtInfo(Neusoft.HISFC.Models.Base.EnumExtendClass.DEPT, "AdjustGist", this.OperDept.ID); if (deptExt == null) { MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("获取科室扩展属性内配药调剂参数失败!")); } if (deptExt.StringProperty == "1") //发药 { this.isAdjustInDrug = false; } else { this.isAdjustInDrug = true; //配药 } } catch { } #endregion Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); this.IntiControlParam(); }