Exemplo n.º 1
0
        /// <summary>
        /// 插入医嘱打印信息
        /// </summary>
        /// <param name="orderBill"></param>
        /// <returns></returns>
        public int InsertOrderBill(Neusoft.HISFC.Models.Order.OrderBill orderBill)
        {
            string strSql = "";

            if (this.Sql.GetSql("Order.OrderPrn.InsertOderBill", ref strSql) == -1)
            {
                this.Err = this.Sql.Err;
                return(-1);
            }
            System.Object[] s =
            {
                orderBill.Order.Patient.ID,
                orderBill.PrintSequence,
                orderBill.Order.ID,
                orderBill.PageNO,
                orderBill.LineNO,
                Neusoft.FrameWork.Function.NConvert.ToInt32(orderBill.Order.OrderType.IsDecompose),
                orderBill.PrintFlag,
                orderBill.Order.Combo.ID,
                orderBill.PrintDCFlag,
                orderBill.Oper.ID,
                orderBill.Oper.OperTime
            };
            try
            {
                strSql = string.Format(strSql, s);
            }
            catch
            {
                this.Err = "sql格式化错误";
                return(-1);
            }

            return(this.ExecNoQuery(strSql));
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="OrderNo"></param>
        /// <param name="orderBill"></param>
        /// <returns></returns>
        public int UpdateOderBill(string OrderNo, Neusoft.HISFC.Models.Order.OrderBill orderBill)
        {
            string strSql = "";

            if (this.Sql.GetSql("Order.OrderPrn.UpdateOderBill", ref strSql) == -1)
            {
                this.Err = "获得sql语句出错" + this.Sql.Err + this.Err;
                return(-1);
            }
            try
            {
                strSql = string.Format(strSql, OrderNo, orderBill.PrintFlag, orderBill.PrintSequence, orderBill.PageNO, orderBill.LineNO);
            }
            catch
            {
                this.Err = "sql语句格式化错误" + this.Err;
                return(-1);
            }
            return(this.ExecNoQuery(strSql));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获得医嘱打印信息
        /// </summary>
        /// <param name="inpatientNo">住院流水号</param>
        /// <param name="prnFlag">打印标志(0未打印,1已打印)</param>
        /// <returns>医嘱打印信息</returns>
        public ArrayList GetOrderBill(string inpatientNo, string prnFlag)
        {
            ArrayList al     = new ArrayList();
            string    strSql = "";

            if (this.Sql.GetSql("Order.OrderPrn.GetOderBill", ref strSql) == -1)
            {
                this.Err = this.Sql.Err;
                return(null);
            }
            try
            {
                strSql = string.Format(strSql, inpatientNo, prnFlag);
            }
            catch (Exception ex)
            {
                this.Err = ex.Message;
                return(null);
            }
            if (this.ExecQuery(strSql) == -1)
            {
                this.Err = "获得医嘱打印信息" + this.Err;
                return(null);
            }
            Neusoft.HISFC.Models.Order.OrderBill orderBill;
            try
            {
                while (this.Reader.Read())
                {
                    try
                    {
                        orderBill = new Neusoft.HISFC.Models.Order.OrderBill();
                        orderBill.Order.Patient.ID   = this.Reader[0].ToString();
                        orderBill.PrintSequence      = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[1].ToString());
                        orderBill.Order.ID           = this.Reader[2].ToString();
                        orderBill.PageNO             = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[3].ToString());
                        orderBill.LineNO             = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[4].ToString());
                        orderBill.Order.OrderType.ID = this.Reader[5].ToString();
                        orderBill.PrintFlag          = this.Reader[6].ToString();
                        orderBill.Order.Combo.ID     = this.Reader[7].ToString();
                        orderBill.PrintDCFlag        = this.Reader[8].ToString();
                        orderBill.Oper.ID            = this.Reader[9].ToString();
                        orderBill.Oper.OperTime      = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[10].ToString());
                    }
                    catch (Exception ex)
                    {
                        this.Err = "获得医嘱打印信息出错" + ex.Message;
                        this.Reader.Close();
                        return(null);
                    }
                    al.Add(orderBill);
                }
            }
            catch (Exception ex)
            {
                this.Err = "获得医嘱打印信息出错" + ex.Message;
                this.Reader.Close();
                return(null);
            }
            this.Reader.Close();
            return(al);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 打印
        /// </summary>
        private void PrintOrder()
        {
            Neusoft.FrameWork.WinForms.Classes.Print pf = new Neusoft.FrameWork.WinForms.Classes.Print();

            if (this.tabControl1.SelectedIndex == 0)
            {
                //pf.PageLabel = (Control)this.lblPage;
                this.SetLongRePrint(false);
                //this.sheetLong.RowCount = 0;
                int pageCount = Neusoft.FrameWork.Function.NConvert.ToInt32(alLongPrint.Count / this.intLineNum);
                for (int iPage = 0; iPage < pageCount; iPage++)
                {
                    Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

                    orderBillManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
                    this.sheetLong.RowCount = 0;
                    bool needPrint = false;
                    for (int i = 0; i < intLineNum; i++)
                    {
                        sheetLong.Rows.Add(i, 1);
                        Neusoft.HISFC.Models.Order.Inpatient.Order ord = null;

                        try
                        {
                            ord = alLongPrint[i + iPage * intLineNum] as Neusoft.HISFC.Models.Order.Inpatient.Order;
                        }
                        catch
                        { }
                        if (ord != null && ord.ID != null && ord.ID != "")
                        {
                            Neusoft.HISFC.Models.Order.OrderBill orderBill = new Neusoft.HISFC.Models.Order.OrderBill();
                            orderBill = orderBillManager.GetOrderBillByOrderID(ord.ID);
                            if (Neusoft.FrameWork.Function.NConvert.ToBoolean(orderBill.PrintFlag))
                            {
                                this.sheetLong.SetValue(i, 0, "");
                                this.sheetLong.SetValue(i, 1, "");
                                this.sheetLong.SetValue(i, 2, "");
                                this.sheetLong.SetValue(i, 3, "");
                                this.sheetLong.SetValue(i, 4, "");
                                this.sheetLong.SetValue(i, 5, "");
                                this.sheetLong.SetValue(i, 6, "");
                                this.sheetLong.SetValue(i, 7, "");
                                this.sheetLong.SetValue(i, 8, "");
                                this.sheetLong.SetValue(i, 9, "");
                                this.sheetLong.SetValue(i, 10, "");
                            }
                            else
                            {
                                needPrint = true;
                                this.sheetLong.SetValue(i, 0, ord.BeginTime.Month.ToString() + "." + ord.BeginTime.Day.ToString());//.ToShortDateString());
                                sheetLong.SetValue(i, 1, ord.BeginTime.ToShortTimeString());
                                sheetLong.SetValue(i, 2, ord.Item.Name + "  " + ord.Frequency.Name + "  " + ord.Usage.Name);
                                sheetLong.SetValue(i, 3, ord.ReciptDoctor.Name);
                                sheetLong.SetValue(i, 4, ord.Nurse.Name);
                                sheetLong.SetValue(i, 5, ord.ConfirmTime);

                                if (ord.EndTime != DateTime.MinValue)
                                {
                                    sheetLong.SetValue(i, 6, ord.EndTime.Month.ToString() + "." + ord.EndTime.Day.ToString());
                                    sheetLong.SetValue(i, 7, ord.EndTime.ToShortTimeString());//.ExecOper.OperTime.ToShortTimeString());
                                    sheetLong.SetValue(i, 8, ord.DCOper.Name);
                                    sheetLong.SetValue(i, 9, ord.ExecOper.Name);
                                    sheetLong.SetValue(i, 10, ord.ExecOper.OperTime.ToShortTimeString());
                                }
                                else
                                {
                                    this.sheetLong.SetValue(i, 6, "");
                                    this.sheetLong.SetValue(i, 7, "");
                                    this.sheetLong.SetValue(i, 8, "");
                                    this.sheetLong.SetValue(i, 9, "");
                                    this.sheetLong.SetValue(i, 10, "");
                                }

                                int myLineNo = 0;
                                int myPageNo = 0;
                                int myPrnSeq = 0;
                                this.orderBillManager.GetLastOrderBillArg(this.pInfo.ID, orderBill.Order.OrderType.ID, out myPrnSeq, out myPageNo, out myLineNo);

                                if (myPageNo > 0)
                                {
                                    if (myLineNo < this.intLineNum)
                                    {
                                        myLineNo = i + 1;
                                    }
                                    else
                                    {
                                        myLineNo = i + 1;
                                        myPageNo = iPage + 1;
                                        this.SetLongRePrint(true);
                                    }
                                }
                                else
                                {
                                    myLineNo = i + 1;
                                    myPageNo = 1;
                                    this.SetLongRePrint(true);
                                }
                                if (Neusoft.FrameWork.Function.NConvert.ToBoolean(orderBill.PrintDCFlag) && orderBill.PageNO > 0)
                                {
                                    this.sheetLong.SetValue(i, 0, "");
                                    this.sheetLong.SetValue(i, 1, "");
                                    this.sheetLong.SetValue(i, 2, "");
                                    this.sheetLong.SetValue(i, 3, "");
                                    this.sheetLong.SetValue(i, 4, "");
                                    this.sheetLong.SetValue(i, 5, "");
                                }
                                if (orderBill.PageNO == 0)
                                {
                                    if (orderBillManager.UpdateLineNoPageNo(ord.ID, myLineNo, myPageNo) < 0)
                                    {
                                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                        MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单行号、页码失败!" + orderBillManager.Err));
                                        return;
                                    }
                                }

                                if (orderBillManager.UpdatePrnFlag(ord.ID, "1") < 0)
                                {
                                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单打印标志失败!" + orderBillManager.Err));
                                    return;
                                }
                            }
                        }
                        else
                        {
                            this.sheetLong.SetValue(i, 0, "");
                            this.sheetLong.SetValue(i, 1, "");
                            this.sheetLong.SetValue(i, 2, "");
                            this.sheetLong.SetValue(i, 3, "");
                            this.sheetLong.SetValue(i, 4, "");
                            this.sheetLong.SetValue(i, 5, "");
                            this.sheetLong.SetValue(i, 6, "");
                            this.sheetLong.SetValue(i, 7, "");
                            this.sheetLong.SetValue(i, 8, "");
                            this.sheetLong.SetValue(i, 9, "");
                            this.sheetLong.SetValue(i, 10, "");
                        }
                    }
                    //this.neuLabel15.Text = "第";
                    //this.neuLabel19.Text = "页";
                    this.lblPage.Text = "第" + (iPage + 1).ToString() + "页";
                    if (needPrint)
                    {
                        pf.PrintPreview(this.plLong);
                    }
                    Neusoft.FrameWork.Management.PublicTrans.Commit();
                }
            }
            else
            {
                //pf.PageLabel = (Control)this.lblPages;
                this.SetShortRePrint(false);
                this.sheetShort.RowCount = 0;
                int pageCount = Neusoft.FrameWork.Function.NConvert.ToInt32(alShortPrint.Count / this.intLineNum);
                for (int iPage = 0; iPage < pageCount; iPage++)
                {
                    Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

                    orderBillManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
                    bool needPrint = false;
                    for (int i = 0; i < intLineNum; i++)
                    {
                        sheetShort.Rows.Add(i, 1);
                        Neusoft.HISFC.Models.Order.Inpatient.Order ord = null;

                        try
                        {
                            ord = alShortPrint[i + iPage * intLineNum] as Neusoft.HISFC.Models.Order.Inpatient.Order;
                        }
                        catch
                        { }

                        if (ord != null && ord.ID != null && ord.ID != "")
                        {
                            Neusoft.HISFC.Models.Order.OrderBill orderBill = new Neusoft.HISFC.Models.Order.OrderBill();
                            orderBill = orderBillManager.GetOrderBillByOrderID(ord.ID);
                            if (Neusoft.FrameWork.Function.NConvert.ToBoolean(orderBill.PrintFlag))
                            {
                                this.sheetShort.SetValue(i, 0, "");
                                this.sheetShort.SetValue(i, 1, "");
                                this.sheetShort.SetValue(i, 2, "");
                                this.sheetShort.SetValue(i, 3, "");
                                this.sheetShort.SetValue(i, 4, "");
                                this.sheetShort.SetValue(i, 5, "");
                                this.sheetShort.SetValue(i, 6, "");
                                this.sheetShort.SetValue(i, 7, "");
                                this.sheetShort.SetValue(i, 8, "");
                            }
                            else
                            {
                                needPrint = true;
                                sheetShort.Rows.Add(i, 1);
                                this.sheetShort.SetValue(i, 0, ord.BeginTime.ToShortDateString());
                                sheetShort.SetValue(i, 1, ord.BeginTime.ToShortTimeString());
                                sheetShort.SetValue(i, 2, ord.Item.Name + "  " + ord.Frequency.Name + "  " + ord.Usage.Name);
                                sheetShort.SetValue(i, 3, ord.ReciptDoctor.Name);
                                sheetShort.SetValue(i, 4, ord.BeginTime);
                                sheetShort.SetValue(i, 5, ord.ExecOper.Name);
                                sheetShort.SetValue(i, 6, ord.EndTime.ToShortDateString());
                                sheetShort.SetValue(i, 7, ord.EndTime.ToShortTimeString());

                                int myLineNo = 0;
                                int myPageNo = 0;
                                int myPrnSeq = 0;
                                this.orderBillManager.GetLastOrderBillArg(this.pInfo.ID, orderBill.Order.OrderType.ID, out myPrnSeq, out myPageNo, out myLineNo);

                                if (myPageNo > 0)
                                {
                                    if (i < this.intLineNum)
                                    {
                                        myLineNo = i + 1;
                                    }
                                    else
                                    {
                                        myLineNo = i + 1;
                                        myPageNo = iPage + 1;
                                        this.SetShortRePrint(true);
                                    }
                                }
                                else
                                {
                                    myLineNo = i + 1;
                                    myPageNo = 1;
                                    this.SetShortRePrint(true);
                                }
                                if (orderBill.PageNO == 0)
                                {
                                    if (orderBillManager.UpdateLineNoPageNo(ord.ID, myLineNo, myPageNo) < 0)
                                    {
                                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                        MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单行号、页码失败!" + orderBillManager.Err));
                                        return;
                                    }
                                }
                                if (orderBillManager.UpdatePrnFlag(ord.ID, "1") < 0)
                                {
                                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单打印标志失败!" + orderBillManager.Err));
                                    return;
                                }
                            }
                        }
                        else
                        {
                            this.sheetShort.SetValue(i, 0, "");
                            this.sheetShort.SetValue(i, 1, "");
                            this.sheetShort.SetValue(i, 2, "");
                            this.sheetShort.SetValue(i, 3, "");
                            this.sheetShort.SetValue(i, 4, "");
                            this.sheetShort.SetValue(i, 5, "");
                            this.sheetShort.SetValue(i, 6, "");
                            this.sheetShort.SetValue(i, 7, "");
                            this.sheetShort.SetValue(i, 8, "");

                            this.SetShortRePrint(false);
                        }
                    }
                    this.lblPages.Text = "第" + (iPage + 1).ToString() + "页";
                    if (needPrint)
                    {
                        pf.PrintPreview(this.plShort);
                    }
                    Neusoft.FrameWork.Management.PublicTrans.Commit();
                }
            }

            this.SetShortRePrint(true);
            this.SetLongRePrint(true);
            this.SetPatient(this.pInfo);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 续打
        /// </summary>
        /// <param name="patientInfo"></param>
        public void SetPatientOn(Neusoft.HISFC.Models.RADT.PatientInfo patientInfo)
        {
            #region 初始化数据窗口
            //this.dwLongOrder.LibraryList = @"Report\met_ord.pbl;Report\met_ord.pbd";
            //this.dwShortOrder.LibraryList = @"Report\met_ord.pbl;Report\met_ord.pbd";
            //this.dwLongOrder.DataWindowObject = "d_longorderon_print";
            //this.dwShortOrder.DataWindowObject = "d_shortorderon_print";
            pInfo = patientInfo;
            #endregion

            //Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在查询显示续打医嘱信息,请稍候......");
            #region 查询打印和没有打印的医嘱
            Application.DoEvents();
            //存储打印过的医嘱
            ArrayList alPrinted = new ArrayList();
            //存储没有打印的医嘱
            ArrayList alNoPrint = new ArrayList();
            ArrayList alAll     = new ArrayList();

            try
            {
                //已经打印的医嘱
                alPrinted = this.myfun.QueryDcOrder(patientInfo.ID, "1");
                //没有打印的医嘱
                alNoPrint = this.myfun.QueryDcOrder(patientInfo.ID, "0");
            }
            catch
            {
                //Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
            }
            //存储没有打印过的长期和临时医嘱
            alLong1.Clear();
            alShort1.Clear();
            alLong.Clear();
            alShort.Clear();

            #endregion

            #region 打印过的医嘱区分长期医嘱和临时医嘱
            if (alPrinted != null)
            {
                Neusoft.HISFC.Models.Order.Inpatient.Order order     = null;
                Neusoft.HISFC.Models.Order.OrderBill       orderbill = null;
                foreach (object obj in alPrinted)
                {
                    order = obj as Neusoft.HISFC.Models.Order.Inpatient.Order;
                    if (order.Status == 0)
                    {
                        continue;
                    }
                    orderbill = this.orderBillMgr.GetOrderBillByOrderID(order.ID);
                    if (orderbill != null)
                    {
                        order.User01 = orderbill.PrintDCFlag;
                        order.User03 = orderbill.PrintFlag;
                    }
                    else
                    {
                        order.User01 = "0";
                        order.User03 = "0";
                    }
                    if (order.OrderType.Type == Neusoft.HISFC.Models.Order.EnumType.LONG)
                    {
                        //长期医嘱
                        alLong.Add(order);
                    }
                    else
                    {
                        //临时医嘱
                        alShort.Add(order);
                    }
                }
            }
            #endregion

            #region 没有打印过的医嘱区分长期医嘱和临时医嘱
            if (alNoPrint != null)
            {
                Neusoft.HISFC.Models.Order.Inpatient.Order order     = null;
                Neusoft.HISFC.Models.Order.OrderBill       orderbill = null;
                foreach (object obj in alNoPrint)
                {
                    order     = obj as Neusoft.HISFC.Models.Order.Inpatient.Order;
                    orderbill = this.orderBillMgr.GetOrderBillByOrderID(order.ID);
                    if (orderbill != null)
                    {
                        order.User01 = orderbill.PrintDCFlag;
                    }
                    else
                    {
                        order.User01 = "0";
                    }
                    //order.User03 = orderbill.PrintFlag;
                    if (order.Status == 0)
                    {
                        continue;
                    }
                    if (order.OrderType.Type == Neusoft.HISFC.Models.Order.EnumType.LONG)
                    {
                        //长期医嘱
                        alLong1.Add(order);
                    }
                    else
                    {
                        //临时医嘱
                        alShort1.Add(order);
                    }
                }
            }
            #endregion

            #region 续打开始
            //上次打印到的行数 25倍的 整数倍取余数
            int longleave  = 0;
            int shortleave = 0;

            //取余
            longleave  = alLong.Count % orderline;
            shortleave = alShort.Count % orderline;

            //本次应该打印到的页数
            this.longordercurrentpage  = alLong.Count / orderline + 1;
            this.shortordercurrentpage = alShort.Count / orderline + 1;

            ArrayList alLongTemp  = new ArrayList();
            ArrayList alShortTemp = new ArrayList();
            if (longleave >= 0)
            {
                alLongTemp = alLong.GetRange(alLong.Count - longleave, longleave);
            }
            if (shortleave >= 0)
            {
                alShortTemp = alShort.GetRange(alShort.Count - shortleave, shortleave);
            }
            alLongTemp.AddRange(alLong1);
            alShortTemp.AddRange(alShort1);
            #endregion

            #region 显示打印
            if (this.tabControl1.SelectedIndex == 0)
            {
                AddDataToLongOrder(alLongTemp, "1");
            }
            else
            {
                AddDataToShortOrder(alShortTemp, "1");
            }
            #endregion

            //Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
        }
Exemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="patientInfo"></param>
        public void SetPatient(Neusoft.HISFC.Models.RADT.PatientInfo patientInfo)
        {
            #region 初始化 数据窗口
            this.dwLongOrder.LibraryList       = @"Report\met_ord.pbl;Report\met_ord.pbd";
            this.dwShortOrder.LibraryList      = @"Report\met_ord.pbl;Report\met_ord.pbd";
            this.dwLongOrder.DataWindowObject  = "d_longorder_print";
            this.dwShortOrder.DataWindowObject = "d_shortorder_print";
            #endregion
            #region 初始化全部医嘱
            pInfo = patientInfo;

            Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在查询显示医嘱信息,请稍候......");
            Application.DoEvents();
            ArrayList alAll = new ArrayList();
            try
            {
                alAll = this.myfun.QueryDcOrder(patientInfo.ID);
            }
            catch
            {
                Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
            }

            alLong.Clear();
            alShort.Clear();

            if (alAll != null)
            {
                foreach (object obj in alAll)
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order order = obj as Neusoft.HISFC.Models.Order.Inpatient.Order;
                    if (order.Status == 0)
                    {
                        continue;
                    }
                    //停止标志是否打印过
                    Neusoft.HISFC.Models.Order.OrderBill orderBill = null;
                    orderBill = this.orderBillMgr.GetOrderBillByOrderID(order.ID);
                    if (orderBill != null)
                    {
                        order.User01 = orderBill.PrintDCFlag;
                        //order.User03 = orderBill.PrintFlag;
                    }
                    else
                    {
                        order.User01 = "0";
                        //order.User03 = "0";
                    }
                    if (order.OrderType.Type == Neusoft.HISFC.Models.Order.EnumType.LONG)
                    {
                        //长期医嘱
                        alLong.Add(obj);
                    }
                    else
                    {
                        //临时医嘱
                        alShort.Add(obj);
                    }
                }
            }
            #endregion
            #region 分长期和临时写入数据窗口
            if (this.tabControl1.SelectedIndex == 0)
            {
                AddDataToLongOrder(alLong, "0");
            }
            else
            {
                AddDataToShortOrder(alShort, "0");
            }


            Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
            #endregion
        }