Ejemplo n.º 1
0
 private void frmDCOrder_Load(object sender, EventArgs e)
 {
     try
     {
         this.dateTimeBox1.Value   = manager1.GetDateTimeFromSysDateTime().AddMinutes(5);
         this.dateTimeBox1.MinDate = this.dateTimeBox1.Value.Date;
         this.cmbDC.AddItems(manager.GetConstantList(Neusoft.HISFC.Models.Base.EnumConstant.DCREASON));
         if (this.cmbDC.Items.Count > 0)
         {
             this.cmbDC.SelectedIndex = 0;
         }
     }
     catch { }
 }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 初始化患者列表
        /// </summary>
        /// <returns></returns>
        private int InitTvPatientList()
        {
            this.tvPatientList.Nodes.Clear();
            TreeNode tnRoot = new TreeNode();

            tnRoot.Name = "ConsultationPatient";
            tnRoot.Text = "科室会诊患者";
            tnRoot.Tag  = "ConsultationPatient";
            this.tvPatientList.Nodes.Add(tnRoot);
            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);
            ArrayList al1 = this.managerRADT.QueryPatientByConsultation(dbManager.Operator, dt1, dt2, per.Dept.ID);

            if (al1 == null)
            {
                MessageBox.Show(this.managerRADT.Err);
            }

            foreach (Neusoft.HISFC.Models.RADT.PatientInfo patientInfo in al1)
            {
                TreeNode tn = new TreeNode();
                tn.Name = patientInfo.ID;
                tn.Text = "【" + patientInfo.PVisit.PatientLocation.Bed.ID.Remove(0, 4) + "】" + patientInfo.Name;
                tn.Tag  = patientInfo;
                this.tvPatientList.Nodes["ConsultationPatient"].Nodes.Add(tn);
            }
            this.tvPatientList.ExpandAll();

            //this.tv = this.tvPatientList;
            return(1);
        }
        /// <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>
        ///// 刷新
        ///// </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);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
 /// <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 {}
 }
Ejemplo n.º 8
0
        /// <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);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 按排班序号查询已排班信息
        /// </summary>
        /// <param name="arrangeID"></param>
        /// <param name="deptID"></param>
        public void Query(string arrangeID, string deptID)
        {
            if (fpSpread1_Sheet1.RowCount > 0)
            {
                fpSpread1_Sheet1.Rows.Remove(0, fpSpread1_Sheet1.RowCount - 1);
            }
            DateTime begin = DateTime.Parse(arrangeID.Substring(0, 4) + "-" + arrangeID.Substring(4, 2) + "-" +
                                            arrangeID.Substring(6, 2));

            fpSpread1_Sheet1.ColumnHeader.Cells[0, 2].Text = begin.ToString("yyyy-MM-dd");
            fpSpread1_Sheet1.ColumnHeader.Cells[0, 3].Text = begin.AddDays(1).ToString("yyyy-MM-dd");
            fpSpread1_Sheet1.ColumnHeader.Cells[0, 4].Text = begin.AddDays(2).ToString("yyyy-MM-dd");
            fpSpread1_Sheet1.ColumnHeader.Cells[0, 5].Text = begin.AddDays(3).ToString("yyyy-MM-dd");
            fpSpread1_Sheet1.ColumnHeader.Cells[0, 6].Text = begin.AddDays(4).ToString("yyyy-MM-dd");
            fpSpread1_Sheet1.ColumnHeader.Cells[0, 7].Text = begin.AddDays(5).ToString("yyyy-MM-dd");
            fpSpread1_Sheet1.ColumnHeader.Cells[0, 8].Text = begin.AddDays(6).ToString("yyyy-MM-dd");

            this.lbDate.Text = "排班时间:" + dataManager.GetDateTimeFromSysDateTime().ToString("yyyy-MM-dd");
            Query(deptID);
            this.Tag = deptID;
        }
