Пример #1
0
        /// <summary>
        /// 在节点集合内查找是否已存在该类型节点 如果存在 则返回该节点
        /// </summary>
        /// <param name="info">摆药通知信息</param>
        /// <param name="nodeCollection">查找的节点集合</param>
        /// <param name="findType">查找类别 0 科室 1 单据</param>
        /// <returns>成功则返回该类型节点 不存在返回null</returns>
        private DrugMessageTreeNode FindNode(Neusoft.HISFC.Models.Pharmacy.DrugMessage info, TreeNodeCollection nodeCollection, string findType)
        {
            if (nodeCollection == null || nodeCollection.Count == 0)
            {
                return(null);
            }
            foreach (DrugMessageTreeNode node in nodeCollection)
            {
                switch (findType)
                {
                case "0":
                    if ((node.Tag as Neusoft.HISFC.Models.Pharmacy.DrugMessage).ApplyDept.ID == info.ApplyDept.ID)
                    {
                        return(node);
                    }
                    break;

                case "1":
                    if ((node.Tag as Neusoft.HISFC.Models.Pharmacy.DrugMessage).DrugBillClass.ID == info.DrugBillClass.ID)
                    {
                        return(node);
                    }
                    break;
                }
            }
            return(null);
        }
Пример #2
0
        /// <summary>
        /// 对用户确认的出库申请数组进行发药处理(打印摆药单)
        /// writed by cuipeng
        /// 2005-1
        /// 操作如下:
        /// 1、如果该记录未计费,则
        ///		确定摆药是否对药品数量取整(只对每次量取整),确定数量。
        ///		取最新的药品基本信息
        ///	2、更新医嘱执行档(摆药确认信息)
        ///	3、更新药嘱主档的最新的执行信息
        ///	4、如果摆药的同时需要出库则处理出库数据,否则,只确认不处理出库数据
        ///	5、更新出库申请表中的摆药信息
        ///	6、如果全部核准,则更新摆药通知信息。否则不更新摆药通知信息
        ///	摆药后产生的摆药单保存在drugMessage.DrugBillClass.Memo中
        /// </summary>
        /// <param name="arrayApplyOut">出库申请信息</param>
        /// <param name="drugMessage">摆药通知,用来更新摆药通知(摆药后产生的摆药单保存在drugMessage.DrugBillClass.Memo中)</param>
        /// <returns>1成功,-1失败</returns>
        internal static int DrugConfirm(ArrayList arrayApplyOut, Neusoft.HISFC.Models.Pharmacy.DrugMessage drugMessage, Neusoft.FrameWork.Models.NeuObject arkDept, Neusoft.FrameWork.Models.NeuObject approveDept)
        {
            string noPrivPatient = "";

            if (JudgeInStatePatient(arrayApplyOut, null, ref noPrivPatient) == -1)
            {
                System.Windows.Forms.MessageBox.Show("判断患者状态信息发生错误");
                return(-1);
            }
            if (noPrivPatient != "")
            {
                System.Windows.Forms.MessageBox.Show(noPrivPatient);
                return(-1);
            }
            //对申请项目按照项目编码排序 减少资源死锁的发生几率 {1B35A424-0127-42ff-96A4-6835D5DB0151}
            Neusoft.HISFC.BizProcess.Integrate.PharmacyMethod.SortApplyOutByItemCode(ref arrayApplyOut);

            Neusoft.HISFC.BizProcess.Integrate.Pharmacy pharmacyIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy();
            if (pharmacyIntegrate.InpatientDrugConfirm(arrayApplyOut, drugMessage, arkDept, approveDept) != 1)
            {
                System.Windows.Forms.MessageBox.Show(pharmacyIntegrate.Err);
                return(-1);
            }
            return(1);
        }
Пример #3
0
        /// <summary>
        /// 获取摆药单列表显示时的摆药单节点
        /// </summary>
        /// <param name="info">摆药通知信息</param>
        /// <param name="nodeDept">父级节点</param>
        /// <returns>成功返回摆药单列表显示时的摆药单节点</returns>
        private DrugMessageTreeNode GetNodeBill(Neusoft.HISFC.Models.Pharmacy.DrugMessage info, DrugMessageTreeNode parentNode)
        {
            //{22E638FE-2821-4bdf-A8A9-5BD25D51742E}  数据校验 避免parentNode为null
            if (parentNode != null)
            {
                foreach (DrugMessageTreeNode childNode in parentNode.Nodes)
                {
                    if (childNode.Text == info.DrugBillClass.Name)
                    {
                        return(childNode);
                    }
                }
            }

            DrugMessageTreeNode nodeBill = new DrugMessageTreeNode();

            nodeBill.Text               = info.DrugBillClass.Name;
            nodeBill.ImageIndex         = 4;
            nodeBill.SelectedImageIndex = 5;
            nodeBill.Tag      = info;
            nodeBill.NodeType = DrugMessageNodeType.DrugBill;
            if (parentNode == null)
            {
                this.Nodes.Add(nodeBill);
            }
            else
            {
                parentNode.Nodes.Add(nodeBill);         //添加到科室节点
            }
            return(nodeBill);
        }
