Ejemplo n.º 1
0
        /// <summary>
        /// 返回,不同类型的数据源
        /// </summary>
        /// <param name="TypeIndex">当前索引</param>
        /// <param name="TypeNumber">当前状态值(status)</param>
        /// <returns></returns>
        private DataTable GetInitDB(int TypeIndex, int TypeNumber)
        {
            DateTime dateStart = System.DateTime.Today.AddMonths(-6);
            DateTime dateEnd   = System.DateTime.Today;


            //add by zjy 2013-6-14
            string valueStr = DrectSoft.Service.DS_SqlService.GetConfigValueByKey("AutoScoreMainpage");
            string sql      = MedicalRecordManage.Object.DaoCommand._SELECT_MEDICAL_RECORD_BORROW_SQL;

            if (valueStr.ToLower().Contains("iem_mainpage_diagnosis_sx"))
            {
                sql = MedicalRecordManage.Object.DaoCommand._SELECT_MEDICAL_RECORD_BORROW_SQL_ZY;
            }

            List <DbParameter> sqlParams = new List <DbParameter>();

            sql = sql + " and i.applydocid = @doc";
            SqlParameter param1 = new SqlParameter("@doc", SqlDbType.VarChar);

            param1.Value = m_sUser;
            sqlParams.Add(param1);
            if (dateStart != null && dateStart.ToString() != "")
            {
                string ds = dateStart.ToString("yyyy-MM-dd");
                sql = sql + " and  to_char(i.applydate,'yyyy-mm-dd') >= @ds";
                SqlParameter param2 = new SqlParameter("@ds", SqlDbType.VarChar);
                param2.Value = ds;
                sqlParams.Add(param2);
            }
            if (dateEnd != null && dateEnd.ToString() != "")
            {
                string de = dateEnd.ToString("yyyy-MM-dd");
                sql = sql + " and  to_char(i.applydate,'yyyy-mm-dd') <= @de";
                SqlParameter param3 = new SqlParameter("@de", SqlDbType.VarChar);
                param3.Value = de;
                sqlParams.Add(param3);
            }

            if (TypeNumber >= 0)
            {
                sql = sql + " and i.status = @st";
                SqlParameter param4 = new SqlParameter("@st", SqlDbType.Int);
                param4.Value = TypeNumber;
                sqlParams.Add(param4);
            }

            DataTable dataTable = DrectSoft.DSSqlHelper.DS_SqlHelper.ExecuteDataTable(sql, sqlParams, CommandType.Text);

            //压缩DateSet中的记录,将住院诊断信息合并
            ComponentCommand.ImpressDataSet(ref dataTable, "id", "cyzd");
            //填入状态值
            ComponentCommand.InitializeStatusInfo(ref dataTable);
            //控制状态显示和预警信息显示颜色显示

            return(dataTable);
        }
