Пример #1
0
        /// <summary>
        /// 如果已经审核或执行,则停止附材
        /// </summary>
        /// <returns></returns>
        public int DCSub(Neusoft.HISFC.Models.Order.Inpatient.Order order)
        {
            Neusoft.HISFC.BizLogic.Order.Order odManager = new Neusoft.HISFC.BizLogic.Order.Order();
            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(odManager.Connection);
            //t.BeginTransaction();
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            odManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            order.DCOper.ID     = this.Operator.ID;
            order.DCOper.Name   = this.Operator.Name;
            order.EndTime       = odManager.GetDateTimeFromSysDateTime();
            order.Status        = 3;
            order.DcReason.Name = "护士站审核查询停止";
            if (odManager.DcOneOrder(order) == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                MessageBox.Show("删除医嘱失败!" + odManager.Err);
                return(-1);
            }
            Neusoft.FrameWork.Management.PublicTrans.Commit();
            return(0);
        }
Пример #2
0
        /// <summary>
        /// 数据打印
        /// </summary>
        /// <returns></returns>
        protected virtual int Print()
        {
            #region 管理变量

            ArrayList al = new ArrayList();                                                             //数值数组
            Neusoft.HISFC.BizLogic.Order.Order orderManager = new Neusoft.HISFC.BizLogic.Order.Order(); //管理类

            #endregion

            foreach (Control c in this.panelContainer.Controls)
            {
                #region 事务设置

                //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(orderManager.Connection);
                //t.BeginTransaction();
                //orderManager.SetTrans(t.Trans);
                //itemManager.SetTrans(t.Trans);

                Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
                orderManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

                #endregion

                if (((ucLisApplyControl)c).IsSelected)//选择打印的检验单
                {
                    #region 打印状态更新

                    al.Add(((ucLisApplyControl)c).ControlValue);

                    //添加控制打印条码	//置打印标记	//保存检验条码
                    Neusoft.HISFC.Models.RADT.PatientInfo p = ((ucLisApplyControl)c).ControlValue as Neusoft.HISFC.Models.RADT.PatientInfo;

                    List <Neusoft.HISFC.Models.Order.ExecOrder> execList = null;
                    if (this.ILisDBInstance != null)
                    {
                        execList = new List <ExecOrder>();
                    }

                    try
                    {
                        string[] strExeOrderID = p.User01.Split(',');
                        for (int m = 0; m < strExeOrderID.Length; m++)
                        {
                            #region 如果ILisDB接口已实现 则获取医嘱执行档信息

                            if (this.ILisDBInstance != null)
                            {
                                Neusoft.HISFC.Models.Order.ExecOrder exeOrder = orderManager.QueryExecOrderByExecOrderID(strExeOrderID[m], "2");
                                if (exeOrder == null)
                                {
                                    //t.RollBack();
                                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                    MessageBox.Show("获得执行档信息出错!" + orderManager.Err);
                                    return(-1);
                                }

                                execList.Add(exeOrder);
                            }

                            #endregion

                            #region 更新本地医嘱信息
                            if (orderManager.UpdateExecOrderLisBarCode(strExeOrderID[m], "") == -1)
                            {
                                //t.RollBack();
                                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                MessageBox.Show("无法更新条码!" + orderManager.Err);
                                return(-1);
                            }
                            if (orderManager.UpdateExecOrderLisPrint(strExeOrderID[m]) == -1)//更新巡回卡打印标记
                            {
                                //t.RollBack();
                                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                MessageBox.Show("无法更新打印标记!" + orderManager.Err);
                                return(-1);
                            }
                            #endregion
                        }

                        #region 如果ILisDB接口已实现 则传输Lis数据

                        if (this.ILisDBInstance != null)
                        {
                            string err = "";
                            if (this.ILisDBInstance.TransDataToLisDB(p, execList, ref err) == -1)
                            {
                                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                MessageBox.Show(p.Name + " 患者的Lis数据传输失败!  " + err);
                                return(-1);
                            }
                        }

                        #endregion
                    }
                    catch (Exception ex)
                    {
                        //t.RollBack();
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("无法打印条码!" + ex.Message);
                        return(-1);
                    }

                    #endregion
                }

                //t.Commit();
                Neusoft.FrameWork.Management.PublicTrans.Commit();
            }

            #region 打印检验申请单

            Panel panel = new Panel();
            panel.BackColor = Color.White;

            if (al.Count > 0) //打印
            {
                ArrayList alNew = new ArrayList();
                foreach (Neusoft.HISFC.Models.RADT.PatientInfo pa in al)//查询数量,打印多张检验申请单
                {
                    string strLisID = "";
                    for (int i = 0; i < Neusoft.FrameWork.Function.NConvert.ToInt32(pa.PVisit.Memo); i++)
                    {
                        if (strLisID == "")
                        {
                            strLisID = pa.User01;
                        }

                        pa.User01 = strLisID + "-" + (i + 1).ToString();

                        alNew.Add(pa.Clone());
                    }
                }

                Neusoft.FrameWork.WinForms.Classes.Function.AddControlToPanel(alNew, this.printControl, panel, new System.Drawing.Size(800, 353), 1);

                Neusoft.FrameWork.WinForms.Classes.Print p = new Neusoft.FrameWork.WinForms.Classes.Print();
                try
                {
                    Control c = panel;

                    p.SetPageSize(new System.Drawing.Printing.PaperSize("", 800, 1000));
                    //Neusoft.UFC.Common.Classes.Function.GetPageSize("jyd", ref p);

                    p.IsPrintBackImage = false;
                    p.PrintPreview(8, 1, c);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                this.Query();

                return(0);
            }
            else //没选择不打印
            {
                return(-1);
            }

            #endregion
        }