Esempio n. 1
0
        public void hospitalNameTest()
        {
            string actual         = Convert.ToString(WebConfigParameter.HospitalName());
            string resultExcepted = "温州市";

            Assert.AreEqual(resultExcepted, actual);
        }
Esempio n. 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();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 是否支持充值功能
        /// </summary>
        /// <returns></returns>
        private bool IsSupportPayment(string brlx)
        {
            bool result = false;

            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDEYY)
            {
                result = true;
            }
            else if (brlx.Equals("1") &&
                     (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY))
            {
                result = true;
            }
            else if (brlx.Equals("2") &&
                     WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY)
            {
                result = true;
            }

            return(result);
        }
Esempio n. 4
0
        /// <summary>
        /// 获得检查报告的数据库的连接字符串
        /// </summary>
        /// <returns></returns>
        private  string GetJCReportDBConStr()
        {
            string oracleConStr = WebConfigParameter.ConnectionHisString;

            if (AppUtils.HOSPITALNAME.WZSZXYJHYY == WebConfigParameter.HospitalName()||
                AppUtils.HOSPITALNAME.WZSYJXDSRMYY == WebConfigParameter.HospitalName())
            {
                oracleConStr = WebConfigParameter.ConnectionLisString;
            }

            else if (AppUtils.HOSPITALNAME.WZSCNXDSRMYY == WebConfigParameter.HospitalName()
                  ||AppUtils.HOSPITALNAME.WZSCNXDYRMYY == WebConfigParameter.HospitalName()
                  ||AppUtils.HOSPITALNAME.WZSCNXDERMYY == WebConfigParameter.HospitalName()
                  || AppUtils.HOSPITALNAME.WZSTXRMYY == WebConfigParameter.HospitalName()
                  || AppUtils.HOSPITALNAME.WZSRAZYY == WebConfigParameter.HospitalName()
                  || AppUtils.HOSPITALNAME.WZSTSXZYY == WebConfigParameter.HospitalName()
                  || AppUtils.HOSPITALNAME.WZSRARMYY == WebConfigParameter.HospitalName())
            {
                oracleConStr = WebConfigParameter.ConnectionPacsString;
            }

            return oracleConStr;
        }
Esempio n. 5
0
        /// <summary>
        /// 根据报告单号查询报告详细
        /// </summary>
        /// <param name="bgdh">报告单号</param>
        /// <param name="rds">报告信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_queryReportDetail(string bgdh, out ICollection <ReportDetail> rds, out string msg)
        {
            string _oraConStr = WebConfigParameter.ConnectionHisString;

            if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSZXYJHYY)
            {
                _oraConStr = WebConfigParameter.ConnectionLisString;
            }

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


            try
            {
                bool _flag = false;

                string sql = _builder.GetReportDetailXM(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();
            }
        }
Esempio n. 6
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();
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 卡号是否是否有效
        /// </summary>
        /// <param name="brid">病人ID</param>
        /// <param name="bkhm">病人号码</param>
        /// <param name="brlx">病人类型 1:门诊病人 2:住院病人</param>
        /// <param name="msg">返回错误信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_ValidCard(string brid, string bkhm, string brlx, out string msg)
        {
            msg = "";
            int ret = -1;

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

            try
            {
                //说明返回值
                // 0:成功,
                // 1:该病人绑卡数据有误
                // 2: 记录已找到,但是没有该病人ID
                // 3: 绑卡记录没找到,确认办卡信息
                string _brid = "";


                bool _flag = false;

                string sqlStr = _builder.GetBridByBkhmSql(bkhm, brid, brlx, out _flag, out msg);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, sqlStr);

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

                dr = DbHelperOra.ExecuteReader(sqlStr, connection);
                if (dr.HasRows)
                {
                    if (dr.Read())
                    {
                        if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY ||
                            WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDYRMYY)
                        {
                            _brid = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        }
                        else
                        {
                            _brid = !dr.IsDBNull(0) ? Convert.ToString(dr.GetInt64(0)) : "";
                        }

                        if (_brid != brid || _brid.Equals(""))
                        {
                            msg = "绑卡信息有误";
                            ret = 13;
                        }
                        else
                        {
                            msg = "成功,该病人绑卡数据有效";
                            ret = 00;
                        }
                    }
                    else
                    {
                        msg = "记录已找到,但是没有该病人ID";
                        ret = 14;
                    }
                }
                else
                {
                    msg = "绑卡记录没找到,确认办卡信息";
                    ret = 15;
                }

                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();
            }
        }