Ejemplo n.º 10
0
        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));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 数据显示
        /// </summary>
        /// <param name="alData"></param>
        /// <param name="drugBillClass"></param>
        public void ShowData(ArrayList alData, Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass)
        {
            if (ucDrugHerbal.hsDept.Count == 0)
            {
                Neusoft.HISFC.BizLogic.Manager.Department deptManager = new Neusoft.HISFC.BizLogic.Manager.Department();
                ArrayList alDept = deptManager.GetDeptmentAll();
                foreach (Neusoft.HISFC.Models.Base.Department dept in alDept)
                {
                    ucDrugHerbal.hsDept.Add(dept.ID, dept.Name);
                }
            }
            this.SuspendLayout();

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
            this.lbPrintTime.Text = "打印时间:" + dataManager.GetDateTimeFromSysDateTime().ToString();

            this.lbPrintTime.Text = "打印时间:" + drugBillClass.Oper.OperTime.ToString();

            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1_Sheet1)).BeginInit();

            int     iRow    = 0;
            string  comboNO = "-1";
            decimal subTot  = 0;
            decimal tot     = 0;

            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alData)
            {
                if (ucDrugHerbal.hsDept.ContainsKey(info.ApplyDept.ID))
                {
                    this.lbTitle.Text = "                       " + ucDrugHerbal.hsDept[info.ApplyDept.ID] + drugBillClass.Name;
                }
                else
                {
                    this.lbTitle.Text = "                       " + info.ApplyDept.Name + drugBillClass.Name;
                }

                this.neuSpread1_Sheet1.Rows.Add(iRow, 1);

                if (comboNO == info.CombNO)         //相同组合号
                {
                    this.neuSpread1_Sheet1.Cells[iRow, 0].Text = "[" + info.User02 + "]" + info.User01;
                    this.neuSpread1_Sheet1.Cells[iRow, 1].Text = info.Item.Name + "[" + info.Item.Specs + "]";
                    this.neuSpread1_Sheet1.Cells[iRow, 2].Text = info.Operation.ApplyQty.ToString();
                    this.neuSpread1_Sheet1.Cells[iRow, 3].Text = (info.Operation.ApplyQty * info.Days).ToString();
                    this.neuSpread1_Sheet1.Cells[iRow, 4].Text = info.Item.MinUnit;
                    this.neuSpread1_Sheet1.Cells[iRow, 5].Text = info.Frequency.ID;
                    this.neuSpread1_Sheet1.Cells[iRow, 6].Text = info.PlaceNO;
                    this.neuSpread1_Sheet1.Cells[iRow, 7].Text = info.Item.PriceCollection.RetailPrice.ToString();

                    subTot = subTot + (info.Operation.ApplyQty * info.Days / info.Item.PackQty * info.Item.PriceCollection.RetailPrice);
                    this.neuSpread1_Sheet1.Cells[iRow, 8].Value = (info.Operation.ApplyQty * info.Days / info.Item.PackQty * info.Item.PriceCollection.RetailPrice);
                    this.neuSpread1_Sheet1.Cells[iRow, 9].Text  = info.Memo;
                }
                else                              //不同组合号
                {
                    if (comboNO != "-1")
                    {
                        this.neuSpread1_Sheet1.Cells[iRow, 1].Text = "小计";
                        this.neuSpread1_Sheet1.Cells[iRow, 8].Text = subTot.ToString();
                        this.neuSpread1_Sheet1.Rows[iRow].Font     = new Font("宋体", 9.5F, FontStyle.Bold);
                        iRow++;
                        this.neuSpread1_Sheet1.Rows.Add(iRow, 1);
                    }

                    this.neuSpread1_Sheet1.Cells[iRow, 1].Text            = "剂数";
                    this.neuSpread1_Sheet1.Cells[iRow, 1].Text            = info.Days.ToString();
                    this.neuSpread1_Sheet1.Cells[iRow, 1].ColumnSpan      = 7;
                    this.neuSpread1_Sheet1.Columns[1].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left;
                    this.neuSpread1_Sheet1.Rows[iRow].Font = new Font("宋体", 9.5F, FontStyle.Bold);
                    iRow++;
                    this.neuSpread1_Sheet1.Rows.Add(iRow, 1);

                    tot     = tot + subTot;
                    subTot  = 0;
                    comboNO = info.CombNO;

                    this.neuSpread1_Sheet1.Cells[iRow, 0].Text = "[" + info.User02 + "]" + info.User01;
                    this.neuSpread1_Sheet1.Cells[iRow, 1].Text = info.Item.Name + "[" + info.Item.Specs + "]";
                    this.neuSpread1_Sheet1.Cells[iRow, 2].Text = info.Operation.ApplyQty.ToString();
                    this.neuSpread1_Sheet1.Cells[iRow, 3].Text = (info.Operation.ApplyQty * info.Days).ToString();
                    this.neuSpread1_Sheet1.Cells[iRow, 4].Text = info.Item.MinUnit;
                    this.neuSpread1_Sheet1.Cells[iRow, 5].Text = info.Frequency.ID;
                    this.neuSpread1_Sheet1.Cells[iRow, 6].Text = info.PlaceNO;
                    this.neuSpread1_Sheet1.Cells[iRow, 7].Text = info.Item.PriceCollection.RetailPrice.ToString();

                    subTot = subTot + (info.Operation.ApplyQty * info.Days / info.Item.PackQty * info.Item.PriceCollection.RetailPrice);
                    this.neuSpread1_Sheet1.Cells[iRow, 8].Value = (info.Operation.ApplyQty * info.Days / info.Item.PackQty * info.Item.PriceCollection.RetailPrice);
                    this.neuSpread1_Sheet1.Cells[iRow, 9].Text  = info.Memo;
                }

                iRow++;
            }

            this.neuSpread1_Sheet1.Rows.Add(iRow, 1);
            this.neuSpread1_Sheet1.Cells[iRow, 1].Text = "小计";
            this.neuSpread1_Sheet1.Cells[iRow, 8].Text = subTot.ToString();
            this.neuSpread1_Sheet1.Rows[iRow].Font     = new Font("宋体", 9.5F, FontStyle.Bold);
            iRow++;
            this.neuSpread1_Sheet1.Rows.Add(iRow, 1);

            tot = tot + subTot;
            this.neuSpread1_Sheet1.Cells[iRow, 1].Text = "合计";
            this.neuSpread1_Sheet1.Cells[iRow, 8].Text = tot.ToString();
            this.neuSpread1_Sheet1.Rows[iRow].Font     = new Font("宋体", 9.5F, FontStyle.Bold);

            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1_Sheet1)).EndInit();

            this.ResumeLayout(true);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 数据显示
        /// </summary>
        /// <param name="alOriginalData"></param>
        /// <param name="drugBillClass"></param>
        public void ShowData(ArrayList alOriginalData, Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass)
        {
            ArrayList alData = new ArrayList();

            this.AlterApplyData(alOriginalData, ref alData);

            CompareApplyOut compare = new CompareApplyOut();

            alData.Sort(compare);

            #region 静态科室帮助信息获取

            if (ucDrugTotal.hsDept.Count == 0)
            {
                Neusoft.HISFC.BizLogic.Manager.Department deptManager = new Neusoft.HISFC.BizLogic.Manager.Department();
                ArrayList alDept = deptManager.GetDeptmentAll();
                foreach (Neusoft.HISFC.Models.Base.Department dept in alDept)
                {
                    ucDrugTotal.hsDept.Add(dept.ID, dept.Name);
                }
            }

            #endregion

            this.SuspendLayout();

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
            this.lbPrintTime.Text = "打印时间:" + dataManager.GetDateTimeFromSysDateTime().ToString();

            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1_Sheet1)).BeginInit();

            int     iRow    = 0;
            int     iCount  = 0;
            decimal totCost = 0;//总金额{65581D3C-D84E-4d4d-AF93-B58077F10DD5}
            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alData)
            {
                iCount++;
                if (iCount == 6)
                {
                    this.neuSpread1_Sheet1.Rows.Add(iRow, 1);
                    iRow++;
                    iCount = 0;
                }
                #region 数据赋值

                if (ucDrugTotal.hsDept.ContainsKey(info.ApplyDept.ID))
                {
                    this.lbTitl.Text = "                       " + ucDrugTotal.hsDept[info.ApplyDept.ID] + drugBillClass.Name + "(汇总)" + "      " + this.ifBPrint;
                }
                else
                {
                    this.lbTitl.Text = "                       " + info.ApplyDept.Name + drugBillClass.Name + "(汇总)" + "     " + this.ifBPrint;
                }

                this.neuSpread1_Sheet1.Rows.Add(iRow, 1);
                info.Item.NameCollection.RegularName       = itemManager.GetItem(info.Item.ID).NameCollection.RegularName;//{8CA1AEE7-F038-4c32-BD3E-ECCC8DFE687B}
                this.neuSpread1_Sheet1.Cells[iRow, 0].Text = info.PlaceNO;
                //屏蔽剂型的显示
                this.neuSpread1_Sheet1.Cells[iRow, 1].Text = info.Item.NameCollection.Name + "(" + info.Item.Name + ")" + "[ " + info.Item.Specs + " ]";
                char[] ca = this.neuSpread1_Sheet1.Cells[iRow, 1].Text.ToCharArray(); //{8CA1AEE7-F038-4c32-BD3E-ECCC8DFE687B}
                int    j  = System.Text.Encoding.Default.GetByteCount(ca, 0, ca.Length);
                if (j / 40 >= 1 && j % 40 == 0)                                       //大于一行并且正好等于下一行
                {
                    this.neuSpread1_Sheet1.Rows[iRow].Height = (j / 40) * Neusoft.FrameWork.Function.NConvert.ToInt32(this.neuSpread1_Sheet1.Rows.Default.Height);
                }
                else if (j / 40 >= 1 && j % 40 > 0)//大于一行,并且延伸到下一行
                {
                    this.neuSpread1_Sheet1.Rows[iRow].Height = ((j / 40) + 1) * Neusoft.FrameWork.Function.NConvert.ToInt32(this.neuSpread1_Sheet1.Rows.Default.Height);
                }
                this.neuSpread1_Sheet1.Cells[iRow, 2].Text = info.Operation.ApplyQty.ToString();
                this.neuSpread1_Sheet1.Cells[iRow, 3].Text = info.Item.MinUnit;
                this.neuSpread1_Sheet1.Cells[iRow, 4].Text = info.Item.PriceCollection.RetailPrice.ToString();
                if (info.Item.User01 == "1")            //传入的数量为包装单位
                {
                    this.neuSpread1_Sheet1.Cells[iRow, 5].Value = (info.Operation.ApplyQty * info.Item.PriceCollection.RetailPrice);
                }
                else
                {
                    this.neuSpread1_Sheet1.Cells[iRow, 5].Value = (info.Operation.ApplyQty / info.Item.PackQty * info.Item.PriceCollection.RetailPrice);
                }
                totCost += Neusoft.FrameWork.Function.NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[iRow, 5].Value);
                iRow++;

                #endregion
            }

            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1_Sheet1)).EndInit();

            #region 汇总量计算

            try
            {
                if (this.neuSpread1_Sheet1.Rows.Count > 0)
                {
                    this.neuSpread1_Sheet1.Rows.Add(iRow, 1);
                    this.neuSpread1_Sheet1.Cells[iRow, 0].ColumnSpan = 6;
                    this.neuSpread1_Sheet1.Cells[iRow, 0].Text       = "领药:         发药:         复准:         制表人:" + (Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee).Name + "      累计:" + totCost.ToString();
                    //this.neuSpread1_Sheet1.Cells[iRow, 5].Formula = string.Format("SUM(E1:E{0})", iRow.ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            this.ResumeLayout(true);

            #endregion
        }
        /// <summary>
        /// 设置新医嘱
        /// </summary>
        public virtual void SetOrder()
        {
            if (this.DesignMode)
            {
                return;
            }
            //定义个新医嘱对象
            this.order = new Neusoft.HISFC.Models.Order.OutPatient.Order();//重新设置医嘱

            dirty = false;
            try
            {
                if (this.ucInputItem1.FeeItem.ID == "999")//自己录的项目
                {
                    this.order.Item = this.ucInputItem1.FeeItem as Neusoft.HISFC.Models.Base.Item;
                }
                else
                {
                    //药品
                    if (this.ucInputItem1.FeeItem.GetType() == typeof(Neusoft.HISFC.Models.Pharmacy.Item))
                    {
                        if (pharmacyManager == null)
                        {
                            pharmacyManager = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy();
                        }
                        this.order.Item        = pharmacyManager.GetItem(this.ucInputItem1.FeeItem.ID);
                        this.order.Item.User01 = this.ucInputItem1.FeeItem.User01;
                        this.order.Item.User02 = this.ucInputItem1.FeeItem.User02;//传递取药药房
                        this.order.Item.User03 = this.ucInputItem1.FeeItem.User03;
                    }
                    else//非药品
                    {
                        try
                        {
                            if (((Neusoft.HISFC.Models.Base.Item) this.ucInputItem1.FeeItem).PriceUnit != "[复合项]")
                            {
                                Neusoft.HISFC.Models.Fee.Item.Undrug itemTemp = null;
                                itemTemp = itemManager.GetItem(this.ucInputItem1.FeeItem.ID);

                                this.order.Item = itemTemp;

                                //执行科室赋值 开立项目同时赋值执行科室
                                //----Edit By liangjz 07-03
                                if (itemTemp.ExecDept != null && itemTemp.ExecDept != "")
                                {
                                    this.order.ExeDept.ID = itemTemp.ExecDept;
                                }
                                else
                                {
                                    this.order.ExeDept = this.order.Patient.PVisit.PatientLocation.Dept.Clone();
                                }
                                //-----

                                //检查要求是否为空 暂时由此判断该项目为检查还是检验
                                if (itemTemp.SysClass.ID.ToString() == "UL")
                                {
                                    //设置复合项目明细所属大项编码、样本类型/检查部位
                                    this.order.Sample.Name = itemTemp.CheckBody;
                                }
                                else
                                {
                                    this.order.CheckPartRecord = itemTemp.CheckBody;
                                }
                            }
                            else
                            {
                                Neusoft.HISFC.Models.Fee.Item.Undrug itemTemp = null;
                                itemTemp        = (Neusoft.HISFC.Models.Fee.Item.Undrug) this.ucInputItem1.FeeItem;
                                this.order.Item = itemTemp;
                                //检查要求是否为空 暂时由此判断该项目为检查还是检验
                                if (itemTemp.SysClass.ID.ToString() == "UL")
                                {
                                    //设置复合项目明细所属大项编码、样本类型/检查部位
                                    this.order.Sample.Name = itemTemp.CheckBody;
                                }
                                else
                                {
                                    this.order.CheckPartRecord = itemTemp.CheckBody;
                                }
                                this.order.Item.MinFee.ID = "fh";
                            }
                        }
                        catch { MessageBox.Show("转换出错!", "ucItemSelect"); }
                    }
                }
            }
            catch { return; }


            //显示给界面
            if (ReadOrder(this.order) == -1)
            {
                return;
            }

            //设置医嘱开立时间
            Neusoft.FrameWork.Management.DataBaseManger manager = new Neusoft.FrameWork.Management.DataBaseManger();
            DateTime dtNow = manager.GetDateTimeFromSysDateTime();

            this.order.MOTime         = dtNow; //开立时间
            this.order.BeginTime      = dtNow; //开始时间
            this.order.Item.PriceUnit = this.cmbUnit.Text;
            this.order.Unit           = this.cmbUnit.Text;

            this.order.ReciptDept = ((Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator).Dept.Clone(); //开立科室
            this.order.Oper.ID    = Neusoft.FrameWork.Management.Connection.Operator.ID;                                                 //录入人
            this.order.Oper.Name  = Neusoft.FrameWork.Management.Connection.Operator.Name;

            //医嘱类型
            //this.order.OrderType = this.cmbOrderType1.alItems[this.cmbOrderType1.SelectedIndex] as Neusoft.HISFC.Models.Order.OrderType;


            if (this.txtQTY.Enabled)
            {
                this.txtQTY.Focus();//focus
                this.txtQTY.Select(0, this.txtQTY.Value.ToString().Length);
            }
            else
            {
                this.ucOrderInputByType1.Focus();
            }
            if (this.cmbUnit.Items.Count > 0)
            {
                this.cmbUnit.SelectedIndex = 0;    //默认选择第一个。
            }
            this.ucOrderInputByType1.IsNew = true; //新的

            //初始化新项目信息 设置医嘱频次用法

            if (this.order.Item.GetType() == typeof(Neusoft.HISFC.Models.Pharmacy.Item))
            {
                //this.order.Frequency.ID = "PRN";
                this.order.Usage.ID   = (this.order.Item as Neusoft.HISFC.Models.Pharmacy.Item).Usage.ID;
                this.order.Usage.Name = Order.Classes.Function.HelperUsage.GetName(this.order.Usage.ID);
            }
            else
            {
                //this.order.Frequency.ID = "QD";
            }

            if (this.order.HerbalQty == 0)
            {
                this.order.HerbalQty = 1;                //更新草药付数
            }
            this.ucOrderInputByType1.Order = this.order; //传递给选择类型
            dirty = true;
            this.myOrderChanged(this.order, EnumOrderFieldList.Item);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 数据显示
        /// </summary>
        /// <param name="alData"></param>
        /// <param name="drugBillClass"></param>
        public void ShowData(ArrayList alData, Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass)
        {
            if (ucDrugBillDetail.hsDept.Count == 0)
            {
                Neusoft.HISFC.BizLogic.Manager.Department deptManager = new Neusoft.HISFC.BizLogic.Manager.Department();
                ArrayList alDept = deptManager.GetDeptmentAll();
                foreach (Neusoft.HISFC.Models.Base.Department dept in alDept)
                {
                    ucDrugBillDetail.hsDept.Add(dept.ID, dept.Name);
                }
            }

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
            this.lbPrintTime.Text = "打印时间:" + dataManager.GetDateTimeFromSysDateTime().ToString();

            //this.lbPrintTime.Text = "打印时间:" + drugBillClass.Oper.OperTime.ToString();

            #region 对同一医嘱按用药时间组合显示

            DateTime dt = dataManager.GetDateTimeFromSysDateTime();

            string orderId = "";//必须得按医嘱流水号排序
            Neusoft.HISFC.Models.Pharmacy.ApplyOut objLast = null;
            //合并
            for (int i = alData.Count - 1; i >= 0; i--)
            {
                Neusoft.HISFC.Models.Pharmacy.ApplyOut obj = (alData[i] as Neusoft.HISFC.Models.Pharmacy.ApplyOut);
                if (orderId == "")
                {
                    orderId        = obj.OrderNO;
                    objLast        = obj;
                    objLast.User03 = this.FormatDateTime(Neusoft.FrameWork.Function.NConvert.ToDateTime(objLast.User03), dt);
                }
                else if (orderId == obj.OrderNO)    //是一个药
                {
                    objLast.User03 = objLast.User03 + " " + this.FormatDateTime(Neusoft.FrameWork.Function.NConvert.ToDateTime(obj.User03), dt);
                    //objLast.Operation.ApplyQty += obj.Operation.ApplyQty * obj.Days;//数量相加
                    alData.RemoveAt(i);
                }
                else
                {
                    orderId        = obj.OrderNO;
                    objLast        = obj;
                    objLast.User03 = this.FormatDateTime(Neusoft.FrameWork.Function.NConvert.ToDateTime(objLast.User03), dt);
                }
            }

            #endregion

            #region  患者排序

            //CompareApplyOut com = new CompareApplyOut();
            //alData.Sort(com);
            #endregion

            #region  患者床号和货位号排序{D9BE63EB-D955-48e2-A3A9-8FDB77BB3998}
            CompareBedPlaceNo comNew = new CompareBedPlaceNo();
            alData.Sort(comNew);
            #endregion

            this.SuspendLayout();

            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1_Sheet1)).BeginInit();

            string privPatient = "";

            int iRow = 0;

            //患者床号 姓名可以和药品同行,这个决定是否要新增一行显示药品
            bool isNeedAddRow = true;

            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alData)
            {
                if (ucDrugBillDetail.hsDept.ContainsKey(info.ApplyDept.ID))
                {
                    this.lbTitl.Text = "                       " + ucDrugBillDetail.hsDept[info.ApplyDept.ID] + drugBillClass.Name + "(明细)" + "      " + this.ifBPrint;
                }
                else
                {
                    this.lbTitl.Text = "                       " + info.ApplyDept.Name + drugBillClass.Name + "(明细)" + "      " + this.ifBPrint;
                }
                info.Item.NameCollection.RegularName = itemManager.GetItem(info.Item.ID).NameCollection.RegularName;//{8CA1AEE7-F038-4c32-BD3E-ECCC8DFE687B}
                isNeedAddRow = true;
                //{D515D71A-75B4-4c02-B2F7-569779A2A5A8}
                //string bedNO = info.User02;
                string bedNO = info.User02;
                if (bedNO.Length > 4)
                {
                    bedNO = bedNO.Substring(4);
                }
                //{D515D71A-75B4-4c02-B2F7-569779A2A5A8}
                //if (privPatient != "[" + bedNO + "]" + info.User01)
                if (privPatient != "[" + bedNO + "]" + info.User01)
                {
                    //添加一行新的患者信息

                    #region 换一个患者应该加一行{827FF133-63BC-40e3-8704-6E732D5116B1}
                    if (iRow != 0)
                    {
                        iRow++;
                    }
                    #endregion

                    //{D515D71A-75B4-4c02-B2F7-569779A2A5A8}
                    //privPatient = "[" + bedNO + "]" + info.User01;
                    privPatient = "[" + bedNO + "]" + info.User01;
                    this.neuSpread1_Sheet1.Rows.Add(iRow, 1);

                    this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColPatienName].Text = privPatient;

                    //添加住院号
                    //if (drugBillClass.Name == "退药单")
                    //    this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColPatienName].Text = privPatient + (info.PatientNO.ToString()).Substring(7);

                    isNeedAddRow = false;
                }

                if (isNeedAddRow)
                {
                    iRow++;
                    this.neuSpread1_Sheet1.Rows.Add(iRow, 1);
                    this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColPatienName].Text = "";
                }

                // "[" + (info.User02).Substring(4) + "]" + info.User01;
                //this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColTradeName].Text = info.Item.Name + "-" + Function.DrugDosage.GetStaticDosage(info.Item.ID);
                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColTradeName].Text = info.Item.NameCollection.RegularName + "(" + info.Item.Name + ")";
                char[] ca = this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColTradeName].Text.ToCharArray(); //{8CA1AEE7-F038-4c32-BD3E-ECCC8DFE687B}折行显示
                int    j  = System.Text.Encoding.Default.GetByteCount(ca, 0, ca.Length);
                if (j / 28 >= 1 && j % 28 == 0)                                                                  //大于一行并且正好等于下一行
                {
                    this.neuSpread1_Sheet1.Rows[iRow].Height = (j / 28) * Neusoft.FrameWork.Function.NConvert.ToInt32(this.neuSpread1_Sheet1.Rows.Default.Height);
                }
                else if (j / 28 >= 1 && j % 28 > 0)//大于一行,并且延伸到下一行
                {
                    this.neuSpread1_Sheet1.Rows[iRow].Height = ((j / 28) + 1) * Neusoft.FrameWork.Function.NConvert.ToInt32(this.neuSpread1_Sheet1.Rows.Default.Height);
                }
                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColSpecs].Text    = info.Item.Specs;
                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColUsage].Text    = info.Usage.Name;
                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColDoseOnce].Text = info.DoseOnce.ToString() + info.Item.DoseUnit.ToString();

                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColBaseDose].Text = info.Item.BaseDose.ToString();

                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColFrequency].Text = info.Frequency.ID;

                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColDays].Text        = info.Days.ToString();
                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColNum].Text         = info.Operation.ApplyQty.ToString();
                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColUnit].Text        = info.Item.MinUnit;
                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColRetailPrice].Text = info.Item.PriceCollection.RetailPrice.ToString();
                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColCost].Value       = (info.Operation.ApplyQty / info.Item.PackQty * info.Item.PriceCollection.RetailPrice);
                this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColPlace].Text       = info.PlaceNO;

                if (Neusoft.FrameWork.Public.String.ValidMaxLengh(info.User03, 16))
                {
                    this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColExeTime].Text = info.User03;
                }
                else
                {
                    string useTime = info.User03;
                    while (!Neusoft.FrameWork.Public.String.ValidMaxLengh(useTime, 15))
                    {
                        this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColExeTime].Text = useTime.Substring(0, 12);
                        useTime = useTime.Substring(12);
                        iRow++;
                        this.neuSpread1_Sheet1.Rows.Add(iRow, 1);
                        this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnsSet.ColExeTime].Text = useTime;
                    }
                }
            }

            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.neuSpread1_Sheet1)).EndInit();

            try
            {
                if (this.neuSpread1_Sheet1.Rows.Count > 0)
                {
                    int index = this.neuSpread1_Sheet1.Rows.Count;
                    this.neuSpread1_Sheet1.Rows.Add(index, 1);
                    this.neuSpread1_Sheet1.Cells[index, 0].ColumnSpan = 9;
                    this.neuSpread1_Sheet1.Cells[index, 11].Formula   = string.Format("SUM(M1:M{0})", index.ToString());
                    decimal totCost = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[index, 11].Text);
                    this.neuSpread1_Sheet1.Cells[index, 0].Text = "领药:         发药:          复核:           制表人:" + (Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee).Name + "      合计:" + totCost.ToString("N");

                    this.neuSpread1_Sheet1.Cells[index, 11].Text = "";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            this.ResumeLayout(true);
        }