Пример #4
0
        public virtual int AutoSave(Neusoft.HISFC.Models.Pharmacy.DrugMessage drugMessage)
        {
            //检索科室摆药申请明细数据
            ArrayList al = this.itemManager.QueryApplyOutList(drugMessage);

            if (al == null)
            {
                MessageBox.Show(Language.Msg("根据摆药通知信息获取摆药申请明细信息发生错误 ") + this.itemManager.Err);
                return(-1);
            }
            if (drugMessage.DrugBillClass.ID == "R")
            {
                if (DrugStore.Function.DrugReturnConfirm(al, drugMessage, this.StockMarkDept, this.approveDept) != 1)
                {
                    return(-1);
                }
            }
            else
            {
                if (DrugStore.Function.DrugConfirm(al, drugMessage, this.StockMarkDept, this.approveDept) != 1)
                {
                    return(-1);
                }
            }

            return(1);
        }
Пример #5
0
 /// <summary>
 /// 对退药申请进行核准处理(退药核准)
 /// writed by cuipeng
 /// 2005-3
 /// 操作如下:
 /// 1、出库处理,返回出库流水号。
 /// 2、如果退药的同时退费,则处理费用信息
 /// 3、核准出库申请,将摆药状态由“0”改成ApplyState。
 /// 4、取费用信息
 /// 5、进行退费申请
 /// 6、如果全部核准,则更新摆药通知信息。否则不更新摆药通知信息
 /// 摆药后产生的摆药单保存在drugMessage.DrugBillClass.Memo中
 /// </summary>
 /// <param name="arrayApplyOut">出库申请信息</param>
 /// <param name="drugMessage">摆药通知,用来更新摆药通知(摆药后产生的摆药单保存在drugMessage.DrugBillClass.Memo中)</param>
 /// <returns>1成功,-1失败</returns>
 internal static int DrugReturnConfirm(ArrayList arrayApplyOut, Neusoft.HISFC.Models.Pharmacy.DrugMessage drugMessage, Neusoft.FrameWork.Models.NeuObject arkDept, Neusoft.FrameWork.Models.NeuObject approveDept)
 {
     Neusoft.HISFC.BizProcess.Integrate.Pharmacy pharmacyIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy( );
     if (pharmacyIntegrate.InpatientDrugReturnConfirm(arrayApplyOut, drugMessage, arkDept, approveDept) != 1)
     {
         System.Windows.Forms.MessageBox.Show(pharmacyIntegrate.Err);
         return(-1);
     }
     return(1);
 }
Пример #6
0
        /// <summary>
        /// 克隆函数
        /// </summary>
        /// <returns>成功返回当前实例副本</returns>
        public new DrugMessage Clone()
        {
            DrugMessage drugMessage = base.Clone() as DrugMessage;

            drugMessage.ApplyDept = this.ApplyDept.Clone();

            drugMessage.DrugBillClass = this.DrugBillClass.Clone();

            drugMessage.StockDept = this.StockDept.Clone();

            return(drugMessage);
        }
Пример #7
0
        /// <summary>
        /// 对用户确认的出库申请数组进行发药处理(打印摆药单)
        /// writed by cuipeng
        /// 2005-1
        /// 操作如下:
        /// 1、如果该记录未计费,则
        ///		确定摆药是否对药品数量取整(只对每次量取整),确定数量。
        ///		取最新的药品基本信息
        ///	2、更新医嘱执行档(摆药确认信息)
        ///	3、更新药嘱主档的最新的执行信息
        ///	4、如果摆药的同时需要出库则处理出库数据,否则,只确认不处理出库数据
        ///	5、更新出库申请表中的摆药信息
        ///	6、如果全部核准,则更新摆药通知信息。否则不更新摆药通知信息
        ///	摆药后产生的摆药单保存在drugMessage.DrugBillClass.Memo中
        /// </summary>
        /// <param name="arrayApplyOut">出库申请信息</param>
        /// <param name="drugMessage">摆药通知,用来更新摆药通知(摆药后产生的摆药单保存在drugMessage.DrugBillClass.Memo中)</param>
        /// <returns>1成功,-1失败</returns>
        internal static int DrugConfirm(ArrayList arrayApplyOut, Neusoft.HISFC.Models.Pharmacy.DrugMessage drugMessage, Neusoft.FrameWork.Models.NeuObject arkDept, Neusoft.FrameWork.Models.NeuObject approveDept, System.Data.IDbTransaction trans)
        {
            //对申请项目按照项目编码排序 减少资源死锁的发生几率 {1B35A424-0127-42ff-96A4-6835D5DB0151}
            Neusoft.HISFC.BizProcess.Integrate.PharmacyMethod.SortApplyOutByItemCode(ref arrayApplyOut);

            Neusoft.HISFC.BizProcess.Integrate.Pharmacy pharmacyIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy();
            if (pharmacyIntegrate.InpatientDrugConfirm(arrayApplyOut, drugMessage, arkDept, approveDept, trans) != 1)
            {
                System.Windows.Forms.MessageBox.Show(pharmacyIntegrate.Err);
                return(-1);
            }
            return(1);
        }
