예제 #1
0
        /// <summary>
        /// 病人ID是否有效
        /// </summary>
        /// <param name="brid">病人ID</param>
        /// <param name="brlx">病人类型</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public bool ValidBrid(string brid, string brlx, out string msg)
        {
            bool result = false;

            msg = "";
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            int _count = -1;

            try
            {
                bool _flag = false;

                string findId1 = _builder.GetSqlValidBrid(brid, brlx, out _flag, out msg);
                if (!_flag)
                {
                    return(false);
                }

                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        _count = !dr.IsDBNull(0) ? dr.GetInt32(0) : 0;
                        if (_count <= 0)
                        {
                            msg    = "该病人id没找到或者已经过期";
                            result = false;
                        }
                        else
                        {
                            result = true;
                        }
                    }
                }
                else
                {
                    msg    = "该病人没找到";
                    result = false;
                }
            }
            catch (Exception ex)
            {
                msg = GetExceptionInfo(ex);
                return(false);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }

            return(result);
        }
예제 #2
0
        /// <summary>
        /// //温州市中西医结合医院和温州市苍南县第三人民医院(JC)
        /// // 新增温州市苍南县第二人民医院
        /// 转换brid成mzhm
        /// </summary>
        /// <param name="brid"></param>
        /// <param name="brlx"></param>
        /// <param name="mzhm"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        private int ConvertToBkhm(string brid, string brlx, out string mzhm, out string msg)
        {
            int ret = -1;
            mzhm = "";
            msg = "";
            string sql = "";

            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSZXYJHYY )
            {
                sql = _builder.QueryHMForZXYReport(brid, brlx);
            }
            else if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDSRMYY
                || WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZHTYY) 
            {
                sql = _builder.QueryHMForCNSYReport(brid, brlx);
            }
            else if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDERMYY)
            {
                sql = _builder.QueryHMForCNEYReport(brid, brlx);
            }

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr = null;

            try
            {
                dr = DbHelperOra.ExecuteReader(sql, connection);
                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        mzhm = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    }

                    ret = 0;
                }
                else
                {
                    msg = "没有找到报告信息";
                    ret = 2;
                }
                return ret;
            }
            catch (Exception ex)
            {
                msg = GetExceptionInfo(ex);
                return ret;
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }

                connection.Close();
            }
        }
예제 #3
0
        /// <summary>
        /// 查询医生信息(按拼音)
        /// </summary>
        /// <param name="queryName">拼音代码或医生名称</param>
        /// <param name="values">医生信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_ListDoctor(string queryName, out ArrayList values, out string msg)
        {
            msg = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                int ret = -99;

                string findId1 = _builder.QueryDoctorInfoSql(queryName);

                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    values = new ArrayList();
                    while (dr.Read())
                    {
                        DoctorInfo pd = new DoctorInfo();

                        pd.dm = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        pd.xm = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        pd.jb = !dr.IsDBNull(2) ? dr.GetString(2) : "";

                        values.Add(pd);
                    }
                    ret = 0;
                }
                else
                {
                    msg    = "亲,没有记录";
                    values = null;
                    ret    = 2;
                }

                dr.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg    = GetExceptionInfo(ex);
                values = null;
                return(-99);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #4
0
        /// <summary>
        /// 记录支付宝返回信息到数据库
        /// </summary>
        /// <param name="info"></param>
        /// <param name="jysj"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        private int LogAlipayRetInfo(AlipayReplyInfo info, DateTime jysj, out string msg)
        {
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            int ret = -1;

            msg = "";

            long count = 0;

            try
            {
                string sql = _builder.AlipayShtzCountSql(info.tradeno);
                dr = DbHelperOra.ExecuteReader(sql, connection);

                if (dr.Read())
                {
                    count = !dr.IsDBNull(0) ? dr.GetInt64(0) : 0;
                }

                if (count > 0)
                {
                    msg = "已经交易记录,无需插入";
                    ret = 38;
                    return(ret);
                }

                //记录支付宝返回记录
                ret = WriteAlipayRetInfoToDB(info, jysj, out msg);
                if (ret != 0)
                {
                    msg += "记录日志失败";
                    ret  = 39;
                }

                return(ret);
            }
            catch (Exception ex)
            {
                msg = GetExceptionInfo(ex);
                return(-1);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }

                if (null != connection && connection.State == ConnectionState.Open)
                {
                    connection.Close();
                }
            }
        }
예제 #5
0
        /// <summary>
        /// 查询医生详细信息
        /// </summary>
        /// <param name="ysdm">医生代码</param>
        /// <param name="values">医生信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_QueryDoctor(string ysdm, out ArrayList values, out string msg)
        {
            msg = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                int ret = -99;

                string findId1 = _builder.QueryDoctorInfoByDmSql(ysdm);

                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    values = new ArrayList();
                    while (dr.Read())
                    {
                        DoctorInfo pd = new DoctorInfo();

                        pd.jj = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        pd.sc = !dr.IsDBNull(1) ? dr.GetString(1) : "";

                        values.Add(pd);
                    }
                    ret = 0;
                }
                else
                {
                    msg    = "亲,没有记录";
                    values = null;
                    ret    = 2;
                }

                dr.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                msg    = GetExceptionInfo(ex);
                values = null;
                return(-99);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #6