Esempio n. 8
0
        public XmlDocument QueryReportDetailByCodeFromWebservice(string bgdh, string brxm, string lxdh)
        {
            XmlDocument doc = new XmlDocument();

            try
            {
                ArrayList values    = new ArrayList();
                string    error_msg = "";
                string    endTime   = DateTime.Now.ToString(AppUtils.DateTime_FormatNO_YearMonthDay);
                string    startTime = DateTime.Now.AddDays(-60).ToString(AppUtils.DateTime_FormatNO_YearMonthDay);
                //DateTime endTime = DateTime.Now;
                //DateTime startTime = DateTime.Now.AddDays(-60);

                int ret = -1;
                if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSZYY)
                {
                    ReportInfoHandleForWZSZYY pdb = new ReportInfoHandleForWZSZYY();
                    ret = pdb.ReportDetailInfoList(bgdh, brxm, lxdh, startTime, endTime, out values, out error_msg);
                }

                if (ret == 0)
                {
                    XmlElement root = doc.CreateElement(AppUtils.Tag_REXML_Root);
                    doc.AppendChild(root);

                    XmlElement eleResult = doc.CreateElement(AppUtils.Tag_REXML_Result);
                    eleResult.InnerText = AppUtils.Value_Return_Success;
                    root.AppendChild(eleResult);

                    XmlElement eleMsg = doc.CreateElement(AppUtils.Tag_REXML_Message);
                    root.AppendChild(eleMsg);
                    foreach (ReportInfo ri in values)
                    {
                        XmlElement eleValue = doc.CreateElement(AppUtils.Tag_REXML_Value);

                        string[] tags = { AppUtils.Tag_Payment_BGDH, AppUtils.Tag_Payment_SJMD, AppUtils.Tag_Payment_CJSJ, AppUtils.Tag_Payment_SJR,
                                          AppUtils.Tag_Payment_JYSJ, AppUtils.Tag_Payment_JYR,  AppUtils.Tag_Payment_SHR,  AppUtils.Tag_Payment_JZCH,
                                          AppUtils.Tag_Payment_ZDJG, AppUtils.Tag_Payment_BBMC, AppUtils.Tag_Payment_MZBZ, AppUtils.Tag_Payment_DYJB,
                                          AppUtils.Tag_Payment_BZ,   AppUtils.Tag_Payment_HZHB, AppUtils.Tag_Query_SBM };

                        foreach (string tag in tags)
                        {
                            string     value  = ri.getValue(tag);
                            XmlElement eleTag = doc.CreateElement(tag);
                            eleTag.InnerText = (null != value) ? value : "";
                            eleValue.AppendChild(eleTag);
                        }

                        XmlElement eleItem = doc.CreateElement(AppUtils.Tag_REXML_ITEM);
                        eleValue.AppendChild(eleItem);


                        ICollection <ReportDetail> col = ri.details;
                        if (null != col && col.Count > 0)
                        {
                            XmlAttribute attrZB = doc.CreateAttribute("code");
                            attrZB.InnerText = "zb";
                            eleItem.Attributes.Append(attrZB);

                            foreach (ReportDetail rd in col)
                            {
                                XmlElement eleRD = GetReportDetailElement(doc, rd, AppUtils.Tag_REXML_Value);
                                eleItem.AppendChild(eleRD);
                            }
                        }
                        eleMsg.AppendChild(eleValue);
                    }
                }
                else
                {
                    doc = ErrorReturnXml(ret, error_msg);
                }
            }
            catch (Exception ex)
            {
                doc = ReplyXmlDoc.GetExceptionXML(AppUtils.Default_Exception_Code, ex);
            }

            return(doc);
        }
