public string GetRuleSequence() { Neusoft.FrameWork.Management.DataBaseManger manager = new Neusoft.FrameWork.Management.DataBaseManger(); this.SetDB(manager); return(manager.GetSequence("EPR.CaseWriteRule.GetRuleCodeSequence")); }
public void Init() { try { //取系统日期 Neusoft.FrameWork.Management.DataBaseManger dataBase = new Neusoft.FrameWork.Management.DataBaseManger(); string sysDate = dataBase.GetSysDate(); this.dtpBeginDate.Value = DateTime.Parse(sysDate + " 00:00:00"); //起始日期 this.dtpEndDate.Value = DateTime.Parse(sysDate + " 23:59:59"); //结束日期 if (this.myIsOneDate) { //用户只可以选择一个日期的时候 this.lblBeginDate.Text = "日期:"; //不显示终止日期 this.lblEndDate.Visible = false; this.dtpEndDate.Visible = false; } else { //用户只可以选择起始日期和终止日期的时候 this.lblBeginDate.Text = "起始日期:"; //不显示终止日期 this.lblEndDate.Visible = true; this.dtpEndDate.Visible = true; } } catch {} }
/// <summary> /// 医院名称获取 /// </summary> /// <returns>成功返回医院名称 失败返回空字符串</returns> public static string GetHosName() { if (HosName == "-1") { Neusoft.FrameWork.Management.DataBaseManger dataBase = new Neusoft.FrameWork.Management.DataBaseManger(); if (dataBase.ExecQuery(Function.hosNameSelect) == -1) { return(HosCode); } try { if (dataBase.Reader.Read()) { HosName = dataBase.Reader[0].ToString(); HosCode = dataBase.Reader[1].ToString(); HosMemo = dataBase.Reader[2].ToString(); } } catch (Exception ex) { return(""); } finally { if (!dataBase.Reader.IsClosed) { dataBase.Reader.Close(); } } } return(HosName); }
/// <summary> /// 初始化 /// </summary> private void Init() { this.ImageList = this.imageList1; this.HideSelection = false; try { if (this.IsShowContextMenu == true)//显示属性 { // 加入右键菜单 by zlw 2006-5-1 System.Windows.Forms.ContextMenu cmPatientPro = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem miPatientPro = new System.Windows.Forms.MenuItem(); cmPatientPro.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { miPatientPro }); miPatientPro.Text = "查看患者信息"; this.ContextMenu = cmPatientPro; miPatientPro.Click += new System.EventHandler(this.miPatientPro_Click); } Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger(); this.dtToday = dataManager.GetDateTimeFromSysDateTime(); } catch { this.dtToday = DateTime.Today; } }
/// <summary> /// {01938238-FE86-4e62-A1CC-037D0DAB8587} /// 获取年龄函数 /// </summary> /// <param name="birthday"></param> public static string GetAge(DateTime birthday) { string ageStr = ""; if (birthday == DateTime.MinValue) { return(""); } Neusoft.FrameWork.Management.DataBaseManger dataBase = new Neusoft.FrameWork.Management.DataBaseManger(); DateTime current = dataBase.GetDateTimeFromSysDateTime(); TimeSpan age = current - birthday; if (age.Ticks < 0) { return(""); } int totMonth = (current.Year - birthday.Year) * 12 + (current.Month - birthday.Month); if (age.Days <= 90) { ageStr = age.Days.ToString() + "天"; } else if (totMonth > 0 && totMonth < 24) { ageStr = totMonth.ToString() + "月"; } else { ageStr = (current.Year - birthday.Year).ToString() + "岁"; } return(ageStr); }
/// <summary> /// 初始化 /// </summary> public void Init() { Neusoft.FrameWork.Management.DataBaseManger dataBaseManager = new Neusoft.FrameWork.Management.DataBaseManger(); if (this.isOtherDrugDept) { Neusoft.HISFC.BizProcess.Integrate.Manager integrateManager = new Neusoft.HISFC.BizProcess.Integrate.Manager(); System.Collections.ArrayList al = integrateManager.GetDepartment(Neusoft.HISFC.Models.Base.EnumDepartmentType.P); Neusoft.FrameWork.Models.NeuObject info = new Neusoft.FrameWork.Models.NeuObject(); if (Neusoft.FrameWork.WinForms.Classes.Function.ChooseItem(al, ref info) == 0) { return; } else { this.OperDept = info; } } else { this.OperDept = ((Neusoft.HISFC.Models.Base.Employee)dataBaseManager.Operator).Dept; } this.OperInfo = dataBaseManager.Operator; this.ApproveDept = ((Neusoft.HISFC.Models.Base.Employee)dataBaseManager.Operator).Dept; if (this.InitTerminal() == -1) { return; } this.InitControlParm(); }
/// <summary> /// 把在线的表和历史表的对照信息载入到静态ArrayList表当中 /// </summary> /// <returns>0 成功 -1失败</returns> private static int initTableList() { try { //定义一个新的ArrayList alTables = new ArrayList(); //查找COM_TABLELIST Neusoft.FrameWork.Management.DataBaseManger manager = new Neusoft.FrameWork.Management.DataBaseManger(); if (manager.ExecQuery("select tablename,historytablename,memo from com_tablelist where historytablename is not null") == -1) { return(-1); } while (manager.Reader.Read()) //读数据 { Neusoft.FrameWork.Models.NeuObject obj = new Neusoft.FrameWork.Models.NeuObject(); obj.ID = manager.Reader[0].ToString(); obj.Name = manager.Reader[1].ToString(); obj.Memo = manager.Reader[2].ToString(); alTables.Add(obj); } manager.Reader.Close(); } catch //无聊的错误 { return(-1); } return(0); }
/// <summary> /// 打印 /// </summary> /// <param name="alList">需打印函数</param> public void PrintDrugConsume(System.Collections.ArrayList alData) { if (IPrintConsume == null) { if (InitConsumePrintInterface() == -1) { return; } } Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger(); Neusoft.FrameWork.Models.NeuObject dept = ((Neusoft.HISFC.Models.Base.Employee)dataManager.Operator).Dept; Neusoft.HISFC.Models.Base.OperEnvironment oper = new Neusoft.HISFC.Models.Base.OperEnvironment(); oper.ID = dataManager.Operator.ID; oper.Name = dataManager.Operator.Name; SortStockDept sort = new SortStockDept(); alData.Sort(sort); IPrintConsume.SetTitle(oper, dept); IPrintConsume.SetExecOrder(alData); IPrintConsume.Print(); }
/// <summary> /// 检索程序中需要的列表 /// </summary> /// <param name="sqlIndex">检索的SQL语句在XML中的索引数组 第一位为select索引 其他为where索引</param> /// <param name="filterField">用于对该列表进行检索的字段,由sql语句检索的数据内选择</param> /// <param name="formatStr">对sql语句进行格式化的数据</param> public void ShowInfoList(string[] sqlIndex, string[] filterField, params string[] formatStr) { Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在检索数据 请稍候....."); Application.DoEvents(); try { this.DataAutoCellType = false; this.DataAutoHeading = false; this.DataAutoWidth = false; Neusoft.FrameWork.Management.DataBaseManger databaseManager = new Neusoft.FrameWork.Management.DataBaseManger(); DataSet dataSet = new DataSet(); databaseManager.ExecQuery(sqlIndex, ref dataSet, formatStr); if (dataSet == null) { MessageBox.Show("检索列表数据发生错误\n" + databaseManager.Err); return; } if (dataSet.Tables != null && dataSet.Tables.Count > 0) { this.DataTable = dataSet.Tables[0]; } this.FilterField = filterField; } catch (Exception ex) { MessageBox.Show("检索列表数据发生错误\n" + ex.Message); } finally { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); } }
/// <summary> /// 床位校验 /// </summary> /// <returns>True 校验通过 False 校验失败</returns> internal static bool BedVerify() { if (LicenceBedQty != -1) { Neusoft.FrameWork.Management.DataBaseManger dataBase = new Neusoft.FrameWork.Management.DataBaseManger(); string bedNumSql = @"select count(*) from com_bedinfo"; decimal bedQty = -1; try { bedQty = Neusoft.FrameWork.Function.NConvert.ToDecimal(dataBase.ExecSqlReturnOne(bedNumSql)); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } if (LicenceBedQty < bedQty) { MessageBox.Show("维护总床位数已超过系统授权限制,请与供应商联系 \n\n授权床位数:" + LicenceBedQty.ToString() + " 当前床位数:" + bedQty.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return(false); } } return(true); }
/// <summary> /// 检索程序中需要的列表 /// </summary> /// <param name="sqlIndex">检索的SQL语句在XML中的索引数组 第一位为select索引 其他为where索引</param> /// <param name="filterField">用于对该列表进行检索的字段,由sql语句检索的数据内选择</param> /// <param name="formatStr">对sql语句进行格式化的数据</param> public void ShowInfoList(string[] sqlIndex, string[] filterField, params string[] formatStr) { Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在检索数据 请稍候....."); Application.DoEvents(); try { this.FarPointReset(); this.DataAutoCellType = false; this.DataAutoHeading = false; this.DataAutoWidth = false; //{1DED4697-A590-47b3-B727-92A4AA05D2ED} 设置列表显示时数据锁定 this.neuSpread1_Sheet1.DefaultStyle.Locked = true; Neusoft.FrameWork.Management.DataBaseManger databaseManager = new Neusoft.FrameWork.Management.DataBaseManger(); DataSet dataSet = new DataSet(); databaseManager.ExecQuery(sqlIndex, ref dataSet, formatStr); if (dataSet == null) { MessageBox.Show("检索列表数据发生错误\n" + databaseManager.Err); return; } this.DataTable = dataSet.Tables[0]; this.FilterField = filterField; } catch (Exception ex) { MessageBox.Show("检索列表数据发生错误\n" + ex.Message); } finally { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); } }
/// <summary> /// 获得 /// </summary> /// <param name="id"></param> /// <returns></returns> public virtual string GetSetting(string id) { string sql = "select xml from emr_setting where id='{0}'"; sql = string.Format(sql, id); Neusoft.FrameWork.Management.DataBaseManger manager = new Neusoft.FrameWork.Management.DataBaseManger(); this.SetDB(manager); return(manager.ExecSqlReturnOne(sql)); }
/// <summary> /// HIS系统监视函数 /// </summary> /// <param name="employee">登陆人员信息</param> /// <returns>无错误返回1 出错返回-1</returns> public static int HISMonitor() { #region 版本登陆 //JudgeVersionNumber(); #endregion #region 自动运行 //{5BE03DF2-25DE-4e7a-9B47-85CE92911277} 修改原接口获取方式 try { if (hsNoticeInterface == null) { CreateNoticeInterfaceCollection(); } if (hsNoticeInterface != null) { foreach (Neusoft.HISFC.BizProcess.Interface.Common.INoticeManager noticeInterface in hsNoticeInterface.Values) { if (noticeInterface != null) { noticeInterface.Notice(); noticeInterface.Warn(); noticeInterface.Schedule(); } } } } catch { return(-1); } #endregion #region 提示信息 ShowNotice(); #endregion #region 操作员登陆Log Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger(); Neusoft.HISFC.Models.Base.Employee oper = (Neusoft.HISFC.Models.Base.Employee)dataManager.Operator; SaveLoginInfo(oper); NoteLog(oper, true, true, true, 1024); #endregion return(1); }
///// <summary> ///// 刷新 ///// </summary> //public new void Refresh() //{ // this.BeginUpdate(); // this.Nodes.Clear(); // if (manager == null) // manager = new Neusoft.HISFC.BizLogic.Registration.Register(); // ArrayList al = new ArrayList();//患者列表 // //节点说明: 本区患者\待接诊患者\转入患者\转出患者\出院登记患者 // //显示本护理站在院的患者 // al.Add("本区患者|" + EnumPatientType.In.ToString()); // addPatientList(al, Neusoft.HISFC.Models.Base.EnumInState.I, EnumPatientType.In); // //显示本护理站待接珍患者 // al.Add("待接诊患者|" + EnumPatientType.Arrive.ToString()); // addPatientList(al, Neusoft.HISFC.Models.Base.EnumInState.R, EnumPatientType.Arrive); // ////显示转入本护理站待接珍患者 // //al.Add("转入患者|" + EnumPatientType.ShiftIn.ToString()); // //addPatientList(al, Neusoft.HISFC.Models.Base.EnumInState.I, EnumPatientType.ShiftIn); // ////显示本护理站转科申请的患者 // //al.Add("转出患者|" + EnumPatientType.ShiftOut.ToString()); // //addPatientList(al, Neusoft.HISFC.Models.Base.EnumInState.I, EnumPatientType.ShiftOut); // //显示本护理站出院登记的患者 // al.Add("留观结束患者|" + EnumPatientType.Out.ToString()); // addPatientList(al, Neusoft.HISFC.Models.Base.EnumInState.B, EnumPatientType.Out); // //显示所有患者列表 // this.SetPatient(al); // this.EndUpdate(); //} /// <summary> /// 根据病区站得到患者 /// </summary> /// <param name="al"></param> private void addPatientList(ArrayList al, Neusoft.HISFC.Models.Base.EnumInState Status, EnumPatientType patientType) { ArrayList al1 = new ArrayList(); Neusoft.HISFC.Models.Base.Employee employee = Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee; Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger(); if (employee == null) { return; } if (patientType == EnumPatientType.In) //本区在院患者 { al1 = this.registerManager.PatientQueryByNurseCell(employee.Dept.ID, Status.ToString()); if (al1 != null) { al.AddRange(al1); } } else { ArrayList alDept = this.GetDepts(employee.Dept.ID); foreach (Neusoft.FrameWork.Models.NeuObject objDept in alDept) { //{1C0814FA-899B-419a-94D1-789CCC2BA8FF} if (patientType == EnumPatientType.Arrive || patientType == EnumPatientType.PreOut || patientType == EnumPatientType.In || patientType == EnumPatientType.PreIn) { al1 = this.manager.QueryPatient(objDept.ID, Status.ToString()); //按科室接珍 } else if (patientType == EnumPatientType.ShiftOut) { // al1 = this.registerManager.QueryPatientShiftOutApply(objDept.ID, "1"); //按科室查转出申请的 } else if (patientType == EnumPatientType.ShiftIn) { //al1 = this.registerManager.QueryPatientShiftInApply(objDept.ID, "1"); //按科室查转入申请的 } else if (patientType == EnumPatientType.Out) { DateTime dtNow = dataManager.GetDateTimeFromSysDateTime(); string strFromDate = dtNow.AddDays(-allowCallBackDays).ToShortDateString() + " 00:00:00"; al1 = this.manager.QueryPatient(objDept.ID.ToString(), Status.ToString(), strFromDate, dtNow.ToString()); //按科室查出院登记的 } if (al1 != null) { al.AddRange(al1); } } } }
/// <summary> /// 保存 /// </summary> /// <param name="obj"></param> /// <param name="xml"></param> /// <returns></returns> public virtual int SaveSetting(Neusoft.FrameWork.Models.NeuObject obj, string xml) { string sqlInsert = "INSERT INTO emr_setting (id,name,memo) VALUES('{0}','{1}','{2}') "; string sqlDelete = "delete emr_setting where id='{0}'"; string update = string.Format("update emr_setting set xml=:a where id='{0}'", obj.ID); Neusoft.FrameWork.Management.DataBaseManger manager = new Neusoft.FrameWork.Management.DataBaseManger(); this.SetDB(manager); manager.ExecNoQuery(sqlDelete, obj.ID); manager.ExecNoQuery(sqlInsert, obj.ID, obj.Name, obj.Memo); return(manager.InputLong(update, xml)); }
public void SetTitle(Neusoft.HISFC.Models.Base.OperEnvironment oper, Neusoft.FrameWork.Models.NeuObject dept) { if (oper.OperTime == System.DateTime.MinValue) { Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger(); oper.OperTime = dataManager.GetDateTimeFromSysDateTime(); } this.lbTitl.Text = dept.Name + "领药单"; this.lbPrintTime.Text = "打印时间:" + oper.OperTime.ToString(); }
/// <summary> /// 数据检索初始化 /// </summary> /// <returns>成功返回1 失败返回-1</returns> public int Init() { this.neuSpread1_Sheet1.DataAutoSizeColumns = false; #region 获取数据 Neusoft.FrameWork.Management.DataBaseManger dataBaseMgr = new Neusoft.FrameWork.Management.DataBaseManger(); if (dsPhaData == null) { dsPhaData = new DataSet(); } #region 获取查询Sql索引 string[] strIndex; string[] strParam = null; if (drugDept == null || drugDept.ID == "") { if (drugType == "ALL") { strIndex = new string[] { "Pharmacy.Item.Info" }; strParam = new string[] { }; } else { strIndex = new string[] { "Pharmacy.Item.Info", "Preparation.Item.GetList.QueryByType" }; strParam = new string[] { drugType }; } } else { strIndex = new string[] { "Pharmacy.Item.Info", "Pharmacy.Item.GetAvailableList.Inpatient.ByDrugType" }; strParam = new string[] { drugDept.ID, drugType }; } #endregion if (dataBaseMgr.ExecQuery(strIndex, ref dsPhaData, strParam) == -1) { MessageBox.Show("读取药品信息时发生错误 \n" + dataBaseMgr.Err); return(-1); } if (dsPhaData.Tables.Count > 0) { this.dvPhaData = new DataView(this.dsPhaData.Tables[0]); this.neuSpread1_Sheet1.DataSource = dvPhaData; Neusoft.FrameWork.WinForms.Classes.CustomerFp.ReadColumnFormatProperty(this.neuSpread1_Sheet1, this.FilePath); } #endregion return(1); }
protected void Init() { var = (Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator; if (this.ucNotice1 != null) { this.ucNotice1.Oper = var; } //定义时间段默认显示区间,取系统日期 Neusoft.FrameWork.Management.DataBaseManger dataBase = new Neusoft.FrameWork.Management.DataBaseManger(); this.myEndTime = this.noticeManager.GetDateTimeFromSysDateTime(); this.myBeginTime = this.myEndTime.AddDays(-30); }
/// <summary> /// 进度条开始运行 /// </summary> /// <param name="b"></param> protected void ProgressRun(bool b) { this.timer1.Enabled = b; try { if (dataManager == null) { dataManager = new Neusoft.FrameWork.Management.DataBaseManger(); } dt = dataManager.GetDateTimeFromSysDateTime(); } catch {} }
/// <summary> /// 显示库存物品列表 /// </summary> /// <param name="deptCode">库房编码</param> /// <param name="isDetail">是否查询明细</param> public virtual void ShowDeptStorage(string deptCode, bool isDetail) { Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在检索库存物品信息..."); Application.DoEvents(); try { Neusoft.FrameWork.Management.DataBaseManger databaseManager = new Neusoft.FrameWork.Management.DataBaseManger(); DataSet dataSet = new DataSet(); string sqlIndex; if (isDetail) { sqlIndex = "Material.Item.GetStorageListByPrice"; } else { sqlIndex = "Material.Item.GetStorageListNoPrice"; } databaseManager.ExecQuery(sqlIndex, ref dataSet, deptCode); if (dataSet == null) { MessageBox.Show("检索列表数据发生错误\n" + databaseManager.Err); return; } this.filterField = new string[4] { "SPELL_CODE", "WB_CODE", "CUSTOM_CODE", "ITEM_NAME" }; if (dataSet.Tables != null && dataSet.Tables.Count > 0) { this.DataTable = dataSet.Tables[0]; } //使用控件默认的显示格式 if (isDetail) { this.SetFormatForStorageDetail(); } else { this.SetFormatForStorage(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); } }
/// <summary> /// Licence 判断 /// </summary> /// <returns>成功进行返回1 失败返回-1</returns> private static int JudgeHISCryptoKeyFile(ref string strErr) { //去掉DATABASE_FLAG 字段 string sql = "SELECT HOS_NAME,NUMBER_VALUE from com_departinfo"; Neusoft.FrameWork.Management.DataBaseManger dataBase = new Neusoft.FrameWork.Management.DataBaseManger(); if (dataBase.ExecQuery(sql) == -1) { MessageBox.Show(dataBase.Err); return(-1); } try { if (dataBase.Reader.Read()) { HosName = dataBase.Reader[0].ToString(); maxLocalLogFileSize = Neusoft.FrameWork.Function.NConvert.ToInt32(dataBase.Reader[1]); ////{5313B8E5-709F-4741-A6E3-2186702DAC6C} 2013.02.20 modified by xipeter //IsTestDB = Neusoft.FrameWork.Function.NConvert.ToBoolean(dataBase.Reader[2].ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return(-1); } finally { dataBase.Reader.Close(); } DateTime sysTime = dataBase.GetDateTimeFromSysDateTime(); string displayHosName = ""; string licenceInformation = ""; //int result = Neusoft.HisCrypto.Function.Licence(HosName, sysTime, out displayHosName, ref strErr); ////int result = Neusoft.HisCrypto.Function.Licence( HosName, sysTime, out displayHosName,out licenceInformation, ref strErr ); //HosName = displayHosName; int result = 1; if (result == 1) { return(1); } return(-1); }
private void ucReportBase_Load(object sender, EventArgs e) { try { this.neuSpread1_Sheet1.SetColumnAllowAutoSort(-1, true); Neusoft.FrameWork.Management.DataBaseManger data = new Neusoft.FrameWork.Management.DataBaseManger(); this.dtpBeginDate.Value = DateTime.Parse(data.GetSysDate() + " 00:00:00"); //起始时间 this.dtpEndDate.Value = DateTime.Parse(data.GetSysDate() + " 23:59:59"); //结束时间 if (!this.isShowDetailTab) { this.InitTabPage(); } } catch { } }
/// <summary> /// 显示物品列表{7019A2A6-ADCA-4984-944B-C4F1A312449A} /// </summary> public virtual void ShowMaterialList(string deptCode) { Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在检索物品信息..."); Application.DoEvents(); try { Neusoft.FrameWork.Management.DataBaseManger databaseManager = new Neusoft.FrameWork.Management.DataBaseManger(); DataSet dataSet = new DataSet(); string[] sqlIndex = new string[2] { "Material.MetItem.ValibInfo", "Material.MetItem.GetAvailableList.Where" }; //{7019A2A6-ADCA-4984-944B-C4F1A312449A} databaseManager.ExecQuery(sqlIndex, ref dataSet, deptCode); if (dataSet == null) { MessageBox.Show("检索列表数据发生错误\n" + databaseManager.Err); return; } this.filterField = new string[4] { "SPELL_CODE", "WB_CODE", "CUSTOM_CODE", "ITEM_NAME" }; if (dataSet.Tables.Count > 0) { this.DataTable = dataSet.Tables[0]; } this.SetpMaterialFormat(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); } }
/// <summary> /// 显示库存药品列表 不显示药库停用的药品 无药房是否停用无关 /// 处理特殊盘点信息{98F0BF7A-5F41-4de3-884F-B38E71B41A8C} /// </summary> /// <param name="deptCode">库房编码</param> /// <param name="isBatch">是否按批号管理</param> /// <param name="showStorageFlag">是否显示库存</param> public virtual void ShowDeptStorageWithSpecialCheck(string deptCode, bool isBatch, int showStorageFlag) { Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在检索库存药品信息..."); Application.DoEvents(); try { this.FarPointReset(); Neusoft.FrameWork.Management.DataBaseManger databaseManager = new Neusoft.FrameWork.Management.DataBaseManger(); DataSet dataSet = new DataSet(); string sqlIndex; if (isBatch) { sqlIndex = "Pharmacy.Item.GetStorageListByBatch"; } else { sqlIndex = "Pharmacy.Item.GetStorageListWithSpecialCheck"; } databaseManager.ExecQuery(sqlIndex, ref dataSet, deptCode); if (dataSet == null) { MessageBox.Show("检索列表数据发生错误\n" + databaseManager.Err); return; } if (dataSet.Tables.Count > 0 && dataSet.Tables[0].Columns.Contains("custom_code")) { this.filterField = new string[] { "SPELL_CODE", "WB_CODE", "TRADE_NAME", "REGULAR_SPELL", "REGULAR_WB", "OTHER_SPELL", "OTHER_WB", "FORMAL_SPELL", "FORMAL_WB", "custom_code" }; } else { this.filterField = new string[] { "SPELL_CODE", "WB_CODE", "TRADE_NAME", "REGULAR_SPELL", "REGULAR_WB", "OTHER_SPELL", "OTHER_WB", "FORMAL_SPELL", "FORMAL_WB" }; } this.DataAutoWidth = false; if (dataSet.Tables.Count > 0) { foreach (DataRow dr in dataSet.Tables[0].Rows) { if (Neusoft.FrameWork.Function.NConvert.ToDecimal(dr[14]) != 0) { dr[5] = Math.Round(Neusoft.FrameWork.Function.NConvert.ToDecimal(dr[5]) / Neusoft.FrameWork.Function.NConvert.ToDecimal(dr[14]), 2); } } //{28017834-5C98-4d3c-A8CD-7BE2F95C6D74} 过滤不显示0库存药品 System.Data.DataView view = dataSet.Tables[0].DefaultView; view.RowFilter = "STORE_SUM > 0"; this.DataTable = view.ToTable(); } //使用控件默认的显示格式 this.SetFormatForStorage(showStorageFlag); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); } }
/// <summary> /// 显示库存药品列表 根据参数决定是否显示库存中停用的药品 /// {D06724D9-C415-4a6b-8E93-0FF175CB7A8A} 20091230 /// </summary> /// <param name="deptCode">科室代码</param> /// <param name="isBatch">是否按批号显示</param> /// <param name="isStoreInvalid">是否过滤无效</param> public virtual void ShowDeptStorageAndDict(string deptCode, bool isBatch, bool isFilterStoreInvalid) { Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在检索库存药品信息..."); Application.DoEvents(); try { this.FarPointReset(); Neusoft.FrameWork.Management.DataBaseManger databaseManager = new Neusoft.FrameWork.Management.DataBaseManger(); DataSet dataSet = new DataSet(); string sqlIndex; if (isBatch) { if (isFilterStoreInvalid) { sqlIndex = "Pharmacy.Item.QueryDrugList.StoreAndDic.ByBatch"; } else { sqlIndex = "Pharmacy.Item.QueryDrugList.StoreAndDic.ByBatch.AllState"; } } else { if (isFilterStoreInvalid) { sqlIndex = "Pharmacy.Item.QueryDrugList.StoreAndDic.NotByBatch"; } else { sqlIndex = "Pharmacy.Item.QueryDrugList.StoreAndDic.NotByBatch.AllState"; } } databaseManager.ExecQuery(sqlIndex, ref dataSet, deptCode, "ALL"); if (dataSet == null) { MessageBox.Show("检索列表数据发生错误\n" + databaseManager.Err); return; } this.filterField = new string[] { "药品名称", "商品名拼音码", "商品名五笔码", "通用名拼音码", "通用名五笔码" }; this.DataAutoHeading = false; this.DataAutoWidth = false; this.DataAutoCellType = false; if (dataSet.Tables.Count > 0) { this.DataTable = dataSet.Tables[0]; } //使用控件默认的显示格式 this.SetFormatForStorageAndDict(Neusoft.FrameWork.Function.NConvert.ToInt32(isBatch)); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); } }
/// <summary> /// 判断程序版本是否为最新版本 /// </summary> /// <returns>新版本返回1 旧版本返回-1</returns> public static int JudgeVersionNumber() { Neusoft.FrameWork.Xml.XML xmlManager = new Neusoft.FrameWork.Xml.XML(); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); System.Xml.XmlNode root; #region 获取本地配置文件内HIS系统版本 string hosVersionNumber = ""; //string hosFilePath = Application.StartupPath + "\\HIS.config"; //if (System.IO.File.Exists(hosFilePath)) //存在配置文件 //{ //doc.Load(hosFilePath); //root = doc.SelectSingleNode("//VersionNumber"); hosVersionNumber = System.Configuration.ConfigurationManager.AppSettings["VersionNumber"]; if (string.IsNullOrEmpty(hosVersionNumber)) { MessageBox.Show("读取本地XML配置文件时 未找到版本号结点"); return(-1); } //hosVersionNumber = obj.ToString(); //root.Attributes[0].Value.ToString(); //} //else //{ // #region 自动建立 // System.Xml.XmlDocument newDoc = new System.Xml.XmlDocument(); // System.Xml.XmlDeclaration declarationNode = newDoc.CreateXmlDeclaration("1.0", "GB2312", null); // newDoc.AppendChild(declarationNode); // System.Xml.XmlElement configNode = newDoc.CreateElement("Config"); // configNode.SetAttribute("Version", "4.5"); // newDoc.AppendChild(configNode); // System.Xml.XmlElement versionNumNode = newDoc.CreateElement("VersionNumber"); // versionNumNode.SetAttribute("Number", "20070101"); // configNode.AppendChild(versionNumNode); // newDoc.Save(Application.StartupPath + "\\HIS.config"); // #endregion // return 1; //} Function.VersionNumber = hosVersionNumber; #endregion //读取控制参数 如果未找到对应控制参数或参数为0 不进行版本校验 Neusoft.HISFC.BizLogic.Manager.Controler controlerManagment = new Neusoft.HISFC.BizLogic.Manager.Controler(); string control = controlerManagment.QueryControlerInfo(Neusoft.HISFC.BizProcess.Integrate.SysConst.Use_Judge_VersionNum); if (control == null || control == "0" || control == "-1") { return(1); } #region 获取服务器版本号 string serverVersionNumber = ""; Neusoft.FrameWork.Management.DataBaseManger dataBase = new Neusoft.FrameWork.Management.DataBaseManger(); dataBase.ExecQuery(Function.versionSelect); try { if (dataBase.Reader.Read()) { serverVersionNumber = dataBase.Reader[0].ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { dataBase.Reader.Close(); } #endregion if (hosVersionNumber != serverVersionNumber) { MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("您当前所用的信息管理系统非最新版本 请重启系统进行升级或与信息科联系")); return(-1); } return(1); }
/// <summary> /// 记录debugsql.log 与 err.log 日志文件大小信息 并对大于删除标准的文件进行删除 /// </summary> /// <param name="var">登陆信息</param> /// <param name="isUpdate">对已插入的信息是否进行更新操作</param> /// <param name="delSqlLog">是否对debugSql.log进行删除</param> /// <param name="delErrLog">是否对err.log进行删除</param> /// <param name="delSize">需删除文件大小标准 以K为单位</param> public static int NoteLog(Neusoft.HISFC.Models.Base.Employee oper, bool isUpdate, bool delSqlLog, bool delErrLog, int delSize) { if (oper != null && oper.ID != "") { string sql = ""; int parm = -1; string hosName = System.Net.Dns.GetHostName(); //主机名 string hosIP = System.Net.Dns.GetHostEntry(hosName).AddressList[0].ToString(); //主机IP Neusoft.FrameWork.Management.DataBaseManger dataBase = new Neusoft.FrameWork.Management.DataBaseManger(); #region 数据库记录 //自动计费程序标志 string fixFeeFlag = "1"; if (System.IO.File.Exists(Application.StartupPath + "\\HISTIMEJOB.exe")) { fixFeeFlag = "F"; try { System.IO.FileInfo fixFeeFs = new System.IO.FileInfo(Application.StartupPath + "\\FixFee.exe"); fixFeeFs.Delete(); } catch (Exception ex) { MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("删除HISTIMEJOB文件失败 请与信息科联系" + ex.Message)); return(-1); } } if (System.IO.File.Exists(Application.StartupPath + "\\HISTIMEJOB.exe")) { fixFeeFlag = "F"; try { System.IO.FileInfo fixFeeFs = new System.IO.FileInfo(Application.StartupPath + "\\FIXFEE.exe"); fixFeeFs.Delete(); } catch (Exception ex) { MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("删除HISTIMEJOB文件失败 请与信息科联系" + ex.Message)); return(-1); } } Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(dataBase.Connection); //t.BeginTransaction(); dataBase.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); if (isUpdate) { sql = string.Format(sqlUpdate, hosIP, dataBase.GetDateTimeFromSysDateTime().ToString(), oper.ID, Function.VersionNumber, oper.Dept.Name, oper.CurrentGroup.Name, fixFeeFlag, "", ""); parm = dataBase.ExecNoQuery(sql); if (parm == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack();; MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("根据文件信息对数据进行插入失败\n" + dataBase.Err)); return(-1); } if (parm > 0) { Neusoft.FrameWork.Management.PublicTrans.Commit();; return(1); } } sql = string.Format(sqlInsert, hosIP, dataBase.GetDateTimeFromSysDateTime().ToString(), oper.ID, Function.VersionNumber, oper.Dept.Name, oper.CurrentGroup.Name, fixFeeFlag, "", ""); parm = dataBase.ExecNoQuery(sql); if (parm < 0 && dataBase.DBErrCode != 1) { Neusoft.FrameWork.Management.PublicTrans.RollBack();; MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("根据文件信息对数据进行更新失败\n" + dataBase.Err)); return(-1); } Neusoft.FrameWork.Management.PublicTrans.Commit();; #endregion } return(1); }
/// <summary> /// 对传入的申请数据打印门诊标签 /// </summary> /// <param name="alOutData">申请数据</param> /// <returns>成功返回1 出错返回-1</returns> internal static int PrintLabelForOutpatient(ArrayList alOutData) { if (Function.IDrugPrint == null) { System.Windows.Forms.MessageBox.Show("未正确设置摆药单打印接口."); return(-1); } if (alOutData.Count <= 0) { return(1); } string strPID = ""; ArrayList al = new ArrayList( ); Neusoft.HISFC.Models.Registration.Register patiRegister = new Neusoft.HISFC.Models.Registration.Register( ); Neusoft.HISFC.Models.RADT.PatientInfo patiPerson = new Neusoft.HISFC.Models.RADT.PatientInfo( ); Neusoft.HISFC.BizProcess.Integrate.RADT radtManager = new Neusoft.HISFC.BizProcess.Integrate.RADT( ); Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger( ); foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut temp in alOutData) { temp.User01 = ""; if (temp.PatientNO == strPID) { al.Add(temp); } else { if (al.Count > 0) { #region 标签打印赋值 patiPerson = radtManager.GetPatientInfomation(strPID); patiRegister.Name = patiPerson.Name; patiRegister.Sex = patiPerson.Sex; patiRegister.Age = dataManager.GetAge(patiPerson.Birthday); patiRegister.User02 = al.Count.ToString( ); Function.IDrugPrint.OutpatientInfo = patiRegister; Function.IDrugPrint.LabelTotNum = al.Count; Function.IDrugPrint.DrugTotNum = al.Count; string privCombo = ""; ArrayList alCombo = new ArrayList( ); foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in al) { if (privCombo == "-1" || (privCombo == info.CombNO && info.CombNO != "")) { alCombo.Add(info); privCombo = info.CombNO; continue; } else //不同处方号 { if (alCombo.Count > 0) { if (alCombo.Count == 1) { Function.IDrugPrint.AddSingle(alCombo[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut); } else { Function.IDrugPrint.AddCombo(alCombo); } Function.IDrugPrint.Print( ); } privCombo = info.CombNO; alCombo = new ArrayList( ); alCombo.Add(info); } } if (alCombo.Count == 0) { return(1); } if (alCombo.Count > 1) { Function.IDrugPrint.AddCombo(alCombo); } else { Function.IDrugPrint.AddSingle(alCombo[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut); } Function.IDrugPrint.Print( ); #endregion } al = new ArrayList( ); al.Add(temp); strPID = temp.PatientNO; } } if (al.Count > 0) { #region 标签打印赋值 patiPerson = radtManager.GetPatientInfomation(strPID); patiRegister.Name = patiPerson.Name; patiRegister.Sex = patiPerson.Sex; patiRegister.Age = dataManager.GetAge(patiPerson.Birthday); patiRegister.User02 = al.Count.ToString( ); Function.IDrugPrint.OutpatientInfo = patiRegister; Function.IDrugPrint.LabelTotNum = al.Count; Function.IDrugPrint.DrugTotNum = al.Count; string privCombo = "-1"; ArrayList alCombo = new ArrayList( ); foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in al) { if (privCombo == "-1" || (privCombo == info.CombNO && info.CombNO != "")) { alCombo.Add(info); privCombo = info.CombNO; continue; } else //不同处方号 { if (alCombo.Count == 1) { Function.IDrugPrint.AddSingle(alCombo[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut); } else { Function.IDrugPrint.AddCombo(alCombo); } Function.IDrugPrint.Print( ); privCombo = info.CombNO; alCombo = new ArrayList( ); alCombo.Add(info); } } if (alCombo.Count == 0) { return(1); } if (alCombo.Count > 1) { Function.IDrugPrint.AddCombo(alCombo); } else { Function.IDrugPrint.AddSingle(alCombo[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut); } Function.IDrugPrint.Print( ); #endregion } return(1); }
public void RefreshInfo() { this.Nodes.Clear(); if (manager == null) { manager = new Neusoft.HISFC.BizProcess.Integrate.RADT(); } ArrayList al = new ArrayList(); Neusoft.HISFC.Models.Base.Employee per = Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee; //节点说明 al.Add("分管患者|patient"); try { ArrayList al1 = new ArrayList(); al1 = this.manager.QueryPatientByHouseDoc(per, Neusoft.HISFC.Models.Base.EnumInState.I, per.Dept.ID); foreach (Neusoft.HISFC.Models.RADT.PatientInfo PatientInfo1 in al1) { al.Add(PatientInfo1); } } catch (Exception ex) { MessageBox.Show("查找分管患者出错\n!" + ex.Message + this.manager.Err); } al.Add("本科室患者|DeptPatient"); addPatientList(al, Neusoft.HISFC.Models.Base.EnumInState.I); al.Add("会诊患者|ConsultationPatient"); try { ArrayList al1 = new ArrayList(); Neusoft.FrameWork.Management.DataBaseManger dbManager = new Neusoft.FrameWork.Management.DataBaseManger(); DateTime dt = dbManager.GetDateTimeFromSysDateTime(); DateTime dt1 = new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0, 0); DateTime dt2 = new DateTime(dt.Year, dt.AddDays(1).Month, dt.AddDays(1).Day, 0, 0, 0, 0); al1 = this.manager.QueryPatientByConsultation(dbManager.Operator, dt1, dt2, per.Dept.ID); foreach (Neusoft.HISFC.Models.RADT.PatientInfo PatientInfo1 in al1) { al.Add(PatientInfo1); } } catch (Exception ex) { MessageBox.Show("查找会诊患者出错\n!" + ex.Message + this.manager.Err); } al.Add("授权患者|PermissionPatient"); try { ArrayList al1 = new ArrayList(); al1 = this.manager.QueryPatientByPermission(Neusoft.FrameWork.Management.Connection.Operator); foreach (Neusoft.HISFC.Models.RADT.PatientInfo PatientInfo1 in al1) { al.Add(PatientInfo1); } } catch (Exception ex) { MessageBox.Show("查找授权患者出错\n!" + ex.Message + this.manager.Err); } try { al.Add("查找患者|QueryPatient"); } catch (Exception ex) { MessageBox.Show("查找患者出错\n!" + ex.Message + this.manager.Err); } //{AC6A5576-BA29-4dba-8C39-E7C5EBC7671E} 增加医疗组处理 al.Add("医疗组内患者|TeamPatient"); if (this.medicalTeamForDoctBizlogic == null) { this.medicalTeamForDoctBizlogic = new Neusoft.HISFC.BizLogic.Order.MedicalTeamForDoct(); } List <Neusoft.HISFC.Models.Order.Inpatient.MedicalTeamForDoct> medicalTeamForDoctList = this.medicalTeamForDoctBizlogic.QueryQueryMedicalTeamForDoctInfo(per.Dept.ID, per.ID); if (medicalTeamForDoctList == null) { MessageBox.Show("查询医疗组失败!\n" + this.medicalTeamForDoctBizlogic.Err); } if (medicalTeamForDoctList.Count > 0) { Neusoft.HISFC.Models.Order.Inpatient.MedicalTeamForDoct medcialObj = medicalTeamForDoctList[0]; addPatientListMedialTeam(al, Neusoft.HISFC.Models.Base.EnumInState.I, medcialObj.MedcicalTeam.ID); } this.SetPatient(al); }
protected override int OnQuery(object sender, object neuObject) { if (this.dtBegin.Value > this.dtEnd.Value) { MessageBox.Show("查询起始时间不能大于查询截止时间", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return(-1); } string drugCode = this.ucDrugList1.CurrentSheetView.Cells[this.ucDrugList1.CurrentSheetView.ActiveRowIndex, 0].Text; if (this.hsDrug.ContainsKey(drugCode)) { this.currentDrugCode = drugCode; Neusoft.HISFC.Models.Pharmacy.Item info = this.hsDrug[drugCode] as Neusoft.HISFC.Models.Pharmacy.Item; this.lbTitle.Text = info.NameCollection.RegularName + "明细帐"; this.lbDrugDept.Text = "库存科室:" + this.DrugDept.Name; this.lbSpecs.Text = "规格:" + info.Specs; this.lbDosage.Text = "剂型:" + this.dosageHelper.GetName(info.DosageForm.ID.ToString()); this.lbPackUnit.Text = "包装单位:" + info.PackUnit; if (this.hsProduce.ContainsKey(info.Product.Producer.ID)) { this.lbCompany.Text = "生产厂家:" + this.hsProduce[info.Product.Producer.ID].ToString(); } } if (string.IsNullOrEmpty(this.DrugCode)) { MessageBox.Show("请选择需统计的药品"); return(-1); } DateTime queryBeginDate = System.DateTime.Now.AddYears(-100); DateTime queryEndDate = System.DateTime.Now.AddYears(100); #region 获取统计起始时间 Neusoft.FrameWork.Management.DataBaseManger dataManagement = new Neusoft.FrameWork.Management.DataBaseManger(); string execBeginSql = string.Format(this.getQueryBeginDate, this.DrugDept.ID, Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtBegin.Text).ToString()); string beginDateString = dataManagement.ExecSqlReturnOne(execBeginSql); queryBeginDate = Neusoft.FrameWork.Function.NConvert.ToDateTime(beginDateString); string execEndSql = string.Format(this.getQueryEndDate, this.DrugDept.ID, Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtEnd.Text).ToString()); string endDateString = dataManagement.ExecSqlReturnOne(execEndSql); queryEndDate = Neusoft.FrameWork.Function.NConvert.ToDateTime(endDateString); if (queryEndDate == DateTime.MinValue) { queryEndDate = dataManagement.GetDateTimeFromSysDateTime().AddDays(1); } #endregion this.lbStatDate.Text = "会计区间:" + queryBeginDate.ToString() + " - " + queryEndDate.ToString(); ArrayList alAllData = new ArrayList(); #region 数据检索 ArrayList alInData = this.QueryItemizedData(this.inItemizedBillSql, DataSource.In, queryBeginDate, queryEndDate); if (alInData == null) { return(-1); } alAllData.AddRange(alInData); ArrayList alOutData = this.QueryItemizedData(this.outItemizedBillSql, DataSource.Out, queryBeginDate, queryEndDate); if (alOutData == null) { return(-1); } alAllData.AddRange(alOutData); ArrayList alAdjustData = this.QueryItemizedData(this.adjuseItemizedBillSql, DataSource.Adjust, queryBeginDate, queryEndDate); if (alAdjustData == null) { return(-1); } alAllData.AddRange(alAdjustData); ArrayList alCheckData = this.QueryItemizedData(this.checkItemizedBillSql, DataSource.Check, queryBeginDate, queryEndDate); if (alCheckData == null) { return(-1); } alAllData.AddRange(alCheckData); ArrayList alMsCurrentData = this.QueryItemizedData(this.msCurrentItemizedBillSql, DataSource.MonthCurrent, queryBeginDate, queryEndDate); if (alMsCurrentData == null) { return(-1); } alAllData.AddRange(alMsCurrentData); ArrayList alMsLastData = this.QueryItemizedData(this.msLastItemizedBillSql, DataSource.MonthLast, queryBeginDate, queryEndDate); if (alMsLastData == null) { return(-1); } alAllData.AddRange(alMsLastData); #endregion CompareDate sortData = new CompareDate(); alAllData.Sort(sortData); return(this.ShowData(alAllData)); }