0
        /// <summary>
        /// 取药查询
        /// </summary>
        /// <param name="brxm">病人姓名</param>
        /// <param name="lxdh">联系电话</param>
        /// <param name="values">取药信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_QueryPatientDrugInfo(string brxm, string lxdh, out ArrayList values, out string msg)
        {
            msg = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                int ret = -1;

                string findId1 = _builder.QueryPatientDrugInfoSql(brxm, lxdh);
                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    values = new ArrayList();
                    while (dr.Read())
                    {
                        PatientDrugInfo pd = new PatientDrugInfo();

                        pd.rq = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        pd.xh = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        pd.zt = !dr.IsDBNull(2) ? dr.GetString(2) : "";

                        values.Add(pd);
                    }
                    ret = 0;
                }
                else
                {
                    msg    = "亲,没有记录";
                    values = null;
                    ret    = -2;
                }

                dr.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                msg    = GetExceptionInfo(ex);
                values = null;
                return(-1);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #7
0
        /// <summary>
        /// 查看常用联系人ID
        /// </summary>
        /// <param name="openid">用户标识</param>
        /// <param name="name">姓名</param>
        /// <param name="idcardno">身份证号</param>
        /// <returns>0-成功  大于0-失败   小于0-异常</returns>
        private int DB_FindLinkmanid(string openid, string linkmanid, out string[] paramters, out string msg)
        {
            msg       = "";
            paramters = new string[2];

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            int ret = -1;

            try
            {
                string result           = "";
                string findLinkmanidSql = "select linkmanid, name from ui_table where openid = '{0}' and linkmanid = '{1}'";

                string[] _paramters = new string[2];
                _paramters[0] = openid;
                _paramters[1] = linkmanid;

                result = string.Format(findLinkmanidSql, _paramters);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, result);

                dr = DbHelperOra.ExecuteReader(result, connection);
                if (dr.Read())
                {
                    paramters[0] = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    paramters[1] = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                }

                if (null != dr)
                {
                    dr.Close();
                }

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #8
0
        /// <summary>
        /// 查看常用联系人ID
        /// </summary>
        /// <param name="openid">用户标识</param>
        /// <param name="name">姓名</param>
        /// <param name="idcardno">身份证号</param>
        /// <returns>0-成功  大于0-失败   小于0-异常</returns>
        private int DB_GetLinkmanid(string openid, out string linkmanid, out string msg)
        {
            msg       = "";
            linkmanid = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            int ret = -1;

            try
            {
                string result          = "";
                string getLinkmanidSql = "Select fun_get_linkmanid('{0}') From dual";

                string[] _paramters = new string[1];
                _paramters[0] = openid;

                result = string.Format(getLinkmanidSql, _paramters);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, result);

                dr = DbHelperOra.ExecuteReader(result, connection);
                if (dr.Read())
                {
                    linkmanid = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    ret       = 0;
                }

                if (null != dr)
                {
                    dr.Close();
                }

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #9
0
        /// <summary>
        ///  获取门诊充值信息
        /// </summary>
        /// <param name="patientid">病人ID</param>
        /// <returns>0-成功  大于0-失败   小于0-异常</returns>
        private int DB_GetMZCZInfo(string patientid, out UserJFInfo info, out string msg)
        {
            info = new UserJFInfo();
            msg  = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            int ret = -1;

            try
            {
                string findText = "select patientname, cardno, zhanghuzt, cardtype, idcardno, phone from ZFB_MENZHENKLB t where patientid = '" + patientid + "'";
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, findText);

                dr = DbHelperOra.ExecuteReader(findText, connection);
                if (dr.Read())
                {
                    info.brxm      = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    info.cardno    = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                    info.zhanghuzt = !dr.IsDBNull(2) ? Convert.ToString(dr.GetInt32(2)) : "";
                    info.cardtype  = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                    info.sfzh      = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                    info.lxdh      = !dr.IsDBNull(5) ? dr.GetString(5) : "";
                    ret            = 0;
                }
                else
                {
                    msg = "医院端未找到,请核对信息后重试";
                    ret = 10;
                }
                return(ret);
            }
            catch (Exception ex)
            {
                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                if (null != connection && ConnectionState.Open == connection.State)
                {
                    connection.Close();
                }
            }
        }
예제 #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sfid"></param>
        /// <param name="values"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public int GetChuFangList(string sfid, out ArrayList values, out string msg)
        {
            int result = -1;

            msg = "";
            string           sqlQuery   = string.Format("select cflsh,cfje from yyy_chufang_tf where sfid='{0}'", sfid);
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            values = null;
            try
            {
                dr = DbHelperOra.ExecuteReader(sqlQuery, connection);
                if (dr.HasRows)
                {
                    values = new ArrayList();
                    while (dr.Read())
                    {
                        ChuFangInfo entity = new ChuFangInfo();
                        entity.CFLSH = !dr.IsDBNull(0) ? dr.GetString(0) : " ";
                        entity.CFJE  = !dr.IsDBNull(1) ? Convert.ToString(dr.GetDouble(1)) : " ";
                        values.Add(entity);
                    }
                    result = 1;
                }
                else
                {
                    msg    = "没有查找到记录";
                    result = 0;
                }

                dr.Close();
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg    = GetExceptionInfo(ex);
                values = null;
                return(-1);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
            return(result);
        }
예제 #11
0
        /// <summary>
        /// 订单表中是否存在订单
        /// </summary>
        /// <param name="info"></param>
        /// <param name="brid"></param>
        /// <param name="brlx"></param>
        /// <param name="czje"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        private int ExistAlipayOrder(AlipayReplyInfo info, out string brid, out string brlx, out double czje, out string msg)
        {
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;
            int ret = -1;

            msg  = "";
            brid = "";
            brlx = "";
            czje = 0;

            try
            {
                string findId = _builder.QueryOrderInfoSql(info.tradeno);
                dr = DbHelperOra.ExecuteReader(findId, connection);
                if (dr.Read())
                {
                    brid = !dr.IsDBNull(0) ? Convert.ToString(dr.GetInt64(0)) : "";
                    czje = !dr.IsDBNull(1) ? dr.GetDouble(1) : 0;
                    brlx = !dr.IsDBNull(2) ? Convert.ToString(dr.GetInt32(2)) : "";
                    ret  = 0;
                }
                else
                {
                    msg = "没有该订单,数据非法";
                    ret = 40;
                }

                return(ret);
            }
            catch (Exception ex)
            {
                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                if (null != connection && ConnectionState.Open == connection.State)
                {
                    connection.Close();
                }
            }
        }
예제 #12
0
        private bool isUserbindcard(string openid, string cardno, string patientid, out string msg)
        {
            msg = "";
            bool   isbindcard = false;
            string number     = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                string result            = "";
                string isUserbindcardSql = "select name, phone, idcardno, cardno, patientid from ZFB_TIANJIACYLXR  where openid = '{0}' and cardno = '{1}' and patientid = '{2}'";

                string[] _paramters = new string[3];
                _paramters[0] = openid;
                _paramters[1] = cardno;
                _paramters[2] = patientid;

                result = string.Format(isUserbindcardSql, _paramters);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, result);

                dr = DbHelperOra.ExecuteReader(result, connection);
                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        number = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                    }
                    isbindcard = true;
                }

                return(isbindcard);
            }
            catch (Exception ex)
            {
                msg = GetExceptionInfo(ex);
                return(isbindcard);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #13
0
        /// <summary>
        /// 转换zyh门诊brid
        /// </summary>
        /// <param name="brid"></param>
        /// <param name="brlx"></param>
        /// <param name="mzhm"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        private int ConvertToMZBridForWzsdeyy(string brid, string brlx, out string mzhm, out string msg)
        {
            int ret = -1;
            mzhm = "";
            msg = "";
           

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr = null;

            string sql = "select ms.brid from ms_brda ms, zy_brry zy where zy.mzhm = ms.mzhm and zy.brxm =ms.brxm and zy.zyh = '" + brid + "'";

            try
            {
                dr = DbHelperOra.ExecuteReader(sql, connection);
                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        mzhm = !dr.IsDBNull(0) ? Convert.ToString(dr.GetInt64(0)) : "";
                    }

                    ret = 0;
                }
                else
                {
                    msg = "没有找到报告信息";
                    ret = 2;
                }
                return ret;
            }
            catch (Exception ex)
            {
                msg = ex.StackTrace;
                return ret;
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }

                connection.Close();
            }
        }