Esempio n. 9
0
        /// <summary>
        /// 根据号码查询明细
        /// </summary>
        /// <param name="code">号码</param>
        /// <param name="lx">类型  1-按报告单号查询 2-按条码查</param>
        /// <param name="brxm">病人姓名</param>
        /// <returns></returns>
        public XmlDocument QueryReportJCDetailByCode(string code, string lx, string brxm)
        {
            XmlDocument doc = new XmlDocument();

            try
            {
                ArrayList values    = new ArrayList();
                string    error_msg = "";

                int ret = -1;
                if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDSRMYY)
                {
                    ReportDBForWZSDSRMYY pdb = new ReportDBForWZSDSRMYY();
                    ret = pdb.QueryReportJCByCode(code, lx, out values, out error_msg);
                }
                else
                {
                    QueryReportDB pdb = new QueryReportDB();
                    ret = pdb.DB_QueryReportJCListByCode(code, lx, brxm, out values, out error_msg);
                }

                if (ret == 0)
                {
                    XmlElement root = doc.CreateElement(AppUtils.Tag_REXML_Root);
                    doc.AppendChild(root);

                    XmlElement eleResult = doc.CreateElement(AppUtils.Tag_REXML_Result);
                    eleResult.InnerText = AppUtils.Value_Return_Success;
                    root.AppendChild(eleResult);

                    XmlElement eleMsg = doc.CreateElement(AppUtils.Tag_REXML_Message);
                    root.AppendChild(eleMsg);
                    foreach (ReportInfo ri in values)
                    {
                        XmlElement eleValue = doc.CreateElement(AppUtils.Tag_REXML_Value);

                        string[] tags = { AppUtils.Tag_Payment_BGDH, AppUtils.Tag_Payment_SJMD, AppUtils.Tag_Payment_CJSJ, AppUtils.Tag_Payment_SJR,
                                          AppUtils.Tag_Payment_JYSJ, AppUtils.Tag_Payment_JYR,  AppUtils.Tag_Payment_SHR,  AppUtils.Tag_Payment_JZCH,
                                          AppUtils.Tag_Payment_ZDJG, AppUtils.Tag_Payment_BBMC, AppUtils.Tag_Payment_MZBZ, AppUtils.Tag_Payment_DYJB,
                                          AppUtils.Tag_Payment_BZ,   AppUtils.Tag_Payment_HZHB, AppUtils.Tag_Query_SBM };

                        foreach (string tag in tags)
                        {
                            string     value  = ri.getValue(tag);
                            XmlElement eleTag = doc.CreateElement(tag);
                            eleTag.InnerText = (null != value) ? value : "";
                            eleValue.AppendChild(eleTag);
                        }

                        XmlElement eleItem = doc.CreateElement(AppUtils.Tag_REXML_ITEM);
                        eleValue.AppendChild(eleItem);


                        ICollection <ReportDetail> col = ri.details;
                        if (null != col && col.Count > 0)
                        {
                            XmlAttribute attrZB = doc.CreateAttribute("code");
                            attrZB.InnerText = "zb";
                            eleItem.Attributes.Append(attrZB);

                            foreach (ReportDetail rd in col)
                            {
                                XmlElement eleRD = GetReportDetailElement(doc, rd, AppUtils.Tag_REXML_Value);
                                eleItem.AppendChild(eleRD);
                            }
                        }

                        eleMsg.AppendChild(eleValue);
                    }
                }
                else
                {
                    doc = ErrorReturnXml(ret, error_msg);
                }
            }
            catch (Exception ex)
            {
                doc = ReplyXmlDoc.GetExceptionXML(AppUtils.Default_Exception_Code, ex);
            }
            return(doc);
        }
Esempio n. 10
0
        /// <summary>
        /// 根据病人id查询报告单列表
        /// </summary>
        /// <param name="brid">病人id</param>
        /// <param name="brlx">病人类型 1-门诊病人 2-住院病人</param>
        /// <param name="brxm">病人姓名</param>
        /// <returns></returns>
        public XmlDocument QueryReportList(string brid, string brlx)
        {
            XmlDocument doc = new XmlDocument();

            try
            {
                ArrayList values    = new ArrayList();
                string    error_msg = "";

                int ret = -1;

                //根据医院名字调用不同的接口
                if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDSRMYY)
                {
                    ReportDBForWZSDSRMYY pdb = new ReportDBForWZSDSRMYY();
                    ret = pdb.QueryReportListByBRID(brid, brlx, out values, out error_msg);
                }
                else
                {
                    QueryReportDB pdb = new QueryReportDB();
                    ret = pdb.QueryReportListByBRID(brid, brlx, out values, out error_msg);
                }

                if (ret == 0 && null != values && values.Count > 0)
                {
                    XmlElement root = doc.CreateElement(AppUtils.Tag_REXML_Root);
                    doc.AppendChild(root);

                    XmlElement eleResult = doc.CreateElement(AppUtils.Tag_REXML_Result);
                    eleResult.InnerText = AppUtils.Value_Return_Success;
                    root.AppendChild(eleResult);

                    XmlElement eleMsg = doc.CreateElement(AppUtils.Tag_REXML_Message);
                    root.AppendChild(eleMsg);

                    foreach (ReportInfo ri in values)
                    {
                        XmlElement eleValue = doc.CreateElement(AppUtils.Tag_REXML_Value);

                        string[] tags = { AppUtils.Tag_Payment_BGDH, AppUtils.Tag_Payment_SJMD, AppUtils.Tag_Payment_CJSJ, AppUtils.Tag_Payment_SJR,
                                          AppUtils.Tag_Payment_JYSJ, AppUtils.Tag_Payment_JYR,  AppUtils.Tag_Payment_SHR,  AppUtils.Tag_Payment_JZCH,
                                          AppUtils.Tag_Payment_ZDJG, AppUtils.Tag_Payment_BBMC, AppUtils.Tag_Payment_MZBZ, AppUtils.Tag_Payment_DYJB,
                                          AppUtils.Tag_Payment_BZ,   AppUtils.Tag_Payment_HZHB, AppUtils.Tag_Query_SBM,    AppUtils.Tag_Query_JGMC };

                        foreach (string tag in tags)
                        {
                            string     value  = ri.getValue(tag);
                            XmlElement eleTag = doc.CreateElement(tag);
                            eleTag.InnerText = (null != value) ? value : "";
                            eleValue.AppendChild(eleTag);
                        }
                        eleMsg.AppendChild(eleValue);
                    }
                }
                else
                {
                    doc = ErrorReturnXml(ret, error_msg);
                }
            }
            catch (Exception ex)
            {
                doc = ReplyXmlDoc.GetExceptionXML(AppUtils.Default_Exception_Code, ex);
            }

            return(doc);
        }