Ejemplo n.º 2
0
        public void GetInitDB(bool IsUpdate)
        {
            if (IsUpdate)
            {
                //add by zjy 2013-6-14
                string valueStr = DrectSoft.Service.DS_SqlService.GetConfigValueByKey("AutoScoreMainpage");
                string sql      = MedicalRecordManage.Object.DaoCommand._SELECT_MEDICAL_RECORD_BORROW_SQL;
                if (valueStr.ToLower().Contains("iem_mainpage_diagnosis_sx"))
                {
                    sql = MedicalRecordManage.Object.DaoCommand._SELECT_MEDICAL_RECORD_BORROW_SQL_ZY;
                }

                //string sql = MedicalRecordManage.Object.DaoCommand._SELECT_MEDICAL_RECORD_BORROW_SQL;
                List <DbParameter> sqlParams = new List <DbParameter>();

                sql = sql + " and i.applydocid = @doc";
                SqlParameter param1 = new SqlParameter("@doc", SqlDbType.VarChar);
                param1.Value = m_sUser;
                sqlParams.Add(param1);
                if (this.dateStart.Text.Trim() != null && this.dateStart.Text.Trim() != "")
                {
                    string ds = this.dateStart.DateTime.ToString("yyyy-MM-dd");
                    sql = sql + " and  to_char(i.applydate,'yyyy-mm-dd') >= @ds";
                    SqlParameter param2 = new SqlParameter("@ds", SqlDbType.VarChar);
                    param2.Value = ds;
                    sqlParams.Add(param2);
                }
                if (this.dateEnd.Text.Trim() != null && this.dateEnd.Text.Trim() != "")
                {
                    string de = this.dateEnd.DateTime.ToString("yyyy-MM-dd");
                    sql = sql + " and  to_char(i.applydate,'yyyy-mm-dd') <= @de";
                    SqlParameter param3 = new SqlParameter("@de", SqlDbType.VarChar);
                    param3.Value = de;
                    sqlParams.Add(param3);
                }
                if (TypeNumber >= 0)
                {
                    sql = sql + " and i.status = @st";
                    SqlParameter param4 = new SqlParameter("@st", SqlDbType.Int);
                    param4.Value = TypeNumber;
                    sqlParams.Add(param4);
                }
                DataTable dataTable = DrectSoft.DSSqlHelper.DS_SqlHelper.ExecuteDataTable(sql, sqlParams, CommandType.Text);
                //压缩DateSet中的记录,将住院诊断信息合并
                ComponentCommand.ImpressDataSet(ref dataTable, "id", "cyzd");
                //填入状态值
                ComponentCommand.InitializeStatusInfo(ref dataTable);
                //控制状态显示和预警信息显示颜色显示


                User_Table = dataTable;
            }
            this.dbGrid.DataSource = User_Table;
            if (TypeIndex == 4)
            {
                this.dbGridView.Columns["STATUSDES"].Visible = true;
            }
            else
            {
                this.dbGridView.Columns["STATUSDES"].Visible = false;
            }



            //审核日期
            if (TypeIndex == 4 || TypeIndex == 1 || TypeIndex == 3)
            {
                this.dbGridView.Columns["SHSJ"].Visible = true;
            }
            else
            {
                this.dbGridView.Columns["SHSJ"].Visible = false;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查询加载数据方法
        /// Modify by xlb 2013-05-30
        /// </summary>
        private void LoadData()
        {
            try
            {
                //add by 2013-6-14   xll
                string valueStr = DrectSoft.Service.DS_SqlService.GetConfigValueByKey("AutoScoreMainpage");
                string sql      = MedicalRecordManage.Object.DaoCommand._SELECT_MEDICAL_RECORD_BORROW_SQL;
                if (valueStr.ToLower().Contains("iem_mainpage_diagnosis_sx"))
                {
                    sql = MedicalRecordManage.Object.DaoCommand._SELECT_MEDICAL_RECORD_BORROW_SQL_ZY;
                }

                List <DbParameter> sqlParams = new List <DbParameter>();
                if (this.txtDoctor.Text.Trim() != null && this.txtDoctor.Text.Trim() != "")
                {
                    sql = sql + " and i.applyname like @doc ";
                    SqlParameter param1 = new SqlParameter("@doc", SqlDbType.VarChar);
                    param1.Value = "%" + this.txtDoctor.Text.Trim() + "%";
                    sqlParams.Add(param1);
                }
                if (this.txtName.Text.Trim() != null && this.txtName.Text.Trim() != "")
                {
                    sql = sql + " and i.name like @name ";
                    SqlParameter param2 = new SqlParameter("@name", SqlDbType.VarChar);
                    param2.Value = "%" + this.txtName.Text.Trim() + "%";
                    sqlParams.Add(param2);
                }
                if (this.txtNumber.Text.Trim() != null && this.txtNumber.Text.Trim() != "")
                {
                    sql = sql + " and i.patid like '%'||@patId||'%' ";
                    SqlParameter param3 = new SqlParameter("@patId", SqlDbType.VarChar);
                    param3.Value = this.txtNumber.Text.Trim();
                    sqlParams.Add(param3);
                }

                if (this.lookUpEditorDepartment.Text != null && this.lookUpEditorDepartment.Text.Trim() != "")
                {
                    if (lookUpEditorDepartment.CodeValue != "0000")
                    {
                        sql = sql + " and i.outhosdept = @dept";
                        SqlParameter param4 = new SqlParameter("@dept", SqlDbType.VarChar);
                        param4.Value = lookUpEditorDepartment.CodeValue;
                        sqlParams.Add(param4);
                    }
                }

                if (this.dateStart.Text.Trim() != null && this.dateStart.Text.Trim() != "")
                {
                    string ds = this.dateStart.DateTime.ToString("yyyy-MM-dd 00:00:00");
                    sql = sql + " and  to_char(i.applydate,'yyyy-mm-dd hh24:mi:ss') >= @ds";
                    SqlParameter param5 = new SqlParameter("@ds", SqlDbType.VarChar);
                    param5.Value = ds;
                    sqlParams.Add(param5);
                }
                if (this.dateEnd.Text.Trim() != null && this.dateEnd.Text.Trim() != "")
                {
                    string de = this.dateEnd.DateTime.ToString("yyyy-MM-dd 23:59:59");
                    sql = sql + " and  to_char(i.applydate,'yyyy-mm-dd hh24:mi:ss') <= @de";
                    SqlParameter param6 = new SqlParameter("@de", SqlDbType.VarChar);
                    param6.Value = de;
                    sqlParams.Add(param6);
                }
                if (this.cbxStatus.Text != "")
                {
                    sql = sql + " and  i.status = @st";
                    SqlParameter param7 = new SqlParameter("@st", SqlDbType.VarChar);
                    param7.Value = ComponentCommand.GetStatusValue(this.cbxStatus.Text);
                    sqlParams.Add(param7);
                }
                DataTable dataTable = DrectSoft.DSSqlHelper.DS_SqlHelper.ExecuteDataTable(sql, sqlParams, CommandType.Text);
                //压缩数据源生成新的数据源
                //压缩DateSet中的记录,将住院诊断信息合并
                ComponentCommand.ImpressDataSet(ref dataTable, "id", "cyzd");
                //
                ComponentCommand.InitializeStatusInfo(ref dataTable);
                string ResultName = string.Empty;//声明最终要在列表显示的姓名的内容
                for (int i = 0; i < dataTable.Rows.Count; i++)
                {
                    ResultName = SqlUtil.GetPatsBabyContent(SqlUtil.App, dataTable.Rows[i]["noofinpat"].ToString());
                    dataTable.Rows[i]["Name"] = ResultName;
                    if (dataTable.Rows[i]["isbaby"].ToString() == "1")
                    {
                        dataTable.Rows[i]["PATID"] = SqlUtil.GetPatsBabyMother(dataTable.Rows[i]["mother"].ToString());
                    }
                }
                this.dbGrid.DataSource = dataTable;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }