Ejemplo n.º 1
0
        /// <summary>
        /// 通过医嘱表ID获得药品或项目ID
        /// </summary>
        /// <returns></returns>
        public int GetItemId()
        {
            DataRow[] dr = CashDataTable.Select("order_id = " + order_id + "");
            if (dr != null && dr.Length > 0) //如果能在缓存表中找到,则直接从表中取得数据
            {
                if (dr[0]["orditem_id"].ToString().Trim() != "0")
                {
                    return(Convert.ToInt32(dr[0]["orditem_id"].ToString().Trim()));
                }
                else
                {
                    return(Convert.ToInt32(dr[0]["makedicid"].ToString().Trim()));
                }
            }
            else
            {
                HIS.Model.ZY_DOC_ORDERRECORD record = BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).GetModel(order_id);

                if (record.ORDITEM_ID != 0)
                {
                    return(record.ORDITEM_ID);
                }
                return(record.MAKEDICID);
            }
        }
Ejemplo n.º 2
0
        public override bool DelApply(HIS.Model.ZY_DOC_ORDERRECORD record)
        {
            oleDb.BeginTransaction();
            try
            {
                record.DELETE_FLAG = 1;
                BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(record);

                string strWhere = Tables.zy_doc_testapply.PATID + oleDb.EuqalTo() + record.PATID + oleDb.And() + Tables.zy_doc_testapply.GROUP_ID + oleDb.EuqalTo() + record.GROUP_ID + oleDb.And() + Tables.zy_doc_testapply.DELETE_FLAG + oleDb.EuqalTo() + 0;
                HIS.Model.ZY_DOC_TESTAPPLY check = BindEntity <HIS.Model.ZY_DOC_TESTAPPLY> .CreateInstanceDAL(oleDb).GetModel(strWhere);

                if (check != null)
                {
                    check.DELETE_FLAG = 1;
                    BindEntity <HIS.Model.ZY_DOC_TESTAPPLY> .CreateInstanceDAL(oleDb).Update(check);
                }
                oleDb.CommitTransaction();
                return(true);
            }
            catch (System.Exception e)
            {
                oleDb.RollbackTransaction();
                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 术后医嘱,产后医嘱插入一条医嘱
        /// </summary>
        /// <param name="order_context"></param>
        /// <returns></returns>
        public bool AfterPeration(string order_context, int patdeptid, int presdeptid, int docid, int patlistid)
        {
            int groupid = PubMethd.GetGroupMax(patlistid, 0);

            HIS.Model.ZY_DOC_ORDERRECORD record = new HIS.Model.ZY_DOC_ORDERRECORD();
            record.GROUP_ID      = groupid;
            record.PATID         = patlistid;
            record.PAT_DEPTID    = patdeptid;
            record.PRES_DEPTID   = presdeptid;
            record.ORDER_DOC     = docid;
            record.ORDER_TYPE    = 0;
            record.ITEM_TYPE     = 10;
            record.ORDITEM_ID    = -1;
            record.ORDER_CONTENT = order_context;
            record.AMOUNT        = 0;
            record.PRES_AMOUNT   = 0;
            record.UNIT          = "";
            record.ORDER_BDATE   = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
            record.FIRSET_TIMES  = 0;
            record.ORDER_USAGE   = "";
            record.FREQUENCY     = "";
            record.DELETE_FLAG   = 0;
            record.STATUS_FALG   = 1;
            record.BABYID        = 0;
            record.EXEC_DEPT     = presdeptid;
            record.SERIAL_ID     = 0;
            record.ORECORD_A2    = 1;
            BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Add(record);

            return(true);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 取消作废医嘱(只改医嘱内容)
        /// </summary>
        /// <param name="rowid"></param>
        /// <param name="dt"></param>
        /// <returns></returns>
        public List <HIS.Model.ZY_DOC_ORDERRECORD> NotAbolish(HIS.Model.ZY_DOC_ORDERRECORD record)
        {
            record.ORDER_CONTENT = record.ORDER_CONTENT.ToString().Substring(4, record.ORDER_CONTENT.ToString().Length - 4);
            BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(record);

            return(null);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///  取消出院和取消死亡时改变病人信息
        /// </summary>
        /// <param name="patlistid"></param>
        /// <param name="babyid"></param>
        public bool updatePatType(int patlistid, int babyid, int deptid, HIS.Model.ZY_DOC_ORDERRECORD record)
        {
            oleDb.BeginTransaction();
            try
            {
                string strWhere1 = Tables.zy_doc_orderrecord.ORDER_TYPE + oleDb.EuqalTo() + 0 + oleDb.And()
                                   + Tables.zy_doc_orderrecord.DELETE_FLAG + oleDb.EuqalTo() + 0 + oleDb.And()
                                   + Tables.zy_doc_orderrecord.STATUS_FALG + oleDb.EuqalTo() + 3 + oleDb.And()
                                   + Tables.zy_doc_orderrecord.PATID + oleDb.EuqalTo() + patlistid + oleDb.And()
                                   + Tables.zy_doc_orderrecord.BABYID + oleDb.EuqalTo() + 0;
                string[] strSet1 = new string[4];
                strSet1[0] = Tables.zy_doc_orderrecord.STATUS_FALG + oleDb.EuqalTo() + 2;
                strSet1[1] = Tables.zy_doc_orderrecord.EORDER_DATE + oleDb.EuqalTo() + "'0001-01-01 00:00:00.000000'";
                strSet1[2] = Tables.zy_doc_orderrecord.EORDER_DOC + oleDb.EuqalTo() + 0;
                strSet1[3] = Tables.zy_doc_orderrecord.TEMINAL_TIMES + oleDb.EuqalTo() + 0;

                HIS.ZYDoc_BLL.PatInfo.PatOperation.CancelOutDeath(patlistid);
                BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(strWhere1, strSet1);

                BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(record);

                oleDb.CommitTransaction();
                return(true);
            }
            catch (System.Exception e)
            {
                oleDb.RollbackTransaction();
                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 插入皮试结果
        /// </summary>
        /// <param name="order_id"></param>
        /// <param name="ps_flag"></param>
        /// <returns></returns>
        public bool SetPsResult(int ps_flag)
        {
            HIS.Model.ZY_DOC_ORDERRECORD record = BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).GetModel(order_id);

            record.PS_FLAG = ps_flag;
            BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(record);

            return(true);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 判断是否需要皮试
        /// </summary>
        /// <param name="orderid"></param>
        /// <returns></returns>
        public bool IsNeedPs()
        {
            HIS.Model.ZY_DOC_ORDERRECORD record = BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).GetModel(order_id);

            if (record.PS_ORDERID.ToString() != "0.000000" && record.ITEM_CODE.ToString() == "")
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 作废医嘱(只改医嘱内容,在内容前加“取消”)
        /// </summary>
        /// <param name="rowid"></param>
        /// <param name="dt"></param>
        /// <returns></returns>
        public bool Abolish(HIS.Model.ZY_DOC_ORDERRECORD record)
        {
            //作废时加“取消”的内容从数据库中取,不从界面上取 2010.4.6
            string name = BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).GetFieldValue
                              (Tables.zy_doc_orderrecord.ORDER_CONTENT, Tables.zy_doc_orderrecord.ORDER_ID + oleDb.EuqalTo() + record.ORDER_ID).ToString();

            string strSet = Tables.zy_doc_orderrecord.ORDER_CONTENT + oleDb.EuqalTo() + "'" + "【取消】" + name + "'";

            BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(Tables.zy_doc_orderrecord.ORDER_ID + oleDb.EuqalTo() + record.ORDER_ID,
                                                                                       strSet);

            return(true);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 转科时的操作
        /// </summary>
        /// <param name="record">插入医嘱一条记录</param>
        /// <param name="transdept">插入转科表一条记录</param>
        /// <param name="records">更新修改停嘱的末次</param>
        /// <returns></returns>
        public bool Turn(HIS.Model.ZY_DOC_ORDERRECORD record, HIS.Model.ZY_DOC_TRANSDEPT transdept, List <HIS.Model.ZY_DOC_ORDERRECORD> records)
        {
            oleDb.BeginTransaction();
            try
            {
                //20100524.2.03 转科申请时部分赋值放业务逻辑层
                record.ORECORD_A2   = 1;
                record.GROUP_ID     = PubMethd.GetGroupMax(record.PATID, 1);
                record.BABYID       = 0;
                record.ORDER_TYPE   = 1;
                record.ITEM_TYPE    = 10;
                record.ORDITEM_ID   = -1;
                record.AMOUNT       = 0;
                record.PRES_AMOUNT  = 1;
                record.UNIT         = "";
                record.FIRSET_TIMES = 1;
                record.ORDER_USAGE  = "";
                record.FREQUENCY    = "1";
                record.DELETE_FLAG  = 0;
                record.STATUS_FALG  = 1;
                record.SERIAL_ID    = 0;
                BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Add(record);//插入医嘱一条记录

                transdept.ORDER_ID = record.ORDER_ID;
                BindEntity <HIS.Model.ZY_DOC_TRANSDEPT> .CreateInstanceDAL(oleDb).Add(transdept);

                for (int i = 0; i < records.Count; i++)//更新修改停嘱的末次
                {
                    BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(records[i]);
                }
                oleDb.CommitTransaction();
                return(true);
            }
            catch (System.Exception e)
            {
                oleDb.RollbackTransaction();
                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 取消转科
        /// </summary>
        /// <param name="patlistid"></param>
        /// <param name="deptid"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        public bool DelTurn(int patlistid, int deptid, int userid, HIS.Model.ZY_DOC_ORDERRECORD record)
        {
            oleDb.BeginTransaction();
            try
            {
                string strWhere = Tables.zy_doc_transdept.PATID + oleDb.EuqalTo() + patlistid + oleDb.And()
                                  + Tables.zy_doc_transdept.ORIGE_DEPT + oleDb.EuqalTo() + deptid;
                // + oleDb.And()+ Tables.zy_doc_transdept.OPERATOR + oleDb.EuqalTo() + userid;
                string[] strSet = new string[3];
                strSet[0] = Tables.zy_doc_transdept.CANCEL_FLAG + oleDb.EuqalTo() + 1;
                strSet[1] = Tables.zy_doc_transdept.CANCEL_USER + oleDb.EuqalTo() + userid;
                strSet[2] = Tables.zy_doc_transdept.CANCEL_DATE + oleDb.EuqalTo() + "'" + XcDate.ServerDateTime + "'";

                string strWhere1 = Tables.zy_doc_orderrecord.ORDER_TYPE + oleDb.EuqalTo() + 0 + oleDb.And()
                                   + Tables.zy_doc_orderrecord.DELETE_FLAG + oleDb.EuqalTo() + 0 + oleDb.And()
                                   + Tables.zy_doc_orderrecord.STATUS_FALG + oleDb.EuqalTo() + 3 + oleDb.And()
                                   + Tables.zy_doc_orderrecord.PATID + oleDb.EuqalTo() + patlistid;
                string[] strSet1 = new string[4];
                strSet1[0] = Tables.zy_doc_orderrecord.STATUS_FALG + oleDb.EuqalTo() + 2;
                strSet1[1] = Tables.zy_doc_orderrecord.EORDER_DATE + oleDb.EuqalTo() + "'0001-01-01 00:00:00.000000'";
                strSet1[2] = Tables.zy_doc_orderrecord.EORDER_DOC + oleDb.EuqalTo() + 0;
                strSet1[3] = Tables.zy_doc_orderrecord.TEMINAL_TIMES + oleDb.EuqalTo() + 0;

                record.GROUP_ID = PubMethd.GetGroupMax(patlistid, 1);
                BindEntity <HIS.Model.ZY_DOC_TRANSDEPT> .CreateInstanceDAL(oleDb).Update(strWhere, strSet);

                BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(strWhere1, strSet1);

                BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(record);

                oleDb.CommitTransaction();
                return(true);
            }
            catch (System.Exception e)
            {
                oleDb.RollbackTransaction();
                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 病人出院(死亡)时,插入医嘱一条记录,更新病人表中病人状态,更新修改停嘱的末次
        /// </summary>
        /// <param name="record">插入医嘱一条记录</param>
        /// <param name="patlist">更新病人表中病人状态</param>
        /// <param name="records">更新修改停嘱的末次</param>
        /// <returns></returns>
        public bool Leave(HIS.Model.ZY_DOC_ORDERRECORD record, HIS.Model.ZY_PatList patlist, List <HIS.Model.ZY_DOC_ORDERRECORD> records)
        {
            oleDb.BeginTransaction();
            try
            {
                HIS.ZYDoc_BLL.PatInfo.PatOperation.OutDeath(patlist);
                record.PATID        = patlist.PatListID;
                record.PAT_DEPTID   = Convert.ToInt32(patlist.CurrDeptCode);
                record.ORDER_TYPE   = 1;
                record.ITEM_TYPE    = 10;
                record.ORDITEM_ID   = -1;
                record.AMOUNT       = 0;
                record.PRES_AMOUNT  = 1;
                record.UNIT         = "";
                record.FIRSET_TIMES = 1;
                record.ORDER_USAGE  = "";
                record.FREQUENCY    = "1";
                record.DELETE_FLAG  = 0;
                record.STATUS_FALG  = 1;
                record.BABYID       = 0;
                record.SERIAL_ID    = 0;
                record.ORECORD_A2   = 1;
                record.GROUP_ID     = PubMethd.GetGroupMax(patlist.PatListID, 1);
                BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Add(record); //插入医嘱一条记录

                for (int i = 0; i < records.Count; i++)                                          //更新修改停嘱的末次
                {
                    BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(records[i]);
                }
                oleDb.CommitTransaction();
                return(true);
            }
            catch (System.Exception e)
            {
                oleDb.RollbackTransaction();
                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 12
0
 /// <summary>
 /// 作废医嘱
 /// </summary>
 /// <param name="record"></param>
 /// <returns></returns>
 public bool Abolish(HIS.Model.ZY_DOC_ORDERRECORD record)
 {
     return(tempop.Abolish(record));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 死亡医嘱
 /// </summary>
 /// <param name="record"></param>
 /// <param name="patlist"></param>
 /// <param name="records"></param>
 /// <returns></returns>
 public bool Death(HIS.Model.ZY_DOC_ORDERRECORD record, HIS.Model.ZY_PatList patlist)
 {
     return(tempop.Leave().Leave(record, patlist, records));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 转科申请
 /// </summary>
 /// <param name="record"></param>
 /// <param name="transdept"></param>
 /// <param name="records"></param>
 /// <returns></returns>
 public bool TurnDept(HIS.Model.ZY_DOC_ORDERRECORD record, HIS.Model.ZY_DOC_TRANSDEPT transdept)
 {
     return(tempop.Turndept().Turn(record, transdept, records));
 }
Ejemplo n.º 15
0
 public override bool DelApply(HIS.Model.ZY_DOC_ORDERRECORD record)
 {
     return(true);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// 删除申请
 /// </summary>
 /// <param name="record"></param>
 /// <returns></returns>
 public abstract bool DelApply(HIS.Model.ZY_DOC_ORDERRECORD record);
Ejemplo n.º 17
0
 /// <summary>
 /// 删除申请
 /// </summary>
 /// <param name="meditype"></param>
 /// <returns></returns>
 public bool DelApply(MediType meditype, HIS.Model.ZY_DOC_ORDERRECORD record)
 {
     return(ApplyFactory.GetApply(meditype).DelApply(record));
 }