Esempio n. 11
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)
        {
            string oracleConStr = GetJCReportDBConStr();
            OracleConnection connection = new OracleConnection(oracleConStr);
            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) ? 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();

                        ICollection<ReportDetail> rds;
                        string child_msg;
                        int rtDetail;
                        if (AppUtils.HOSPITALNAME.WZSTXRMYY == WebConfigParameter.HospitalName()||
                            AppUtils.HOSPITALNAME.WZSRAZYY == WebConfigParameter.HospitalName())
                        {
                            rtDetail = DB_QueryReportJCDetail(ri.hzbh, out rds, out child_msg);
                        }
                        else
                        {
                            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();
            }
        }
Esempio n. 12
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();
            }
        }
Esempio n. 13
0
        private int DB_InsertAlipayForHis(AlipayReplyInfo info, string brid, string brlx, double czje, DateTime jysj, out string msg)
        {
            int ret = -1;

            msg = "";

            OracleConnection conn = new OracleConnection(WebConfigParameter.ConnectionHisString);

            if (conn.State != ConnectionState.Open)
            {
                conn.Open();
            }
            OracleTransaction tx = conn.BeginTransaction();

            try
            {
                //更新HIS表记录
                if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY)
                {
                    int otherResult = -99;

                    if (!string.IsNullOrEmpty(info.paymenttradeno) && !string.IsNullOrEmpty(info.paymentparameters))
                    {
                        otherResult = DB_AlipayUpdateHisCharge(conn, tx, info.paymenttradeno, czje, brid, brlx, jysj, out msg);
                        if (otherResult != 0)
                        {
                            tx.Rollback();
                            msg = "HIS更新数据不成功。";
                            return(36);
                        }

                        msg = "充值成功。";
                        ret = 00;
                    }
                    else
                    {
                        msg = "银联返回失败";
                        ret = 37;
                    }
                }

                tx.Commit();
                ret = 0;

                return(ret);
            }
            catch (Exception ex)
            {
                tx.Rollback();

                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != conn && conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }
        }