Пример #8
0
        /// <summary>
        /// 根据传入的摆药通知数组,显示在tvDrugMessage中
        /// 传入参数数组是按照科室、摆药单类型、发送时间(倒序)排序的
        ///
        /// 显示层次为 科室/患者/单据
        /// </summary>
        /// <param name="alDrugMessage">摆药通知数组</param>
        public virtual void ShowListForInpatientFirst(ArrayList alDrugMessage)
        {
            this.Nodes.Clear();

            string privPatientNO = "";
            string privDeptCode  = "";                          //上一个科室

            Neusoft.HISFC.Models.Pharmacy.DrugMessage privInfo = new Neusoft.HISFC.Models.Pharmacy.DrugMessage();
            DrugMessageTreeNode nodePatient;
            DrugMessageTreeNode nodeDept = new DrugMessageTreeNode();
            DrugMessageTreeNode nodeBill = new DrugMessageTreeNode();

            this.SuspendLayout();

            foreach (DrugMessage info in alDrugMessage)
            {
                if (info.ApplyDept.ID != privDeptCode)          //添加新的科室节点 一个科室节点仅需添加处理一次
                {
                    nodeDept = this.GetNodeDept(info, null);

                    privDeptCode = info.ApplyDept.ID;
                    privInfo     = new Neusoft.HISFC.Models.Pharmacy.DrugMessage();
                }

                //避免重复添加
                if (info.ApplyDept.ID == privInfo.ApplyDept.ID && info.StockDept.ID == privInfo.StockDept.ID &&
                    info.DrugBillClass.ID == privInfo.DrugBillClass.ID && info.SendType == privInfo.SendType)
                {
                    continue;
                }

                //获取患者信息
                List <Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(info);
                if (neuObjectList == null)
                {
                    MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                    return;
                }
                foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                {
                    nodePatient = this.GetNodePatient(obj, nodeDept);

                    nodeBill = this.GetNodeBill(info, nodePatient);

                    this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                }
            }

            this.ResumeLayout();
        }
Пример #9
0
        /// <summary>
        /// 获取摆药单列表显示时科室节点
        /// </summary>
        /// <param name="info">摆药通知信息</param>
        /// <returns>成功返回摆药单列表显示时的科室节点</returns>
        private DrugMessageTreeNode GetNodeDept(Neusoft.HISFC.Models.Pharmacy.DrugMessage info, DrugMessageTreeNode parentNode)
        {
            DrugMessageTreeNode nodeDept = new DrugMessageTreeNode();

            if (info.ApplyDept.Name == "")
            {
                info.ApplyDept.Name = objHelper.GetName(info.ApplyDept.ID);
            }
            nodeDept.Text       = info.ApplyDept.Name;
            nodeDept.ImageIndex = 0;
            nodeDept.Tag        = info;
            nodeDept.NodeType   = DrugMessageNodeType.ApplyDept;
            if (parentNode == null)
            {
                this.Nodes.Add(nodeDept);
            }
            else
            {
                parentNode.Nodes.Add(nodeDept);
            }
            return(nodeDept);
        }
Пример #10
0
        /// <summary>
        /// 判断是否需要打印 对未打印的患者获取数据进行打印
        /// </summary>
        /// <param name="judgeKey">判断的主键依据</param>
        /// <param name="judgeMessage">摆药通知信息</param>
        /// <param name="judgePatientNO">患者住院号</param>
        protected virtual void JudgePrint(string judgeKey, Neusoft.HISFC.Models.Pharmacy.DrugMessage judgeMessage, string judgePatientNO)
        {
            if (!this.isAutoPrint)
            {
                return;
            }

            //if (tvDrugMessage.hsPrint != null && tvDrugMessage.hsPrint.ContainsKey(judgeKey))

            if (tvDrugMessage.hsPrint == null)
            {
                tvDrugMessage.hsPrint = new Hashtable();
            }

            #region 待打印数据获取

            judgeMessage.User01 = judgePatientNO;               //需打印患者住院流水号
            //检索患者摆药申请明细数据
            ArrayList al = this.itemManager.QueryApplyOutListByPatient(judgeMessage);
            if (al == null)
            {
                MessageBox.Show("获取" + judgePatientNO + "的待打印数据时发生错误");
                return;
            }

            //屏蔽此处判断 同一张单据包括两天数据时 判断有问题
            //if (al.Count > 0)
            //{
            //    Neusoft.HISFC.Models.Pharmacy.ApplyOut info = al[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut;
            //    if (info != null)
            //    {
            //        //非当日数据不予打印
            //        if (info.Operation.ApplyOper.OperTime < this.sysDate)
            //        {
            //            tvDrugMessage.hsPrint.Add(judgeKey, null);
            //            return;
            //        }
            //    }
            //}

            //取出所有未打印数据
            ArrayList alPrintData = new ArrayList();
            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut printInfo in al)
            {
                //对非当日数据不打印
                if (printInfo.Operation.ApplyOper.OperTime < this.sysDate)
                {
                    continue;
                }

                if (printInfo.ValidState == Neusoft.HISFC.Models.Base.EnumValidState.Valid && printInfo.PrintState != "1")
                {
                    alPrintData.Add(printInfo);
                }
            }

            #endregion

            //无待打印数据 直接返回
            if (alPrintData.Count == 0)
            {
                return;
            }

            if (this.isPrintLabel)
            {
                #region 标签打印

                if (Function.PrintLabelForOutpatient(alPrintData) != -1)
                {
                    foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alPrintData)
                    {
                        info.PrintState = "1";                  //该标记用于区分是否已对单据进行过打印
                        if (this.itemManager.UpdateApplyOut(info) == -1)
                        {
                            MessageBox.Show("更新打印标记发生错误");
                        }
                    }
                }

                #endregion
            }
            else
            {
                #region 摆药单打印

                Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass = this.drugStoreManager.GetDrugBillClass(judgeMessage.DrugBillClass.ID);
                drugBillClass.Memo = judgeMessage.DrugBillClass.Memo;//摆药单号

                if (Function.PrintBill(alPrintData, drugBillClass) != -1)
                {
                    foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alPrintData)
                    {
                        info.PrintState = "1";                  //该标记用于区分是否已对单据进行过打印
                        if (this.itemManager.UpdateApplyOutPrintState(info.ID, true) == -1)
                        {
                            MessageBox.Show("更新打印标记发生错误");
                        }
                    }
                }

                #endregion
            }

            tvDrugMessage.hsPrint.Add(judgeKey, null);

            //屏蔽打印自动保存功能
            //if (this.isPrintAndOutput)
            //{
            //    this.AutoSave(judgeMessage);
            //}
        }
Пример #11
0
        /// <summary>
        /// 根据传入的摆药通知数组,显示在tvDrugMessage中
        /// 传入参数数组是按照科室、摆药单类型、发送时间(倒序)排序的
        /// </summary>
        /// <param name="alDrugMessage">摆药通知数组</param>
        /// <param name="showLevel">显示等级</param>
        protected virtual void ShowList(ArrayList alDrugMessage, int showLevel)
        {
            //if (!this.isListAddType)
            this.Nodes.Clear();

            string privBillCode = "";
            string privDeptCode = "";                           //上一个科室

            Neusoft.HISFC.Models.Pharmacy.DrugMessage privInfo = new Neusoft.HISFC.Models.Pharmacy.DrugMessage();
            DrugMessageTreeNode nodePatient;
            DrugMessageTreeNode nodeDept = new DrugMessageTreeNode();
            DrugMessageTreeNode nodeBill = new DrugMessageTreeNode();

            foreach (DrugMessage info in alDrugMessage)
            {
                #region 每次将节点清空重新添加

                this.SuspendLayout();

                if (this.isDeptFirst)
                {
                    #region 只显示至科室节点
                    if (info.ApplyDept.ID != privDeptCode)              //添加新的科室节点
                    {
                        nodeDept = GetNodeDept(info, null);

                        privDeptCode = info.ApplyDept.ID;
                        privInfo     = new Neusoft.HISFC.Models.Pharmacy.DrugMessage();
                        privBillCode = "";
                    }
                    if (showLevel == 0)
                    {
                        continue;                                       //如果只显示一级 则继续
                    }
                    #endregion

                    #region 只显示至摆药单节点
                    if (info.DrugBillClass.ID != privBillCode)  //添加新的摆药单节点
                    {
                        nodeBill = this.GetNodeBill(info, nodeDept);

                        privBillCode = info.DrugBillClass.ID;   //保存上一次的摆药单号
                    }
                    if (showLevel == 1)
                    {
                        continue;                                       //如果不显示患者信息 则继续
                    }
                    #endregion

                    #region 显示患者信息 如果信息相同则继续
                    if (info.ApplyDept.ID == privInfo.ApplyDept.ID && info.StockDept.ID == privInfo.StockDept.ID &&
                        info.DrugBillClass.ID == privInfo.DrugBillClass.ID && info.SendType == privInfo.SendType)
                    {
                        continue;
                    }
                    privInfo = info;

                    //住院领药单 by Sunjh 2010-11-17 {F667C43C-FA2B-4c94-843D-5C540B6F06F7}
                    bool isNursePrint = this.ctrlIntegrate.GetControlParam <bool>("P01016", true, false);
                    if (isNursePrint)
                    {
                        ArrayList alTemp = this.itemManager.QueryNursePrintBill(info.DrugBillClass.ID, privInfo.ApplyDept.ID, privInfo.StockDept.ID);
                        if (alTemp == null)
                        {
                            MessageBox.Show("添加摆药单号节点:" + this.itemManager.Err);
                            return;
                        }
                        foreach (Neusoft.FrameWork.Models.NeuObject obj in alTemp)
                        {
                            nodePatient = this.GetNodePatient(obj, nodeBill);

                            this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                        }
                    }
                    else
                    {
                        List <Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(info);
                        if (neuObjectList == null)
                        {
                            MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                            return;
                        }
                        foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                        {
                            nodePatient = this.GetNodePatient(obj, nodeBill);

                            this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                        }
                    }

                    //List<Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(info);
                    //if (neuObjectList == null)
                    //{
                    //    MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                    //    return;
                    //}
                    //foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                    //{
                    //    nodePatient = this.GetNodePatient(obj, nodeBill);

                    //    this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                    //}
                    #endregion
                }
                else
                {
                    #region  照摆药单优先显示

                    //添加摆药单分类列表,如果本节点已经添加则不重复添加
                    if (info.DrugBillClass.ID != privBillCode)
                    {
                        nodeBill = this.GetNodeBill(info, null);

                        privDeptCode = "";  //清空科室编码变量,避免跟上一张摆药单中的科室重复

                        //{22E638FE-2821-4bdf-A8A9-5BD25D51742E} 摆药单优先时发生错误
                        privBillCode = info.DrugBillClass.ID;
                    }

                    //如果显示等级为0(显示科室汇总),则不进行下面的代码
                    if (showLevel == 0)
                    {
                        continue;
                    }

                    //添加科室列表,如果本节点已经添加则不重复添加
                    if (info.ApplyDept.ID != privDeptCode)
                    {
                        nodeDept     = this.GetNodeDept(info, nodeBill);
                        privDeptCode = info.ApplyDept.ID;   //保存最新一次添加的科室节点

                        //如果显示等级为1(显示科室明细),则不进行下面的代码
                        if (showLevel == 1)
                        {
                            continue;
                        }

                        //添加患者列表(患者信息:住院流水号ID,姓名Name,床号Memo)
                        List <Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(info);
                        if (neuObjectList == null)
                        {
                            MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                            return;
                        }
                        foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                        {
                            nodePatient = this.GetNodePatient(obj, nodeDept);

                            this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                        }
                    }

                    #endregion
                }

                this.ResumeLayout();

                #endregion

                #region 屏蔽原来累加方式代码 保留备份

                //if (this.isListAddType)
                //{
                //    #region 每次累加方式

                //    if (this.isDeptFirst)
                //    {
                //        #region 每次累计方式 按科室优先添加

                //        nodeDept = this.FindNode(info, this.Nodes, "0");
                //        if (nodeDept == null)
                //            nodeDept = GetNodeDept(info, null);

                //        if (showLevel == 0) continue;			//如果只显示一级 则继续

                //        nodeBill = this.FindNode(info, nodeDept.Nodes, "1");
                //        if (nodeBill == null)
                //            nodeBill = this.GetNodeBill(info, nodeDept);

                //        if (showLevel == 1) continue;			//如果不显示患者信息 则继续

                //        List<Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(info);
                //        if (neuObjectList == null)
                //        {
                //            MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                //            return;
                //        }
                //        foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                //        {
                //            nodePatient = this.FindNode(obj, nodeBill.Nodes);
                //            if (nodePatient == null)
                //            {
                //                nodePatient = this.GetNodePatient(obj, nodeBill);
                //                this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                //            }
                //        }

                //        #endregion
                //    }
                //    else
                //    {
                //        #region 每次累计方式 按单据优先添加

                //        nodeBill = this.FindNode(info, this.Nodes, "1");
                //        if (nodeBill == null)
                //            nodeBill = this.GetNodeBill(info, null);

                //        if (showLevel == 0) continue;

                //        nodeDept = this.FindNode(info, nodeBill.Nodes, "1");
                //        if (nodeDept == null)
                //            nodeDept = this.GetNodeDept(info, null);

                //        if (showLevel == 1) continue;

                //        List<Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(info);
                //        if (neuObjectList == null)
                //        {
                //            MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                //            return;
                //        }
                //        foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                //        {
                //            nodePatient = this.FindNode(obj, nodeDept.Nodes);
                //            if (nodePatient == null)
                //            {
                //                nodePatient = this.GetNodePatient(obj, nodeDept);
                //                this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                //            }
                //        }

                //        #endregion
                //    }

                //    #endregion
                //}
                //else
                //{
                //    #region 每次将节点清空重新添加

                //    this.SuspendLayout();

                //    if (this.isDeptFirst)
                //    {
                //        #region 只显示至科室节点
                //        if (info.ApplyDept.ID != privDeptCode)		//添加新的科室节点
                //        {
                //            nodeDept = GetNodeDept(info, null);

                //            privDeptCode = info.ApplyDept.ID;
                //            privInfo = new Neusoft.HISFC.Models.Pharmacy.DrugMessage();
                //            privBillCode = "";
                //        }
                //        if (showLevel == 0) continue;			//如果只显示一级 则继续
                //        #endregion

                //        #region 只显示至摆药单节点
                //        if (info.DrugBillClass.ID != privBillCode)	//添加新的摆药单节点
                //        {
                //            nodeBill = this.GetNodeBill(info, nodeDept);

                //            privBillCode = info.DrugBillClass.ID;	//保存上一次的摆药单号
                //        }
                //        if (showLevel == 1) continue;			//如果不显示患者信息 则继续
                //        #endregion

                //        #region 显示患者信息 如果信息相同则继续
                //        if (info.ApplyDept.ID == privInfo.ApplyDept.ID && info.StockDept.ID == privInfo.StockDept.ID
                //            && info.DrugBillClass.ID == privInfo.DrugBillClass.ID && info.SendType == privInfo.SendType)
                //            continue;
                //        privInfo = info;
                //        List<Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(info);
                //        if (neuObjectList == null)
                //        {
                //            MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                //            return;
                //        }
                //        foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                //        {
                //            nodePatient = this.GetNodePatient(obj, nodeBill);

                //            this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                //        }
                //        #endregion
                //    }
                //    else
                //    {
                //        #region 按照摆药单优先显示

                //        //添加摆药单分类列表,如果本节点已经添加则不重复添加
                //        if (info.DrugBillClass.ID != privBillCode)
                //        {
                //            nodeBill = this.GetNodeBill(info, null);

                //            privDeptCode = "";  //清空科室编码变量,避免跟上一张摆药单中的科室重复
                //        }

                //        //如果显示等级为0(显示科室汇总),则不进行下面的代码
                //        if (showLevel == 0) continue;

                //        //添加科室列表,如果本节点已经添加则不重复添加
                //        if (info.ApplyDept.ID != privDeptCode)
                //        {
                //            nodeDept = this.GetNodeDept(info, nodeBill);
                //            privDeptCode = info.ApplyDept.ID;   //保存最新一次添加的科室节点

                //            //如果显示等级为1(显示科室明细),则不进行下面的代码
                //            if (showLevel == 1) continue;

                //            //添加患者列表(患者信息:住院流水号ID,姓名Name,床号Memo)
                //            List<Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(info);
                //            if (neuObjectList == null)
                //            {
                //                MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                //                return;
                //            }
                //            foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                //            {
                //                nodePatient = this.GetNodePatient(obj, nodeDept);

                //                this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                //            }
                //        }

                //        #endregion
                //    }

                //    this.ResumeLayout();

                //    #endregion
                //}

                #endregion
            }
        }
