예제 #1
0
        public bool Send(List <int> orderidlist, int employee_id, int patlist_id)
        {
            try
            {
                int        patlistid       = patlist_id;
                List <int> orderid         = orderidlist;
                List <int> grouplist       = new List <int>();
                DateTime   ServerDateTime  = XcDate.ServerDateTime;
                string     exceptionString = "";
                for (int arraynum = 0; arraynum < orderid.Count; arraynum++)
                {
                    ZY_DOC_ORDERRECORD orderrecord = new ZY_DOC_ORDERRECORD();
                    string             strwhere1   = "order_id=" + orderid[arraynum];
                    orderrecord = BindEntity <ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).GetModel(orderid[arraynum]);

                    if (orderrecord.STATUS_FALG == 5) //防止同时打开多个窗口,临嘱点两次发送时产生两次费用的并发问题 2010.10.14 add by heyan
                    {
                        continue;
                    }
                    AbstractOrderOperation concreteOrder = OrderOperationFactory.CreateConcreteOrder(orderrecord);
                    concreteOrder.Zy_doc_orderrecord = orderrecord;
                    concreteOrder.Employeeid         = employee_id;
                    concreteOrder.ServerTime         = ServerDateTime;
                    try
                    {
                        oleDb.BeginTransaction();
                        concreteOrder.Send(orderid[arraynum], ServerDateTime, orderrecord, grouplist);
                        oleDb.CommitTransaction();
                    }
                    catch (Exception e)
                    {
                        exceptionString += e.Message;
                        oleDb.RollbackTransaction();
                        continue;
                    }
                }
                if (exceptionString != "")
                {
                    throw new Exception(exceptionString);
                }
                return(true);
            }
            catch (Exception e)
            {
                // throw e;
                throw new Exception(e.Message);
            }
        }
예제 #2
0
        public bool Send(List <int> orderidlist, int employee_id, int patlist_id)
        {
            try
            {
                int        patlistid      = patlist_id;
                List <int> orderid        = orderidlist;
                List <int> grouplist      = new List <int>();
                DateTime   ServerDateTime = XcDate.ServerDateTime.Date.AddDays(1).AddHours(14);

                for (int arraynum = 0; arraynum < orderid.Count; arraynum++)
                {
                    try
                    {
                        oleDb.BeginTransaction();
                        ZY_DOC_ORDERRECORD orderrecord = new ZY_DOC_ORDERRECORD();
                        string             strwhere1   = "order_id=" + orderid[arraynum];
                        orderrecord = BindEntity <ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).GetModel(orderid[arraynum]);

                        AbstractOrderOperation concreteOrder = OrderOperationFactory.CreateConcreteOrder(orderrecord);
                        concreteOrder.Zy_doc_orderrecord = orderrecord;
                        concreteOrder.Employeeid         = employee_id;
                        concreteOrder.ServerTime         = ServerDateTime;
                        concreteOrder.Send(orderid[arraynum], ServerDateTime, orderrecord, grouplist);
                        oleDb.CommitTransaction();
                    }
                    catch
                    {
                        oleDb.RollbackTransaction();
                    }
                }

                return(true);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
예제 #3
0
        public static AbstractOrderOperation CreateConcreteOrder(ZY_DOC_ORDERRECORD zy_doc_orderrecord)
        {
            AbstractOrderOperation orderOperation = null;

            if (zy_doc_orderrecord.ITEM_TYPE < 4)
            {
                if (zy_doc_orderrecord.ORDER_TYPE == 0 && zy_doc_orderrecord.EXEC_DEPT == -1)//长期自备药
                {
                    orderOperation = new SelfPrepareDrug();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 0 && zy_doc_orderrecord.STATUS_FALG == 4)//长期停药品
                {
                    orderOperation = new NormalStopDrug();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 0)//长期正常药
                {
                    orderOperation = new NormalDrug();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 7)//出院带药
                {
                    orderOperation = new OutHospitalDrug();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 1 && zy_doc_orderrecord.EXEC_DEPT == -1)//临嘱自备药
                {
                    orderOperation = new SelfPrepareTempDrug();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 1 && zy_doc_orderrecord.PS_ORDERID != 0 && zy_doc_orderrecord.ITEM_CODE == "")//皮试医嘱 update by heyan  皮试说明数量医生可以修改,不能以数量判断
                {
                    orderOperation = new PsStatementOrder();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 5)//交病人
                {
                    orderOperation = new NormalTempDrug();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 1)//临时正常药品
                {
                    orderOperation = new NormalTempDrug();
                }
            }
            else if (zy_doc_orderrecord.ITEM_TYPE == 7 || zy_doc_orderrecord.ITEM_TYPE == 10)
            {
                if (zy_doc_orderrecord.ITEM_TYPE == 7 && zy_doc_orderrecord.ORDER_TYPE == 0)//长期说明性
                {
                    orderOperation = new LongStateOrder();
                }
                else if (zy_doc_orderrecord.ITEM_TYPE == 7 && zy_doc_orderrecord.ORDER_TYPE == 1)//临时说明性
                {
                    orderOperation = new TempStateOrder();
                }
                else if (zy_doc_orderrecord.ITEM_TYPE == 10 && zy_doc_orderrecord.ORDER_TYPE == 0)//产后术后
                {
                    orderOperation = new PregOrder();
                }
                else if (zy_doc_orderrecord.ITEM_TYPE == 10 && zy_doc_orderrecord.ORDER_TYPE == 1)//出院死亡转科
                {
                    orderOperation = new OutDeathOrder();
                }
            }
            else
            {
                if (zy_doc_orderrecord.ORDER_TYPE == 0 && zy_doc_orderrecord.TC_ID == 0 && zy_doc_orderrecord.STATUS_FALG == 4)//长期停项目
                {
                    orderOperation = new LongStopItem();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 0 && zy_doc_orderrecord.TC_ID == 0)//长期单条医嘱
                {
                    orderOperation = new LongSingleItem();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 0 && zy_doc_orderrecord.TC_ID != 0)//长期组合项目
                {
                    orderOperation = new LongComponentItem();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 1 && zy_doc_orderrecord.TC_ID == 0)//临时单条医嘱
                {
                    orderOperation = new TempSingleItem();
                }
                else if (zy_doc_orderrecord.ORDER_TYPE == 1 && zy_doc_orderrecord.TC_ID != 0)//临时组合医嘱
                {
                    orderOperation = new TempComponentItem();
                }
            }
            return(orderOperation);
        }