예제 #14
0
        private int ConvertToMZBridForWzstsxzyy(string brid, out string mzhm, out string msg)
        {
            int ret = -1;
            mzhm = "";
            msg = "";


            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr = null;

            string sql = "select zy.binglih from zy_bingrenxx zy where  zy.bingrenbh = '" + brid + "'";

            try
            {
                dr = DbHelperOra.ExecuteReader(sql, connection);
                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        mzhm = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    }

                    ret = 0;
                }
                else
                {
                    msg = "没有找到报告信息";
                    ret = 2;
                }
                return ret;
            }
            catch (Exception ex)
            {
                msg = ex.StackTrace;
                return ret;
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }

                connection.Close();
            }
        }
예제 #15
0
        private bool IsUserRegister(string openid, out string msg)
        {
            msg = "";
            bool   isRegister = false;
            string name       = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                string result            = "";
                string isUserRegisterSql = "select openid, name, idcardno from zfb_yonghuzc_bk where openid = '{0}'";

                string[] _paramters = new string[1];
                _paramters[0] = openid;

                result = string.Format(isUserRegisterSql, _paramters);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, result);

                dr = DbHelperOra.ExecuteReader(result, connection);
                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        name = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                    }
                    isRegister = true;
                }

                return(isRegister);
            }
            catch (Exception ex)
            {
                msg = GetExceptionInfo(ex);
                return(isRegister);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #16
0
        /// <summary>
        /// 绑卡号码是否有效
        /// </summary>
        /// <param name="brid">病人ID</param>
        /// <param name="cardno">绑卡号码</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        private bool IsCardnoValid(string brid, string cardno, out string msg)
        {
            bool result = false;

            msg = "";
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;
            string           getCardno  = "";

            try
            {
                bool _flag = false;

                string findId1 = _builder.GetSqlValidCardno(brid, cardno, out _flag, out msg);
                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        getCardno = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        result    = true;
                    }
                }
                else
                {
                    msg    = "该病人卡号已失效!";
                    result = false;
                }
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return(false);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }

            return(result);
        }