Пример #12
0
        /// <summary>
        /// 根据传入的摆药通知数组,显示在tvDrugMessage中
        /// 传入参数数组是按照科室、摆药单类型、发送时间(倒序)排序的
        /// </summary>
        /// <param name="alDrugMessage">摆药通知数组</param>
        /// <param name="showLevel">显示等级</param>
        public virtual void ShowListForDeptFirst(ArrayList alDrugMessage, int showLevel)
        {
            this.Nodes.Clear();

            string privBillCode = "";
            string privDeptCode = "";                           //上一个科室

            Neusoft.HISFC.Models.Pharmacy.DrugMessage privInfo = new Neusoft.HISFC.Models.Pharmacy.DrugMessage();
            DrugMessageTreeNode nodePatient;
            DrugMessageTreeNode nodeDept = new DrugMessageTreeNode();
            DrugMessageTreeNode nodeBill = new DrugMessageTreeNode();

            foreach (DrugMessage info in alDrugMessage)
            {
                #region 每次将节点清空重新添加

                this.SuspendLayout();

                #region 只显示至科室节点

                if (info.ApplyDept.ID != privDeptCode)          //添加新的科室节点
                {
                    nodeDept = GetNodeDept(info, null);

                    privDeptCode = info.ApplyDept.ID;
                    privInfo     = new Neusoft.HISFC.Models.Pharmacy.DrugMessage();
                    privBillCode = "";
                }
                if (showLevel == 0)
                {
                    continue;                   //如果只显示一级 则继续
                }

                #endregion

                if (showLevel != 3)         //按原显示方式正常处理
                {
                    #region 只显示至摆药单节点 此处不显示患者

                    if (info.DrugBillClass.ID != privBillCode)  //添加新的摆药单节点
                    {
                        nodeBill = this.GetNodeBill(info, nodeDept);

                        privBillCode = info.DrugBillClass.ID;   //保存上一次的摆药单号
                    }
                    if (showLevel == 1)
                    {
                        continue;                       //如果不显示患者信息 则继续
                    }

                    #endregion

                    #region 显示患者信息 如果信息相同则继续

                    //避免重复添加
                    if (info.ApplyDept.ID == privInfo.ApplyDept.ID && info.StockDept.ID == privInfo.StockDept.ID &&
                        info.DrugBillClass.ID == privInfo.DrugBillClass.ID && info.SendType == privInfo.SendType)
                    {
                        continue;
                    }
                    privInfo = info;
                    List <Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(info);
                    if (neuObjectList == null)
                    {
                        MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                        return;
                    }
                    foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                    {
                        nodePatient = this.GetNodePatient(obj, nodeBill);

                        this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                    }

                    #endregion
                }
                else
                {
                    //显示患者明细 并按患者优先显示 即患者下面显示单据明细
                    DrugMessage tempMessage = info.Clone();
                    tempMessage.DrugBillClass.ID = "A";
                    List <Neusoft.FrameWork.Models.NeuObject> neuObjectList = this.itemManager.QueryApplyOutPatientList(tempMessage);
                    if (neuObjectList == null)
                    {
                        MessageBox.Show("添加患者节点:" + this.itemManager.Err);
                        return;
                    }

                    foreach (Neusoft.FrameWork.Models.NeuObject obj in neuObjectList)
                    {
                        nodePatient = this.GetNodePatient(obj, nodeDept);

                        this.JudgePrint(info.ApplyDept.ID + info.DrugBillClass.ID + obj.ID, info, obj.ID);
                    }
                }

                this.ResumeLayout();

                #endregion
            }
        }
