Beispiel #1
0
        ///// <summary>
        ///// 得到待会诊清单
        ///// </summary>
        ///// <param name="typeID"></param>
        ///// <param name="consultTime"></param>
        ///// <param name="consultTypeID"></param>
        ///// <param name="urgencyTypeID"></param>
        ///// <param name="name"></param>
        ///// <param name="patID"></param>
        ///// <param name="bedID"></param>
        ///// <returns></returns>
        //public static DataTable GetConsultationData(string typeID, string consultTime, string consultTypeID
        //    , string urgencyTypeID, string name, string patID, string bedID)
        //{
        //    SqlParameter[] sqlParam = new SqlParameter[]
        //    {
        //        new SqlParameter("@TypeID", SqlDbType.VarChar),
        //        new SqlParameter("@ConsultTime", SqlDbType.VarChar),
        //        new SqlParameter("@ConsultTypeID", SqlDbType.Decimal),
        //        new SqlParameter("@UrgencyTypeID", SqlDbType.Decimal),
        //        new SqlParameter("@Name", SqlDbType.VarChar),
        //        new SqlParameter("@PatID", SqlDbType.VarChar),
        //        new SqlParameter("@BedID", SqlDbType.VarChar)
        //    };

        //    sqlParam[0].Value = typeID;
        //    sqlParam[1].Value = consultTime;

        //    if (consultTypeID.Trim() == "")
        //    {
        //        sqlParam[2].Value = 0;
        //    }
        //    else
        //    {
        //        sqlParam[2].Value = consultTypeID;
        //    }

        //    if (urgencyTypeID.Trim() == "")
        //    {
        //        sqlParam[3].Value = 0;
        //    }
        //    else
        //    {
        //        sqlParam[3].Value = urgencyTypeID;
        //    }
        //    sqlParam[4].Value = name;
        //    sqlParam[5].Value = patID;
        //    sqlParam[6].Value = bedID;

        //    return m_SqlHelper.ExecuteDataTable("usp_GetConsultationData", sqlParam, CommandType.StoredProcedure);
        //}

        public static string InsertConsultationApply(string typeID, string consultApplySN, string noOfInpat, string urgencyTypeID, string consultTypeID, string abstractContent,
                                                     string purpose, string applyUser, string applyTime, string director, string consultTime, string consultLocation, string stateID,
                                                     string createUser, string createTime, string mydept, string audituserId, string auditLevel)
        {
            try
            {
                SqlParameter p_result = new SqlParameter("@result", SqlDbType.Structured);
                p_result.Direction = ParameterDirection.Output;
                SqlParameter[] sqlParam = new SqlParameter[]
                {
                    new SqlParameter("@TypeID", SqlDbType.Int),
                    new SqlParameter("@ConsultApplySN", SqlDbType.Int),
                    new SqlParameter("@NoOfInpat", SqlDbType.Decimal),
                    new SqlParameter("@UrgencyTypeID", SqlDbType.Int),
                    new SqlParameter("@ConsultTypeID", SqlDbType.Int),
                    new SqlParameter("@Abstract", SqlDbType.VarChar),
                    new SqlParameter("@Purpose", SqlDbType.VarChar),
                    new SqlParameter("@ApplyUser", SqlDbType.VarChar),
                    new SqlParameter("@ApplyTime", SqlDbType.VarChar),
                    new SqlParameter("@Director", SqlDbType.VarChar),
                    new SqlParameter("@ConsultTime", SqlDbType.VarChar),
                    new SqlParameter("@ConsultLocation", SqlDbType.VarChar),
                    new SqlParameter("@StateID", SqlDbType.Int),
                    new SqlParameter("@CreateUser", SqlDbType.VarChar),
                    new SqlParameter("@CreateTime", SqlDbType.VarChar),
                    new SqlParameter("@consultsuggestion", SqlDbType.VarChar),
                    new SqlParameter("@finishtime", SqlDbType.VarChar),
                    new SqlParameter("@rejectreason", SqlDbType.VarChar),
                    new SqlParameter("@APPLYDEPT", SqlDbType.VarChar),
                    new SqlParameter("@AuditUserID", SqlDbType.VarChar),
                    new SqlParameter("@AuditLevel", SqlDbType.VarChar),
                    p_result
                };

                sqlParam[0].Value = typeID;
                if (consultApplySN.Trim() == "")
                {
                    sqlParam[1].Value = 0;
                }
                else
                {
                    sqlParam[1].Value = consultApplySN;
                }
                if (noOfInpat.Trim() == "")
                {
                    sqlParam[2].Value = 0f;
                }
                else
                {
                    sqlParam[2].Value = Convert.ToDecimal(noOfInpat);
                }
                if (urgencyTypeID.Trim() == "")
                {
                    sqlParam[3].Value = 0;
                }
                else
                {
                    sqlParam[3].Value = Convert.ToInt32(urgencyTypeID);
                }
                if (consultTypeID.Trim() == "")
                {
                    sqlParam[4].Value = 0;
                }
                else
                {
                    sqlParam[4].Value = Convert.ToInt32(consultTypeID);
                }
                sqlParam[5].Value  = abstractContent;
                sqlParam[6].Value  = purpose;
                sqlParam[7].Value  = applyUser;
                sqlParam[8].Value  = applyTime;
                sqlParam[9].Value  = director;
                sqlParam[10].Value = consultTime;
                sqlParam[11].Value = consultLocation;
                if (stateID.Trim() == "")
                {
                    sqlParam[12].Value = 0;
                }
                else
                {
                    sqlParam[12].Value = Convert.ToInt32(stateID);
                }
                sqlParam[13].Value = createUser;
                sqlParam[14].Value = createTime;
                sqlParam[15].Value = "";
                sqlParam[16].Value = "";
                sqlParam[17].Value = "";
                sqlParam[18].Value = mydept;
                sqlParam[19].Value = audituserId;
                sqlParam[20].Value = auditLevel;

                DataTable dt = DS_SqlHelper.ExecuteDataTableInTran("EMR_CONSULTATION.usp_InsertConsultationApply", sqlParam, CommandType.StoredProcedure);
                //DataTable dt = m_SqlHelper.ExecuteDataTable("EMR_CONSULTATION.usp_InsertConsultationApply", sqlParam, CommandType.StoredProcedure);

                if (dt.Rows.Count > 0)
                {
                    return(dt.Rows[0]["ConsultApplySn"].ToString());
                }
                else
                {
                    return("");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }