Beispiel #1
0
        /// <summary>
        /// 一个化验报告单抬头信息
        /// </summary>
        /// <param name="doctadviseno">条码号</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_LaboratoryTestsReportNameInformation(string doctadviseno, out AlipayReportInfo alipayReportInfo, out string msg)
        {
            msg = "";
            alipayReportInfo = new AlipayReportInfo();

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

            int ret = -1;

            try
            {
                bool   _flag    = false;
                double number   = Convert.ToDouble(doctadviseno);
                string findText = _builder.GetLaboratoryTestsReportNameInformation(number, out _flag, out msg);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, findText);

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

                msg = "";
                dr  = DbHelperOra.ExecuteReader(findText, connection);
                if (null != dr && dr.HasRows)
                {
                    if (dr.Read())
                    {
                        alipayReportInfo.doctadviseno     = !dr.IsDBNull(0) ? Convert.ToString(dr.GetInt64(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;
                    }
                }
                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();
                }
                connection.Close();
            }
        }