예제 #17
0
        private bool IsZYBrxxValid(string idcardno, string name, out string msg)
        {
            bool result = false;

            msg = "";
            OracleConnection connection  = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr          = null;
            string           inpatientno = "";

            try
            {
                bool _flag = false;

                string findId1 = _builder.GetIsZYBrxxValid(idcardno, name, out _flag, out msg);
                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        inpatientno = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        result      = true;
                    }
                }
                else
                {
                    msg    = "未找到住院号码!";
                    result = false;
                }
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return(false);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }

            return(result);
        }
예제 #18
0
        /// <summary>
        /// 获取缴费或退费联系人列表 (FY030101)
        /// </summary>
        /// <param name="openid"></param>
        /// <param name="values"></param>
        /// <param name="msg"></param>
        /// <returns>1=获取成功、其他代表失败</returns>
        public int QueryConnectPerson(string openid, out ArrayList values, out string msg)
        {
            int ret = -1;

            values = new ArrayList();
            msg    = "";
            string sqlQuery = string.Format("select linkmanid, label, name from ZFB_TIANJIACYLXR " +
                                            "where openid = '{0}'", openid);

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                dr = DbHelperOra.ExecuteReader(sqlQuery, connection);
                if (dr.HasRows)
                {
                    ConnectPerson entity = new ConnectPerson();
                    entity.brid  = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    entity.label = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                    entity.name  = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                    values.Add(entity);
                }
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
            return(1);
        }
예제 #19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="type"></param>
        /// <param name="values"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public int QueryPatientInfo(string id, string type, out ArrayList values, out string msg)
        {
            values = new ArrayList();
            msg    = "";
            int              ret        = -1;
            string           sqlQuery   = string.Format(" select * from FY030102 where id={0} and type={1} ", id, type);
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                dr = DbHelperOra.ExecuteReader(sqlQuery, connection);
                if (dr.HasRows)
                {
                    ConnectPerson entity = new ConnectPerson();
                    entity.brid  = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    entity.label = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                    entity.name  = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                    values.Add(entity);
                }
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
            return(1);
        }
예제 #20
0
        //读取系统时间
        public Boolean DB_Sysdate(out DateTime sysdate)
        {
            sysdate = Convert.ToDateTime(AppUtils.DateTime_Format);
            Boolean          _value     = false;
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                string findId = _builder.SysdateSql();
                dr = DbHelperOra.ExecuteReader(findId, connection);
                if (dr.Read())
                {
                    sysdate = !dr.IsDBNull(0) ? dr.GetDateTime(0) : Convert.ToDateTime(AppUtils.DateTime_Format);
                    _value  = true;
                }
                else
                {
                    _value = false;
                }
                dr.Close();
                return(_value);
            }
            catch (Exception)
            {
                return(false);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #21
0
        /// <summary>
        /// 通知病人就诊信息
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public int DB_InformPatient(out ArrayList values, out string msg)
        {
            int ret = -1;
            //1代表以预约
            int Preengagestate = 1;

            values = null;
            msg    = "";
            values = new ArrayList();

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                bool _flag = false;

                string interText = _builder.GetInformPatientSql(Preengagestate, out _flag, out msg);

                if (!_flag)
                {
                    return(10);
                }

                dr = DbHelperOra.ExecuteReader(interText, connection);
                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        while (dr.Read())
                        {
                            InformPatientInfo ri = new InformPatientInfo();
                            ri.userid = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                            ri.brxm   = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                            ri.ysxm   = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                            ri.jzdz   = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                            ri.jzsj   = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                            ri.jzrq   = !dr.IsDBNull(5) ? dr.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : " ";
                            values.Add(ri);
                        }
                        msg = "获取成功";
                    }
                    ret = 0;
                    dr.Close();
                    return(ret);
                }
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg    = GetExceptionInfo(ex);
                values = null;
                return(-1);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }

            return(ret);
        }
예제 #22
0
        /// <summary>
        /// 核对未到账的充值缴费信息
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public int DB_CheckInformation(out ArrayList values, out string msg)
        {
            int ret = -1;
            //0代表以创建的订单
            int ddzt = 0;

            values = null;
            msg    = "";
            values = new ArrayList();

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                bool _flag = false;

                string interText = _builder.GetCheckInformationSql(ddzt, out _flag, out msg);

                if (!_flag)
                {
                    return(10);
                }
                long yylsh = 0;
                dr = DbHelperOra.ExecuteReader(interText, connection);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        CheckInformation ri = new CheckInformation();
                        yylsh           = !dr.IsDBNull(0) ? dr.GetInt64(0) : 0;
                        ri.out_trade_no = StringHelper.YylshHasPrefix(yylsh);
                        ri.brlx         = !dr.IsDBNull(1) ?  Convert.ToString(dr.GetInt32(1)) : "";
                        if (ri.brlx == "1")
                        {
                            ri.patientid = !dr.IsDBNull(2) ? Convert.ToString(dr.GetInt64(2)) : "";
                        }
                        else if (ri.brlx == "2")
                        {
                            ri.inpatientno = !dr.IsDBNull(2) ? Convert.ToString(dr.GetInt64(2)) : "";
                        }
                        ri.patientname = !dr.IsDBNull(3) ? dr.GetString(3) : " ";
                        ri.money       = !dr.IsDBNull(4) ? Convert.ToString(dr.GetDouble(4)) : " ";
                        ri.openid      = !dr.IsDBNull(5) ? dr.GetString(5) : " ";
                        values.Add(ri);
                    }
                    msg = "获取成功";
                }
                ret = 0;
                dr.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg    = GetExceptionInfo(ex);
                values = null;
                return(-1);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #23
0
        /// <summary>
        /// 查询剩余床位数
        /// </summary>
        /// <param name="list">床位信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_QueryRemainBeds(out ArrayList list, out string msg)
        {
            msg  = "";
            list = null;


            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                bool _flag = false;

                string sql = _builder.GetSqlRemaindBeds(out _flag, out msg);

                if (!_flag)
                {
                    return(10);
                }

                int ret = -1;

                dr = DbHelperOra.ExecuteReader(sql, connection);
                if (dr.HasRows)
                {
                    list = new ArrayList();
                    while (dr.Read())
                    {
                        RemainBeds ri = new RemainBeds();
                        ri.bqmc = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSYJXDSRMYY)
                        {
                            ri.sycw = ri.zdcws = !dr.IsDBNull(1) ? dr.GetInt32(1) : 0;
                        }
                        else
                        {
                            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY ||
                                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDYRMYY ||
                                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXFYBJYY ||
                                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTSXZYY)
                            {
                                ri.bqid = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                            }
                            else
                            {
                                ri.bqid = !dr.IsDBNull(1) ? Convert.ToString(dr.GetInt64(1)) : "";
                            }

                            ri.zzrenshu = !dr.IsDBNull(2) ? dr.GetInt32(2) : 0;

                            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY)
                            {
                                ri.zdcws = !dr.IsDBNull(3) ? Convert.ToInt32(dr.GetString(3)) : 0;
                            }
                            else
                            {
                                ri.zdcws = !dr.IsDBNull(3) ? dr.GetInt32(3) : 0;
                            }
                            ri.sycw = (ri.zdcws - ri.zzrenshu) > 0 ? (ri.zdcws - ri.zzrenshu) : 0;
                            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDEYY)
                            {
                                ri.sycw = -ri.zzrenshu;
                            }
                        }
                        list.Add(ri);
                    }

                    ret = 0;
                }
                else
                {
                    list = null;
                    msg  = "没有找到床位信息。";
                    ret  = 1;
                }

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                list = null;
                msg  = GetExceptionInfo(ex);
                return(AppUtils.Default_Exception_Code);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #24
0
        /// <summary>
        /// 药品分页查询
        /// </summary>
        /// <param name="pNumber">所在页数</param>
        /// <param name="pRows">每页显示条数</param>
        /// <param name="values">药品信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_PageMedicine(int pNumber, int pRows, out ArrayList values, out string msg)
        {
            msg = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            values = new ArrayList();

            try
            {
                int  ret = -99;
                long maxrow;
                long minrow;
                General.CalculatePage(pNumber, pRows, out maxrow, out minrow);

                bool _flag = false;

                string findId1 = _builder.GetMedicinePage(maxrow, minrow, out _flag, out msg);

                if (!_flag)
                {
                    return(10);
                }

                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        MedicineDetail pd = new MedicineDetail();

                        pd.lx = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        pd.mc = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        pd.dw = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        pd.gg = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                        pd.cd = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                        pd.jg = !dr.IsDBNull(5) ? dr.GetDouble(5) : 0;


                        values.Add(pd);
                    }
                    ret = 0;
                }
                else
                {
                    msg    = "亲,没有记录";
                    values = null;
                    ret    = 2;
                }

                dr.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg    = GetExceptionInfo(ex);
                values = null;
                return(-1);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #25
0
        /// <summary>
        /// 收费项目查询(按拼音码)
        /// </summary>
        /// <param name="pydm">拼音代码</param>
        /// <param name="values">收费信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_QueryCharge(string pydm, out ArrayList values, out string msg)
        {
            msg = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            values = new ArrayList();

            try
            {
                int ret = -1;

                bool _flag = false;

                string findId1 = _builder.GetChargeByPy(pydm, out _flag, out msg);
                if (!_flag)
                {
                    return(10);
                }

                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        ChargeDetail pd = new ChargeDetail();

                        pd.lx = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        pd.mc = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        pd.dw = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        pd.jg = !dr.IsDBNull(3) ? dr.GetDouble(3) : 0;

                        values.Add(pd);
                    }
                    ret = 0;
                }
                else
                {
                    msg    = "亲,没有记录";
                    values = null;
                    ret    = 2;
                }

                dr.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg    = GetExceptionInfo(ex);
                values = null;
                return(-99);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #26
0
        /// <summary>
        /// 根据报告单号查询报告详细
        /// </summary>
        /// <param name="bgdh">报告单号</param>
        /// <param name="rds">报告信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_queryReportJCDetail(string bgdh, out ICollection <ReportDetail> rds, out string msg)
        {
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            try
            {
                bool _flag = false;

                string sql = _builder.GetReportJCDetailXM(bgdh, out _flag, out msg);

                if (!_flag)
                {
                    rds = new List <ReportDetail>();
                    return(10);
                }

                dr = DbHelperOra.ExecuteReader(sql, connection);
                if (dr.HasRows)
                {
                    rds = new List <ReportDetail>();
                    while (dr.Read())
                    {
                        ReportDetail rd = new ReportDetail();
                        rd.mc   = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        rd.dw   = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        rd.ckjg = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        rd.ts   = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                        rd.jg   = !dr.IsDBNull(4) ? dr.GetString(4) : "";

                        rds.Add(rd);
                    }


                    msg = "找到报告明细";
                    return(0);
                }
                else
                {
                    rds = null;
                    msg = "未找到报告详细内容";
                    return(2);
                }
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg = GetExceptionInfo(ex);
                rds = null;
                return(-2);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #27
0
        /// <summary>
        /// 根据条形码或者报告单号报告明细
        /// </summary>
        /// <param name="code">条形码或者报告单号</param>
        /// <param name="lx">号码类型 1:报告单号 2条码查询</param>
        /// <param name="values">报告信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_queryReportJCListByCode(string code, string lx, string brxm, out ArrayList values, out string msg)
        {
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            values = new ArrayList();
            try
            {
                bool   _flag = false;
                string sql   = _builder.GetSqlReportJCDetail(code, lx, brxm, out _flag, out msg);

                if (!_flag)
                {
                    return(10);
                }

                int ret = -99;
                msg = "";
                dr  = DbHelperOra.ExecuteReader(sql, connection);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        ReportInfo ri = new ReportInfo();
                        ri.bgdh = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        ri.sjmd = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        ri.cjsj = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        ri.sjr  = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                        ri.jysj = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                        ri.jyr  = !dr.IsDBNull(5) ? dr.GetString(5) : "";
                        ri.shr  = !dr.IsDBNull(6) ? dr.GetString(6) : "";
                        ri.jzch = !dr.IsDBNull(7) ? dr.GetString(7) : "";
                        ri.zdjg = !dr.IsDBNull(8) ? dr.GetString(8) : "";
                        ri.bbmc = !dr.IsDBNull(9) ? dr.GetString(9) : "";
                        ri.mzbz = !dr.IsDBNull(10) ? dr.GetString(10) : "";
                        ri.dyjb = !dr.IsDBNull(11) ? dr.GetString(11) : "";
                        ri.bz   = !dr.IsDBNull(12) ? dr.GetString(12) : "";
                        ri.hzbh = !dr.IsDBNull(13) ? dr.GetString(13) : "";
                        ri.sbm  = !dr.IsDBNull(14) ? dr.GetString(14) : "";
                        ri.brxm = !dr.IsDBNull(15) ? dr.GetString(15) : "";
                        ri.jgmc = WebConfigParameter.HospitalChinaName();

                        ICollection <ReportDetail> rds;
                        string child_msg;
                        int    rtDetail = DB_queryReportJCDetail(ri.bgdh, out rds, out child_msg);
                        if (rtDetail == 0)
                        {
                            ri.details = rds;
                        }
                        else
                        {
                            msg += "[单号" + ri.bgdh + "详细查询错误]" + child_msg + ";";
                            ret  = 3;
                        }
                        values.Add(ri);
                    }

                    ret = 0;
                }
                else
                {
                    values = null;
                    msg    = "未能找到该编号的报告单,请检查编号";
                    ret    = 2;
                }

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                values = null;
                msg    = GetExceptionInfo(ex);
                return(AppUtils.Default_Exception_Code);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #28
0
        /// <summary>
        /// 一个检验报告单抬头信息
        /// </summary>
        /// <param name="doctadviseno">条码号</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_InspectionReportNameInformation(string doctadviseno, out AlipayReportInfo alipayReportInfo, out string msg)
        {
            msg = "";
            alipayReportInfo = new AlipayReportInfo();

            OracleConnection oracleConnection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            SqlConnection    sqlConnection    = new SqlConnection(WebConfigParameter.ConnectionLisString);
            OracleDataReader dr       = null;
            SqlDataReader    myReader = null;

            int ret = -1;

            try
            {
                bool   _flag     = false;
                string sqlstr    = "";
                string oraclestr = "";
                _builder.GetInspectionReportNameInformation(doctadviseno, out sqlstr, out oraclestr, out _flag, out msg);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, sqlstr);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, oraclestr);

                if (!_flag)
                {
                    return(10);
                }

                msg = "";
                dr  = DbHelperOra.ExecuteReader(oraclestr, oracleConnection);
                if (null != dr && dr.HasRows)
                {
                    if (dr.Read())
                    {
                        alipayReportInfo.doctadviseno     = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        alipayReportInfo.requesttime      = !dr.IsDBNull(1) ? dr.GetDateTime(1).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.requester        = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        alipayReportInfo.executetime      = !dr.IsDBNull(3) ? dr.GetDateTime(3).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.executer         = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                        alipayReportInfo.receivetime      = !dr.IsDBNull(5) ? dr.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.receiver         = !dr.IsDBNull(6) ? dr.GetString(6) : "";
                        alipayReportInfo.stayhospitalmode = !dr.IsDBNull(7) ? dr.GetString(7) : "";
                        alipayReportInfo.patientid        = !dr.IsDBNull(8) ? dr.GetString(8) : "";
                        alipayReportInfo.section          = !dr.IsDBNull(9) ? dr.GetString(9) : "";
                        alipayReportInfo.bedno            = !dr.IsDBNull(10) ? dr.GetString(10) : "";
                        alipayReportInfo.patientname      = !dr.IsDBNull(11) ? dr.GetString(11) : "";
                        alipayReportInfo.sex         = !dr.IsDBNull(12) ? dr.GetString(12) : "";
                        alipayReportInfo.age         = !dr.IsDBNull(13) ? dr.GetString(13) : "";
                        alipayReportInfo.diagnostic  = !dr.IsDBNull(14) ? dr.GetString(14) : "";
                        alipayReportInfo.sampletype  = !dr.IsDBNull(15) ? dr.GetString(15) : "";
                        alipayReportInfo.examinaim   = !dr.IsDBNull(16) ? dr.GetString(16) : "";
                        alipayReportInfo.requestmode = !dr.IsDBNull(17) ? dr.GetString(17) : "";
                        alipayReportInfo.checker     = !dr.IsDBNull(18) ? dr.GetString(18) : "";
                        alipayReportInfo.checktime   = !dr.IsDBNull(19) ? dr.GetDateTime(19).ToString(AppUtils.DateTime_Format_All) : "";
                        alipayReportInfo.csyq        = !dr.IsDBNull(20) ? dr.GetString(20) : "";
                        alipayReportInfo.profiletest = !dr.IsDBNull(21) ? dr.GetString(21) : "";
                        ret = 0;
                    }
                    return(ret);
                }

                if (!string.IsNullOrEmpty(WebConfigParameter.ConnectionLisString))
                {
                    myReader = DbHelperSQL.ExecuteReader(sqlstr, sqlConnection);
                    if (null != myReader && myReader.HasRows)
                    {
                        if (myReader.Read())
                        {
                            alipayReportInfo.doctadviseno     = !myReader.IsDBNull(0) ? myReader.GetString(0) : "";
                            alipayReportInfo.requesttime      = !myReader.IsDBNull(1) ? myReader.GetDateTime(1).ToString(AppUtils.DateTime_Format_All) : "";
                            alipayReportInfo.requester        = !myReader.IsDBNull(2) ? myReader.GetString(2) : "";
                            alipayReportInfo.executetime      = !myReader.IsDBNull(3) ? myReader.GetDateTime(3).ToString(AppUtils.DateTime_Format_All) : "";
                            alipayReportInfo.executer         = !myReader.IsDBNull(4) ? myReader.GetString(4) : "";
                            alipayReportInfo.receivetime      = !myReader.IsDBNull(5) ? myReader.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : "";
                            alipayReportInfo.receiver         = !myReader.IsDBNull(6) ? myReader.GetString(6) : "";
                            alipayReportInfo.stayhospitalmode = !myReader.IsDBNull(7) ? myReader.GetString(7) : "";
                            alipayReportInfo.patientid        = !myReader.IsDBNull(8) ? myReader.GetString(8) : "";
                            alipayReportInfo.section          = !myReader.IsDBNull(9) ? myReader.GetString(9) : "";
                            alipayReportInfo.bedno            = !myReader.IsDBNull(10) ? myReader.GetString(10) : "";
                            alipayReportInfo.patientname      = !myReader.IsDBNull(11) ? myReader.GetString(11) : "";
                            alipayReportInfo.sex = !myReader.IsDBNull(12) ? Convert.ToString(myReader.GetInt32(12)) : "";
                            if (alipayReportInfo.sex == "1")
                            {
                                alipayReportInfo.sex = "男";
                            }
                            else if (alipayReportInfo.sex == "2")
                            {
                                alipayReportInfo.sex = "女";
                            }
                            alipayReportInfo.age         = !myReader.IsDBNull(13) ? Convert.ToString(myReader.GetDouble(13)) : "";
                            alipayReportInfo.diagnostic  = !myReader.IsDBNull(14) ? myReader.GetString(14) : "";
                            alipayReportInfo.sampletype  = !myReader.IsDBNull(15) ? myReader.GetString(15) : "";
                            alipayReportInfo.examinaim   = !myReader.IsDBNull(16) ? myReader.GetString(16) : "";
                            alipayReportInfo.requestmode = !myReader.IsDBNull(17) ? myReader.GetString(17) : "";
                            alipayReportInfo.checker     = !myReader.IsDBNull(18) ? myReader.GetString(18) : "";
                            alipayReportInfo.checktime   = !myReader.IsDBNull(19) ? myReader.GetDateTime(19).ToString(AppUtils.DateTime_Format_All) : "";
                            alipayReportInfo.csyq        = !myReader.IsDBNull(20) ? myReader.GetString(20) : "";
                            alipayReportInfo.profiletest = !myReader.IsDBNull(21) ? myReader.GetString(21) : "";
                            ret = 0;
                        }
                    }
                }
                else
                {
                    msg = "未能找到报告单";
                    ret = 17;
                }

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg = GetExceptionInfo(ex);
                return(AppUtils.Default_Exception_Code);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                if (null != myReader)
                {
                    myReader.Close();
                }
                oracleConnection.Close();
                sqlConnection.Close();
            }
        }
예제 #29
0
        /// <summary>
        /// 查询报告单列表(根据病人ID)
        /// </summary>
        /// <param name="brid">病人ID</param>
        /// <param name="brlx">病人类型 1:门诊病人 2:住院病人</param>
        /// <param name="values">报告单信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_queryReportJCListByBRID(string brid, string brlx, out ArrayList values, out string msg)
        {
            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            values = new ArrayList();
            try
            {
                bool _flag = false;

                string sql = _builder.GetSqlReportJCListForWzscnxdyrmyy(brid, brlx, out _flag, out msg);

                if (!_flag)
                {
                    return(10);
                }

                int ret = -1;
                msg = "";
                dr  = DbHelperOra.ExecuteReader(sql, connection);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        ReportInfo ri = new ReportInfo();
                        ri.bgdh = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        ri.sjmd = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        ri.jysj = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        ri.jgmc = WebConfigParameter.HospitalChinaName();

                        values.Add(ri);
                    }

                    ret = 0;
                }
                else
                {
                    values = null;
                    msg    = "未能找到报告单";
                    ret    = 2;
                }

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                values = null;
                msg    = GetExceptionInfo(ex);
                return(AppUtils.Default_Exception_Code);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
예제 #30
0
        /// <summary>
        /// 一个检验报告单详细列表信息
        /// </summary>
        /// <param name="doctadviseno">条码号</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_InspectionReportResultsInformation(string doctadviseno, out AlipayInspectionReport alipayInspectionReport, out string msg)
        {
            msg = "";
            alipayInspectionReport = new AlipayInspectionReport();

            OracleConnection oracleConnection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            SqlConnection    sqlConnection    = new SqlConnection(WebConfigParameter.ConnectionLisString);
            OracleDataReader dr       = null;
            SqlDataReader    myReader = null;

            int ret = -1;

            try
            {
                bool   _flag     = false;
                string sqlstr    = "";
                string oraclestr = "";
                _builder.GetDInspectionReportResultsInformation(doctadviseno, out sqlstr, out oraclestr, out _flag, out msg);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, sqlstr);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, oraclestr);

                if (!_flag)
                {
                    return(10);
                }

                msg = "";
                dr  = DbHelperOra.ExecuteReader(oraclestr, oracleConnection);
                if (null != dr && dr.HasRows)
                {
                    if (dr.Read())
                    {
                        alipayInspectionReport.studyresult = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        alipayInspectionReport.diagresult  = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        ret = 0;
                    }
                    return(ret);
                }

                if (!string.IsNullOrEmpty(WebConfigParameter.ConnectionLisString))
                {
                    myReader = DbHelperSQL.ExecuteReader(sqlstr, sqlConnection);
                    if (null != myReader && myReader.HasRows)
                    {
                        if (myReader.Read())
                        {
                            alipayInspectionReport.studyresult = !myReader.IsDBNull(0) ? myReader.GetString(0) : "";
                            alipayInspectionReport.diagresult  = !myReader.IsDBNull(1) ? myReader.GetString(1) : "";
                            ret = 0;
                        }
                    }
                }
                else
                {
                    msg = "未能找到报告单";
                    ret = 17;
                }

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg = GetExceptionInfo(ex);
                return(AppUtils.Default_Exception_Code);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                if (null != myReader)
                {
                    myReader.Close();
                }
                oracleConnection.Close();
                sqlConnection.Close();
                oracleConnection.Close();
                sqlConnection.Close();
            }
        }