Пример #13
0
        /// <summary>
        /// 获取选中的节点的摆药申请信息
        /// </summary>
        /// <param name="selectNode">当前选中节点</param>
        /// <param name="drugMessage">摆药通知信息</param>
        /// <param name="al">摆药明细信息</param>
        /// <param name="treeLevel">树节点层次</param>
        protected virtual void GetSelectData(DrugMessageTreeNode selectNode, ref Neusoft.HISFC.Models.Pharmacy.DrugMessage drugMessage, ref ArrayList al, ref bool isDetail)
        {
            if (selectNode == null)
            {
                return;
            }

            #region 库存药品列表获取 用于药柜管理的判断 仅取一次

            if (stockMark != null && stockMark.ID != "")
            {
                //获取科室库存药品信息
                if (this.hsStockData == null)
                {
                    this.hsStockData = new Hashtable();

                    Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm(Language.Msg("正在加载科室库存信息 请稍候..."));
                    Application.DoEvents();

                    ArrayList alStorage = this.itemManager.QueryStockinfoList(stockMark.ID);

                    foreach (Neusoft.HISFC.Models.Pharmacy.Storage storage in alStorage)
                    {
                        if (storage.IsArkManager)
                        {
                            continue;
                        }
                        this.hsStockData.Add(storage.Item.ID, null);
                    }

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

            #endregion

            int treeLevel = selectNode.Level;
            drugMessage = selectNode.Tag as Neusoft.HISFC.Models.Pharmacy.DrugMessage;

            ArrayList alTotal = new ArrayList();

            //住院领药单 by Sunjh 2010-11-17 {F667C43C-FA2B-4c94-843D-5C540B6F06F7}
            bool isNursePrint = this.ctrlIntegrate.GetControlParam <bool>("P01016", true, false);

            switch (treeLevel)
            {
            case 0:                 //第一级  NodeType 可能为 科室、单据
                //住院领药单 by Sunjh 2010-11-17 {F667C43C-FA2B-4c94-843D-5C540B6F06F7}
                //bool isNursePrint = this.ctrlIntegrate.GetControlParam<bool>("P01016", true, false);
                if (isNursePrint)
                {
                    break;
                }

                if (this.isDeptFirst)
                {
                    alTotal  = this.drugStoreManager.QueryDrugBillList(this.drugControl.ID, drugMessage);
                    isDetail = false;
                }
                else
                {
                    alTotal  = this.drugStoreManager.QueryDrugMessageList(drugMessage);
                    isDetail = false;
                }
                break;

            case 1:                //第二级 NodeType 可能为 科室、单据、患者
                //住院领药单 by Sunjh 2010-11-17 {F667C43C-FA2B-4c94-843D-5C540B6F06F7}
                //bool isNursePrint = this.ctrlIntegrate.GetControlParam<bool>("P01016", true, false);
                if (isNursePrint)
                {
                    break;
                }

                if (selectNode.NodeType == DrugMessageNodeType.Patient)         //节点为患者 特殊处理 取所有子节点摆药单进行处理
                {
                    Neusoft.FrameWork.Models.NeuObject patientTag = selectNode.Tag as Neusoft.FrameWork.Models.NeuObject;
                    ArrayList alTempTotal = new ArrayList();
                    foreach (DrugMessageTreeNode childNode in selectNode.Nodes)
                    {
                        drugMessage = childNode.Tag as Neusoft.HISFC.Models.Pharmacy.DrugMessage;
                        if (drugMessage != null)
                        {
                            drugMessage.User01 = patientTag.ID;
                            alTempTotal        = this.itemManager.QueryApplyOutListByPatient(drugMessage);
                        }

                        alTotal.AddRange(alTempTotal);
                    }
                }
                else
                {
                    alTotal = this.itemManager.QueryApplyOutList(drugMessage);
                }

                isDetail = true;

                break;

            case 2:             //第三级 NodeType 可能为 单据、患者
                if (selectNode.NodeType == DrugMessageNodeType.Patient)
                {
                    drugMessage = selectNode.Parent.Tag as Neusoft.HISFC.Models.Pharmacy.DrugMessage;
                    Neusoft.FrameWork.Models.NeuObject patientObj = selectNode.Tag as Neusoft.FrameWork.Models.NeuObject;
                    drugMessage.User01 = patientObj.ID;

                    //住院领药单 by Sunjh 2010-11-17 {F667C43C-FA2B-4c94-843D-5C540B6F06F7}
                    //bool isNursePrint = this.ctrlIntegrate.GetControlParam<bool>("P01016", true, false);
                    if (isNursePrint)
                    {
                        alTotal = this.itemManager.QueryApplyOutListByNurseBill(patientObj.ID);
                        drugMessage.DrugBillClass.Memo = patientObj.ID;    //事先保存摆药单号,用于后面的日志信息保存 by Sunjh 2010-8-5
                    }
                    else
                    {
                        alTotal = this.itemManager.QueryApplyOutListByPatient(drugMessage);
                    }

                    //alTotal = this.itemManager.QueryApplyOutListByPatient(drugMessage);
                    isDetail = true;
                }
                else           //节点为单据时
                {
                    drugMessage = selectNode.Tag as Neusoft.HISFC.Models.Pharmacy.DrugMessage;
                    Neusoft.FrameWork.Models.NeuObject patientObj = selectNode.Parent.Tag as Neusoft.FrameWork.Models.NeuObject;
                    drugMessage.User01 = patientObj.ID;
                    alTotal            = this.itemManager.QueryApplyOutListByPatient(drugMessage);
                    isDetail           = true;
                }
                break;
            }

            #region 药柜管理药品的处理

            if (this.hsStockData == null)
            {
                al = alTotal;
            }
            else
            {
                //屏蔽药柜管理的药品
                if (alTotal.Count > 0)
                {
                    if (alTotal[0] is Neusoft.HISFC.Models.Pharmacy.ApplyOut)
                    {
                        foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alTotal)
                        {
                            if (this.hsStockData.ContainsKey(info.Item.ID))
                            {
                                al.Add(info);
                            }
                        }
                    }
                    else
                    {
                        al = alTotal;
                    }
                }
            }

            #endregion
        }