/// <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();
            }
        }
        /// <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();
            }
        }
Beispiel #3
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)
        {
            string oracleConStr = GetJCReportDBConStr();
            string hm = brid;
            values = new ArrayList();

            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSZXYJHYY || 
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDSRMYY ||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDERMYY)
            {
                if (ConvertToBkhm(brid, brlx, out hm, out msg) != 0)
                {
                    return 3;
                }
            }
            else if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDEYY && null != brlx && brlx.Equals("2"))
            {
                if (ConvertToMZBridForWzsdeyy(brid, brlx, out hm, out msg) != 0)
                {
                    return 3;
                }
            }

            OracleConnection connection = new OracleConnection(oracleConStr);
            OracleDataReader dr = null;
            values = new ArrayList();

            try
            {
                bool _flag = false;

                string sql = _builder.GetSqlReportJCList(hm, brlx, 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) ? Convert.ToString(dr.GetInt32(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();

                        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();
            }
        }
Beispiel #4
0
        private int Patientinfo(string bgdh, out ReportInfo reportInfo, out string msg)
        {
            int result = -99;

            msg        = "";
            reportInfo = new ReportInfo();
            WebserviceOpe _webservice;

            _webservice = new WebserviceOpe();
            try
            {
                Object[] obj = new Object[1];
                obj[0] = bgdh;

                string _webResult = _webservice.WebserviceRetInfo(WebConfigParameter.WebserviceUrl,
                                                                  WebConfigParameter.WebserviceClassName, "getpatientinfo", obj);
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(_webResult);

                XmlNode data = doc.SelectSingleNode("data");
                if (null == data)
                {
                    msg = "调用后台WEBSERVICE出错";
                    return(-1);
                }

                XmlNode stateNode = data.SelectSingleNode("state");
                if (null == stateNode)
                {
                    msg = "调用后台WEBSERVICE出错";
                    return(-1);
                }

                int stateResult = Convert.ToInt32(stateNode.InnerText);
                if (stateResult != 1)
                {
                    if (stateResult == 0)
                    {
                        XmlNode resultError = data.SelectSingleNode("result");
                        if (null == resultError)
                        {
                            msg = "调用后台WEBSERVICE出错";
                            return(-1);
                        }
                        else
                        {
                            msg = resultError.InnerText;
                        }
                        return(2);
                    }
                    msg = "调用后台WEBSERVICE出错";
                    return(-1);
                }

                XmlNode resultNode = data.SelectSingleNode("result");
                if (null == resultNode)
                {
                    msg = "调用后台WEBSERVICE出错";
                    return(-1);
                }

                XmlNode itemNode = resultNode.SelectSingleNode("item");
                if (null == itemNode)
                {
                    msg = "调用后台WEBSERVICE出错";
                    return(-1);
                }

                foreach (XmlNode childNode in itemNode.ChildNodes)
                {
                    string name = childNode.Name;
                    switch (name)
                    {
                    case "requesttime":
                        reportInfo.cjsj = childNode.InnerText;
                        break;

                    case "requester":
                        reportInfo.sjr = childNode.InnerText;
                        break;

                    case "executetime":
                        reportInfo.jysj = childNode.InnerText;
                        break;

                    case "executer":
                        reportInfo.jyr = childNode.InnerText;
                        break;

                    case "receiver":
                        reportInfo.shr = childNode.InnerText;
                        break;

                    case "section":
                        reportInfo.jzch = childNode.InnerText;
                        break;

                    case "diagnostic":
                        reportInfo.zdjg = childNode.InnerText;
                        break;

                    case "sampletype":
                        reportInfo.bbmc = childNode.InnerText;
                        break;

                    case "stayhospitalmode":
                        reportInfo.mzbz = childNode.InnerText;
                        break;

                    case "patientid":
                        reportInfo.hzbh = childNode.InnerText;
                        break;

                    case "patientname":
                        reportInfo.brxm = childNode.InnerText;
                        break;
                    }
                }

                reportInfo.jgmc = WebConfigParameter.HospitalChinaName();
                result          = 0;
            }
            catch (Exception ex)
            {
                msg = GetExceptionInfo(ex);
            }


            return(result);
        }
Beispiel #5
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 QueryReportListByCode(string code1, string lx, string brxm, out ArrayList values, out string msg)
        {
            string hm = code1;
            string _oraConStr = WebConfigParameter.ConnectionHisString;
            values = new ArrayList();
            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSZXYJHYY)
            {
                _oraConStr = WebConfigParameter.ConnectionLisString;

                if (lx.Equals("2"))
                {
                    hm = RealSbmForWZSZXYJHYY(hm);
                }
            }
            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDSRMYY||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDERMYY||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTXRMYY||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSRAZYY||
                WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZHTYY)
            {
                _oraConStr = WebConfigParameter.ConnectionLisString;
            }

            OracleConnection connection = new OracleConnection(_oraConStr);
            OracleDataReader dr = null;

            try
            {
                bool _flag = false;
                string sql = _builder.GetSqlReportDetail(hm, lx, brxm, 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();
                        if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSYJXDSRMYY)
                        {
                            ri.bgdh = !dr.IsDBNull(0) ? Convert.ToString(dr.GetInt64(0)) : "";
                        }
                        else
                        {
                            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) : "";
                        if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDYRMYY ||
                            WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXFYBJYY ||
                            WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTSXZYY)
                        {
                            ri.sbm = !dr.IsDBNull(14) ? Convert.ToString(dr.GetInt64(14)) : "";
                        }
                        else
                        {
                            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_QueryReportDetail(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();
            }
        }