Ejemplo n.º 15
0
        /// <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);
        }
Ejemplo n.º 16
0
        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);
        }
Ejemplo n.º 17
0
        public void AddAllData(System.Collections.ArrayList al)
        {
            System.Collections.Hashtable hsPatientApply = new System.Collections.Hashtable();

            #region  患者分组 将同一患者的所有申请集中在一起

            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in al)
            {
                if (hsPatientApply.ContainsKey(info.PatientNO))
                {
                    (hsPatientApply[info.PatientNO] as List <Neusoft.HISFC.Models.Pharmacy.ApplyOut>).Add(info);
                }
                else
                {
                    List <Neusoft.HISFC.Models.Pharmacy.ApplyOut> temp = new List <Neusoft.HISFC.Models.Pharmacy.ApplyOut>();
                    temp.Add(info);

                    hsPatientApply.Add(info.PatientNO, temp);
                }
            }

            #endregion

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger();
            DateTime sysTime = dataManager.GetDateTimeFromSysDateTime();

            this.lbPrintDate.Text = "打印时间:" + sysTime.ToString("HH:mi:ss");

            #region 患者打印 按患者打印每个患者的用药明细

            foreach (List <Neusoft.HISFC.Models.Pharmacy.ApplyOut> alPatient in hsPatientApply.Values)
            {
                if (alPatient.Count <= 0)
                {
                    break;
                }

                //按照用药时间点排序
                SortOrder sort = new SortOrder();
                alPatient.Sort(sort);

                #region Label信息显示

                Neusoft.HISFC.Models.Pharmacy.ApplyOut temp = alPatient[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut;
                if (deptHelper == null)
                {
                    DataInit();
                }
                if (deptHelper != null)
                {
                    this.lbDept.Text = deptHelper.GetName(temp.ApplyDept.ID);
                }
                else
                {
                    this.lbDept.Text = temp.ApplyDept.ID;
                }
                if (temp.User02.Length > 3)
                {
                    this.lbBed.Text = temp.User02.Substring(4);
                }
                else
                {
                    this.lbBed.Text = temp.User02;
                }
                this.lbName.Text      = "     " + temp.User01;
                this.lbPatientNO.Text = "     " + temp.PatientNO.Substring(4);

                #endregion

                string privUsePoint = "-1";

                this.neuSpread1_Sheet1.Rows.Count = 0;

                List <List <Neusoft.HISFC.Models.Pharmacy.ApplyOut> > patientList = new List <List <Neusoft.HISFC.Models.Pharmacy.ApplyOut> >();

                List <Neusoft.HISFC.Models.Pharmacy.ApplyOut> useList = new List <Neusoft.HISFC.Models.Pharmacy.ApplyOut>();

                int iCount = 1;
                foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut apply in alPatient)
                {
                    #region 对每个患者的 按照医嘱组合号、用药时间进行分组

                    if (privUsePoint == "-1")            //第一次添加
                    {
                        useList = new List <Neusoft.HISFC.Models.Pharmacy.ApplyOut>();
                        useList.Add(apply);

                        privUsePoint = apply.User03;
                        iCount       = 1;
                    }
                    else if (privUsePoint == apply.User03) //同一频次点的药品
                    {
                        if (iCount > 5)                    //第五个药品 需换页
                        {
                            patientList.Add(useList);

                            useList = new List <Neusoft.HISFC.Models.Pharmacy.ApplyOut>();
                            useList.Add(apply);
                            iCount = 1;
                        }
                        else
                        {
                            useList.Add(apply);
                            iCount++;
                        }
                    }
                    else                              //不同频次点的药品
                    {
                        patientList.Add(useList);

                        useList = new List <Neusoft.HISFC.Models.Pharmacy.ApplyOut>();
                        useList.Add(apply);
                        iCount = 1;

                        privUsePoint = apply.User03;
                    }

                    #endregion
                }

                if (useList.Count > 0)
                {
                    patientList.Add(useList);
                }

                //patientList.Count 为该患者的所有单据数
                int iPageNO = 1;
                foreach (List <Neusoft.HISFC.Models.Pharmacy.ApplyOut> singleList in patientList)
                {
                    this.neuSpread1_Sheet1.Rows.Count = 0;

                    foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut apply in singleList)
                    {
                        string useTime = this.FormatDateTime(Neusoft.FrameWork.Function.NConvert.ToDateTime(apply.User03), sysTime);

                        int iRowIndex = this.neuSpread1_Sheet1.Rows.Count;
                        this.neuSpread1_Sheet1.Rows.Add(iRowIndex, 1);
                        this.neuSpread1_Sheet1.Cells[iRowIndex, 0].Text = apply.Item.Name + "-" + Function.DrugDosage.GetStaticDosage(apply.Item.ID) + "[" + apply.Item.Specs + "]";
                        this.neuSpread1_Sheet1.Cells[iRowIndex, 1].Text = (apply.Operation.ApplyQty * apply.Days).ToString() + apply.Item.MinUnit;
                        this.neuSpread1_Sheet1.Cells[iRowIndex, 2].Text = useTime;

                        this.lbDate.Text = "         " + Neusoft.FrameWork.Function.NConvert.ToDateTime(apply.User03).ToString("yy-MM-dd");
                        this.lbTime.Text = "         " + useTime;
                        this.lbPage.Text = iPageNO.ToString() + " / " + patientList.Count.ToString();
                    }

                    this.Print();

                    iPageNO++;
                }

                //foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut apply in alPatient)
                //{
                //    if (privOrderID == "")                  //第一个药
                //    {
                //        privOrderID = apply.OrderNO;
                //        useTime = this.FormatDateTime(Neusoft.FrameWork.Function.NConvert.ToDateTime(apply.User03), sysTime);

                //        this.neuSpread1_Sheet1.Cells[iCount, 0].Text = apply.Item.Name + "-" + Function.DrugDosage.GetStaticDosage(apply.Item.ID) + "[" + apply.Item.Specs + "]";
                //        this.neuSpread1_Sheet1.Cells[iCount, 1].Text = "";
                //        this.neuSpread1_Sheet1.Cells[iCount, 2].Text = useTime;

                //        useList.Add(apply);
                //    }
                //    else if (privOrderID == apply.OrderNO)        //是一个药
                //    {
                //        useTime = useTime + this.FormatDateTime(Neusoft.FrameWork.Function.NConvert.ToDateTime(apply.User03), sysTime);
                //        this.neuSpread1_Sheet1.Cells[iCount, 2].Text = useTime;

                //        useList.Add(apply);
                //    }
                //    else                                    //不同的药品
                //    {
                //        if (iCount == this.MaxRows - 1)
                //        {
                //            #region 打印每个时间点明细

                //            this.PrintDetail(useList, sysTime);

                //            useList.Clear();

                //            #endregion

                //            this.Clear();
                //        }
                //        else
                //        {
                //            iCount++;

                //            privOrderID = apply.OrderNO;
                //            useTime = this.FormatDateTime(Neusoft.FrameWork.Function.NConvert.ToDateTime(apply.User03), sysTime);

                //            this.neuSpread1_Sheet1.Cells[iCount, 0].Text = apply.Item.Name + "-" + Function.DrugDosage.GetStaticDosage(apply.Item.ID) + "[" + apply.Item.Specs + "]";
                //            this.neuSpread1_Sheet1.Cells[iCount, 1].Text = "";
                //            this.neuSpread1_Sheet1.Cells[iCount, 2].Text = useTime;

                //            useList.Add(apply);
                //        }
                //    }
                //}

                //if (useList.Count > 0)
                //{
                //    this.PrintDetail(useList, sysTime);
                //}
            }

            #endregion
        }