Esempio n. 14
0
        public SQLUtils Creat()
        {
            SQLUtils sqlUtils = new SQLUtils();

            switch (WebConfigParameter.HospitalName())
            {
            case AppUtils.HOSPITALNAME.WZSDEYY:
                sqlUtils = new SQLUtilsWZSDEYY();
                break;

            case AppUtils.HOSPITALNAME.WZSDQRMYY:
                sqlUtils = new SQLUtilsWZSDQRMYY();
                break;

            case AppUtils.HOSPITALNAME.WZSDSRMYY:
                sqlUtils = new SQLUtilsWZSDSRMYY();
                break;

            case AppUtils.HOSPITALNAME.WZSZXYJHYY:
                sqlUtils = new SQLUtilsWZSZXYJHYY();
                break;

            case AppUtils.HOSPITALNAME.WZSZYY:
                sqlUtils = new SQLUtilsWZSZYY();
                break;

            case AppUtils.HOSPITALNAME.WZSCNXDYRMYY:
                sqlUtils = new SQLUtilsWZSCNXDYRMYY();
                break;

            case AppUtils.HOSPITALNAME.WZSCNXDSRMYY:
                sqlUtils = new SQLUtilsWZSCNXDSRMYY();
                break;

            case AppUtils.HOSPITALNAME.WZSCNXZYY:
                sqlUtils = new SQLUtilsWZSCNXZYY();
                break;

            case AppUtils.HOSPITALNAME.WZSCNXDERMYY:
                sqlUtils = new SQLUtilsWZSCNXDERMYY();
                break;

            case AppUtils.HOSPITALNAME.WZSCNXFYBJYY:
                sqlUtils = new SQLUtilsWZSCNXFYBJYY();
                break;

            case AppUtils.HOSPITALNAME.WZSYJXDSRMYY:
                sqlUtils = new SQLUtilsWZSYJXDSRMYY();
                break;

            case AppUtils.HOSPITALNAME.WZSTXRMYY:
                sqlUtils = new SQLUtilsWZSTXRMYY();
                break;

            case AppUtils.HOSPITALNAME.WZSTSXZYY:
                sqlUtils = new SQLUtilsWZSTSXZYY();
                break;

            case AppUtils.HOSPITALNAME.WZSRARMYY:
                sqlUtils = new SQLUtilsWZSRARMYY();
                break;

            case AppUtils.HOSPITALNAME.WZSRAZYY:
                sqlUtils = new SQLUtilsWZSRAZYY();
                break;

            case AppUtils.HOSPITALNAME.WZHTYY:
                sqlUtils = new SQLUtilsWZHTYY();
                break;

            default:
                sqlUtils = new SQLUtils();
                break;
            }

            return(sqlUtils);
        }
Esempio n. 15
0
        /// <summary>
        /// 卡查询
        /// </summary>
        /// <param name="brxm">病人姓名</param>
        /// <param name="sfzh">身份证号</param>
        /// <param name="brlx">病人类别 1-门诊  2-住院</param>
        /// <param name="list">返回的病人信息</param>
        /// <param name="msg">成功、错误或异常信息</param>
        /// <returns>0-成功  大于0-失败   小于0-异常</returns>
        public int DB_QueryCard(string brxm, string sfzh, string brlx, out ArrayList values, out string msg)
        {
            msg = "";


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

            int    ret     = -1;
            string findId1 = "";

            values = new ArrayList();

            try
            {
                bool _flag = false;

                findId1 = _builder.GetQueryCardSql(brxm, sfzh, brlx, out _flag, out msg);

                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, findId1);

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

                dr = DbHelperOra.ExecuteReader(findId1, connection);


                while (dr.Read())
                {
                    PatientInfo paintentInfo = new PatientInfo();

                    if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY ||
                        WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDYRMYY ||
                        WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXFYBJYY ||
                        WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTXRMYY ||
                        WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSRAZYY ||
                        (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTSXZYY && brlx == "1"))
                    {
                        paintentInfo.brid = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    }
                    else
                    {
                        if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSYJXDSRMYY && brlx == "2")
                        {
                            paintentInfo.brid = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        }
                        else
                        {
                            paintentInfo.brid = !dr.IsDBNull(0) ? Convert.ToString(dr.GetInt64(0)) : "";
                        }
                    }

                    paintentInfo.bkhm = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                    paintentInfo.bklx = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                    paintentInfo.brxm = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                    paintentInfo.sfzh = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                    paintentInfo.lxdh = !dr.IsDBNull(5) ? dr.GetString(5) : "";
                    paintentInfo.jtdz = !dr.IsDBNull(6) ? dr.GetString(6) : "";
                    paintentInfo.jlsj = DateTime.MinValue;

                    //判断是否住院病人   否则没有下列信息
                    if (brlx.Equals("2"))
                    {
                        paintentInfo.jlsj = !dr.IsDBNull(7) ? dr.GetDateTime(7) : DateTime.MinValue;
                        paintentInfo.szbq = !dr.IsDBNull(8) ? dr.GetString(8) : "";
                        paintentInfo.szcw = !dr.IsDBNull(9) ? dr.GetString(9) : "";
                        if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTSXZYY)
                        {
                            paintentInfo.zyh = !dr.IsDBNull(10) ? Convert.ToString(dr.GetInt64(10)) : "";
                        }
                        else
                        {
                            paintentInfo.zyh = !dr.IsDBNull(10) ? dr.GetString(10) : "";
                        }
                    }

                    values.Add(paintentInfo);
                }

                if (values.Count > 0)
                {
                    msg = "找到病人信息";
                    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;

                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }