コード例 #1
0
ファイル: SetPatientsBaby.cs プロジェクト: xuanximoming/key
 /// <summary>
 /// 加载当前科室的所有病人
 /// edit by Yanqiao.Cai 2012-11-15
 /// 1、add try ... catch
 /// 2、加载性别图片
 /// </summary>
 private void LoadPatInfo()
 {
     try
     {
         DataTable dt     = DataManager.GetCurrentPatient(m_app.User.CurrentDeptId, m_app.User.CurrentWardId);
         string    filter = string.Format(@"  yebz='0' ");
         //DataTable dt1 = gridControl2.DataSource as DataTable;
         if (dt != null)
         {
             dt.DefaultView.RowFilter = filter;
         }
         //要进行处理的DataTAble,处理 病人姓名字段(***病人姓名【1个婴儿】***)
         DataTable newDt      = dt.DefaultView.ToTable();
         string    ResultName = string.Empty;//声明最终要在列表显示的姓名的内容
         for (int i = 0; i < newDt.Rows.Count; i++)
         {
             ResultName = DataManager.GetPatsBabyContent(m_app, newDt.Rows[i]["noofinpat"].ToString());
             newDt.Rows[i]["PatName"] = ResultName;
         }
         //加载性别图片
         DS_Common.InitializeImage_XB(repositoryItemImageXB2, imageListXB);
         this.gridControl2.DataSource = newDt;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #2
0
        /// <summary>
        /// 查询方法
        /// edit by Yanqiao.Cai 2012-11-15
        /// 1、add try ... catch
        /// 2、加载性别图片
        /// </summary>
        private void Search()
        {
            try
            {
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);

                SqlParameter[] sqlParam = new SqlParameter[]
                {
                    new SqlParameter("@DeptCode", SqlDbType.VarChar),
                    new SqlParameter("@DateTimeBegin", SqlDbType.VarChar),
                    new SqlParameter("@DateTimeEnd", SqlDbType.VarChar),
                    new SqlParameter("@QCStatType", SqlDbType.VarChar),
                    new SqlParameter("@PatientName", SqlDbType.VarChar),
                    new SqlParameter("@RecordID", SqlDbType.VarChar),
                    new SqlParameter("@PatID", SqlDbType.VarChar),
                    new SqlParameter("@OutDiag", SqlDbType.VarChar)
                };
                sqlParam[0].Value = lookUpEditorDepartment.CodeValue == "0000" ? "" : lookUpEditorDepartment.CodeValue;
                sqlParam[1].Value = "";
                sqlParam[2].Value = "";
                sqlParam[3].Value = 2;
                sqlParam[4].Value = textEditName.Text.Trim();
                sqlParam[5].Value = "";
                sqlParam[6].Value = textEditPatID.Text.Trim();
                sqlParam[7].Value = this.lookUpEditorOutDiag.CodeValue;

                DataTable MedicalRrecordSet = sql_Helper.ExecuteDataTable("usp_GetMedicalRrecordView", sqlParam, CommandType.StoredProcedure);
                gridControlApplyRecord.DataSource = MedicalRrecordSet;
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
コード例 #3
0
        /// <summary>
        /// 窗体加载事件
        /// edit by Yanqiao.Cai 2012-11-16
        /// 1、add try ... catch
        /// 2、加载性别图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PatientListForNew_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dataSource = new DataTable();
                if (!m_IsAllInpatient)
                {
                    //新增的时候抓取指定科室的病人
                    dataSource = m_SqlHelper.GetPatientListForNew(m_App.User.CurrentDeptId);
                }
                else
                {
                    //补录的时候抓取全院患者
                    dataSource = m_SqlHelper.GetAllPatientListForNew();
                    //checkEditOutHospital.Visible = false;//补录可看到出院的人,edit  by ywk 2012年8月9日14:41:41
                }
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);

                gridControlPatientList.DataSource = dataSource.DefaultView;
                RefreshPatientList();
                gridControlPatientList.Focus();
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
コード例 #4
0
ファイル: UCRecordOnFile.cs プロジェクト: xuanximoming/key
        /// <summary>
        /// 查询事件
        /// edit by Yanqiao.Cai 2012-11-16
        /// 1、add try ... catch
        /// 2、加载性别图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                string errorStr = CheckItem();
                if (!string.IsNullOrEmpty(errorStr))
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(errorStr);
                    return;
                }

                SqlParameter[] sqlParam = new SqlParameter[]
                { new SqlParameter("@DateBegin", SqlDbType.VarChar),
                  new SqlParameter("@DateEnd", SqlDbType.VarChar),
                  new SqlParameter("@PatID", SqlDbType.VarChar),
                  new SqlParameter("@Name", SqlDbType.VarChar),
                  new SqlParameter("@SexID", SqlDbType.VarChar),
                  new SqlParameter("@AgeBegin", SqlDbType.VarChar),
                  new SqlParameter("@AgeEnd", SqlDbType.VarChar),
                  new SqlParameter("@OutHosDept", SqlDbType.VarChar),
                  new SqlParameter("@InDiag", SqlDbType.VarChar),
                  new SqlParameter("@OutDiag", SqlDbType.VarChar),
                  new SqlParameter("@SurgeryID", SqlDbType.VarChar),
                  new SqlParameter("@Physician", SqlDbType.VarChar) };

                sqlParam[0].Value  = dateEditBegin.DateTime.Date.ToString("yyyy-MM-dd");
                sqlParam[1].Value  = string.IsNullOrEmpty(this.dateEditEnd.Text) ? DateTime.Now.ToString("yyyy-MM-dd") : this.dateEditEnd.DateTime.ToString("yyyy-MM-dd");
                sqlParam[2].Value  = txtPatID.Text.Trim();
                sqlParam[3].Value  = txtName.Text.Trim();
                sqlParam[4].Value  = radioSex.SelectedIndex == 0 ? "" : radioSex.SelectedIndex.ToString();
                sqlParam[5].Value  = txtAgeBegin.Text.Trim();
                sqlParam[6].Value  = txtAgeEnd.Text.Trim();
                sqlParam[7].Value  = lookUpEditorDepartment.CodeValue;
                sqlParam[8].Value  = lookUpEditorInDiag.CodeValue;
                sqlParam[9].Value  = lookUpEditorOutDiag.CodeValue;
                sqlParam[10].Value = lookUpEditorSurgery.CodeValue;
                sqlParam[11].Value = this.lookUpEditorPhysician.CodeValue.Trim();

                DataTable table = SqlUtil.App.SqlHelper.ExecuteDataTable("usp_GetRecordOnFile", sqlParam, CommandType.StoredProcedure);
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);

                gridViewRecordOnFile.SelectAll();
                gridViewRecordOnFile.DeleteSelectedRows();
                gridControlRecordOnFile.DataSource = table;

                lblTip.Text = "共" + table.Rows.Count.ToString() + "条记录";

                if (table.Rows.Count <= 0)
                {
                    SqlUtil.App.CustomMessageBox.MessageShow("没有满足条件的记录");
                }
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.Message);
            }
        }
コード例 #5
0
        /// <summary>
        /// 查询事件
        /// edit by Yanqiao.Cai 2012-11-16
        /// 1、add try ... catch
        /// 2、加载性别图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                Application.DoEvents();
                DevExpress.Utils.WaitDialogForm m_WaitDialog = new DevExpress.Utils.WaitDialogForm("正在查询数据...", "请稍等");
                string errorStr = CheckItem();
                if (!string.IsNullOrEmpty(errorStr))
                {
                    MessageBox.Show(errorStr);
                    m_WaitDialog.Hide();
                    m_WaitDialog.Close();
                    return;
                }
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);
                SqlParameter[] sqlpars = new SqlParameter[]
                {
                    new SqlParameter("@DateOutHosBegin", dateEditBegin.DateTime.Date.ToString("yyyy-MM-dd")),
                    new SqlParameter("@DateOutHosEnd", string.IsNullOrEmpty(this.dateEditEnd.Text) ? DateTime.Now.ToString("yyyy-MM-dd") : this.dateEditEnd.DateTime.ToString("yyyy-MM-dd")),
                    new SqlParameter("@DateInHosBegin", "1900-01-01"),                      //dateEditInBegin.DateTime.Date.ToString("yyyy-MM-dd")
                    new SqlParameter("@DateInHosEnd", DateTime.Now.ToString("yyyy-MM-dd")), //string.IsNullOrEmpty(this.dateEditInEnd.Text) ? DateTime.Now.ToString("yyyy-MM-dd") : this.dateEditInEnd.DateTime.ToString("yyyy-MM-dd")
                    new SqlParameter("@DeptID", lookUpEditorDepartment.CodeValue.ToString() == ""?"0000":lookUpEditorDepartment.CodeValue.ToString()),
                    new SqlParameter("@InDiag", lookUpEditorInDiag.CodeValue.ToString()),
                    new SqlParameter("@OutDiag", lookUpEditorOutDiag.CodeValue.ToString()),
                    new SqlParameter("@Status", lookUpRecordStatus.EditValue.ToString()),
                    new SqlParameter("@Patientname", this.txt_patiName.Text.Trim()),
                    new SqlParameter("@Recordid", this.txt_recordID.Text.Trim()),
                    new SqlParameter("@Physician", this.lookUpEditorPhysician.CodeValue.ToString())
                };
                DataTable table = SqlUtil.App.SqlHelper.ExecuteDataTable("usp_GetRecordNoOnFileWyt", sqlpars, CommandType.StoredProcedure);
                //gridviewRecordNoOnFile.SelectAll();
                //gridviewRecordNoOnFile.DeleteSelectedRows();
                gridControlRecordNoOnFile.DataSource = table;

                m_WaitDialog.Hide();

                lblTip.Text = "共" + table.Rows.Count.ToString() + "份";

                if (table.Rows.Count <= 0)
                {
                    SqlUtil.App.CustomMessageBox.MessageShow("没有满足条件的记录");
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #6
0
ファイル: UCApplyRecord.cs プロジェクト: xuanximoming/key
        /// <summary>
        /// 查询事件
        /// 1、add try ... catch
        /// 2、加载性别图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                string errorStr = CheckItem();
                if (!string.IsNullOrEmpty(errorStr))
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(errorStr);
                    return;
                }
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);

                DataTable table = SqlUtil.App.SqlHelper.ExecuteDataTable("usp_GetApplyRecordNew"
                                                                         , new SqlParameter[]
                {
                    new SqlParameter("@DateBegin", dateBegin.DateTime.Date.ToString("yyyy-MM-dd")),
                    new SqlParameter("@DateEnd", string.IsNullOrEmpty(dateEnd.Text.Trim())?DateTime.Now.ToString("yyyy-MM-dd"):dateEnd.DateTime.Date.ToString("yyyy-MM-dd")),
                    new SqlParameter("@PatientName", this.txt_patiName.Text.Trim()),
                    new SqlParameter("@DocName", this.txt_applyDoc.Text.Trim()),
                    new SqlParameter("@OutHosDept", lookUpEditorDepartment.CodeValue.ToString())
                }
                                                                         , CommandType.StoredProcedure);

                //         DataTable table = SqlUtil.App.SqlHelper.ExecuteDataTable("usp_GetApplyRecord"
                //, new SqlParameter[]
                //             {
                //                 new SqlParameter("@DateBegin", dateBegin.DateTime.Date.ToString("yyyy-MM-dd")),
                //                 new SqlParameter("@DateEnd", dateEnd.DateTime.Date.ToString("yyyy-MM-dd")),
                //                 new SqlParameter("@OutHosDept", lookUpEditorDepartment.CodeValue.ToString())
                //             }
                //, CommandType.StoredProcedure);

                gridViewApplyRecord.SelectAll();
                gridViewApplyRecord.DeleteSelectedRows();
                gridControlApplyRecord.DataSource = table;

                lblTip.Text = "共" + table.Rows.Count.ToString() + "条记录";

                if (table.Rows.Count <= 0)
                {
                    SqlUtil.App.CustomMessageBox.MessageShow("没有满足条件的记录");
                }
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
コード例 #7
0
ファイル: ChoosePatOrBaby.cs プロジェクト: xuanximoming/key
        /// <summary>
        /// 此列表应显示患者和她的孩子
        /// edit by Yanqiao.Cai 2012-11-15
        /// 1、add try ... catch
        /// 2、加载性别图片
        /// </summary>
        private void LoadPatAndBaby()
        {
            try
            {
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);

                DataTable dt = GetPatAndBaby(NOOfINPAT);
                this.gridControl1.DataSource = dt;
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
コード例 #8
0
ファイル: SetPatientsBaby.cs プロジェクト: xuanximoming/key
 /// <summary>
 /// 加载婴儿信息,绑定到grid控件上
 /// edit by Yanqiao.Cai 2012-11-15
 /// 1、add try ... catch
 /// 2、加载性别图片
 /// </summary>
 private void LoadBabyInfo()
 {
     try
     {
         DataManager dtmanager = new DataManager(m_app, "", "");
         DataTable   dt        = dtmanager.GetBabyInfo(NOOFINPAT);
         //加载性别图片
         DS_Common.InitializeImage_XB(repositoryItemImageXB1, imageListXB);
         gridControl1.DataSource = dt;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #9
0
 /// <summary>
 /// 加载已申请病人列表
 /// edit by Yanqiao.Cai 2012-11-15
 /// 1、add try ... catch
 /// 2、加载性别图片
 /// </summary>
 private void LoadData()
 {
     try
     {
         //设置入院日期为入院时间还是入科日期(依据配置)add by cyq 2013-03-14
         SetInHosOrInWardDate();
         //加载性别图片
         DS_Common.InitializeImage_XB(repositoryItemImageApplyXB, imageListXB);
         //sql查询语句更改为申请人能看到自己申请的信息 edit by ywk 2012年3月28日17:34:47
         string mysql = sql_query + string.Format(" where a.createuser='******' and sysdate- to_date(createdate,'yyyy-mm-dd,hh24:mi:ss')<=days order by a.createdate desc", m_App.User.Id);
         gridHistoryInp.DataSource = m_App.SqlHelper.ExecuteDataTable(mysql);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #10
0
 /// <summary>
 /// 查询事件
 /// edit by Yanqiao.Cai 2012-11-16
 /// 1、add try ... catch
 /// 2、加载性别图片
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn_query_Click(object sender, EventArgs e)
 {
     try
     {
         if (date_inpStart.DateTime > date_inpEnd.DateTime)
         {
             app.CustomMessageBox.MessageShow("开始日期不能大于结束日期");
             return;
         }
         //加载性别图片
         DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);
         gridTimeLimit.DataSource = GetGridViewData(CreateDataTable(), GetGridViewBaseData());
     }
     catch (Exception ex)
     {
         app.CustomMessageBox.MessageShow(ex.Message);
     }
 }
コード例 #11
0
ファイル: SetPatientsBaby.cs プロジェクト: xuanximoming/key
        /// <summary>
        /// 点击上方患者列表,下方带出他的孩子
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridControl2_Click(object sender, EventArgs e)
        {
            try
            {
                GridHitInfo hitInfo = grdViewPat.CalcHitInfo(gridControl2.PointToClient(Cursor.Position));
                if (hitInfo.RowHandle < 0)
                {
                    return;
                }
                if (grdViewPat.FocusedRowHandle < 0)
                {
                    return;
                }
                DataRow foucesRow = grdViewPat.GetDataRow(grdViewPat.FocusedRowHandle);
                if (foucesRow == null)
                {
                    return;
                }
                string      noofpat   = foucesRow["NOOFINPAT"].ToString();
                DataManager dtmanager = new DataManager(m_app, "", "");
                DataTable   dt        = dtmanager.GetBabyInfo(noofpat);
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB1, imageListXB);
                gridControl1.DataSource = dt;
                NOOFINPAT = noofpat;//此时全局的首页序号属性应更换为当前选择的人

                oldName = foucesRow["PATNAME"].ToString();
                if (oldName.Contains("婴儿"))
                {
                    oldName = oldName.Substring(0, oldName.IndexOf('【'));
                }
                txtPatName.Text = oldName;


                ClearPageValue();
                btnADD.Enabled = true;
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
コード例 #12
0
ファイル: UCReportBrowse.cs プロジェクト: xuanximoming/key
        /// <summary>
        /// 查询事件
        /// edit by Yanqiao.Cai 2012-11-16
        /// 1、add try ... catch
        /// 2、加载性别图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Search()
        {
            try
            {
                m_SqlHelper = new SqlHelper(m_app.SqlHelper);

                //report_type1,string report_type2,string recordtype1,string beginDate,string EndDate,string deptid,string diagICD,string status
                string report_type1 = chkEditFirst.Checked ? "1" : "";  //1、初次报告
                string report_type2 = chkEditModify.Checked ? "2" : ""; //2、订正报告
                string recordtype1  = "";
                string beginDate    = datebegin.DateTime.ToString("yyyy-MM-dd");
                string EndDate      = dateend.DateTime.ToString("yyyy-MM-dd");
                string deptid       = lookUpEditorDept.CodeValue;
                string diagICD      = lookUpEditorZymosis.CodeValue;
                string status       = "";
                if (chkNoAudit.Checked)
                {
                    status = "1,2,3";
                }
                else if (chkAll.Checked)
                {
                    status = "1,2,3,4,5,6,7";
                }
                else if (chkAudit.Checked)
                {
                    status = "4,5,6";
                }
                else if (chkCanel.Checked)
                {
                    status = "7";
                }

                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);
                DataTable dt = m_SqlHelper.GetReportList(report_type1, report_type2, recordtype1, beginDate, EndDate, deptid, diagICD, status);
                gridControlCardList.DataSource = dt;
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
コード例 #13
0
ファイル: SetPatientsBaby.cs プロジェクト: xuanximoming/key
 /// <summary>
 /// 根据输入条件控制Grid绑定数据
 /// edit by Yanqiao.Cai 2012-11-15
 /// 1、add try ... catch
 /// 2、加载性别图片
 /// edit by wangj 2013 1 29 特殊符号处理 病人状态 年龄 入院日期检索
 /// </summary>
 private void SetGridDataBySea()
 {
     try
     {
         //搜索条件(此处筛掉了婴儿)
         string filter = string.Format(@" PATNAME like '%{0}%' or SexName like '%{0}%' 
     or AGESTR like '%{0}%'  or PatId like '%{0}%' or BRZTNAME like '%{0}%' or ADMITDATE  like '%{0}%'", txtPatName.Text.Trim().Replace("'", "''").Replace("*", "[*]").Replace("%", "[%]"));
         //加载性别图片
         DS_Common.InitializeImage_XB(repositoryItemImageXB2, imageListXB);
         DataTable dt = gridControl2.DataSource as DataTable;
         if (dt != null)
         {
             dt.DefaultView.RowFilter = filter;
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #14
0
ファイル: PatientListForNew.cs プロジェクト: xuanximoming/key
        /// <summary>
        /// 窗体加载事件
        /// edit by Yanqiao.Cai 2012-11-16
        /// 1、add try ... catch
        /// 2、加载性别图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PatientListForNew_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dataSource = new DataTable();

                if (!m_IsAllInpatient)
                {
                    //新增的时候抓取指定科室的病人
                    if (cardisshow == "2")    //edit  jxh
                    {
                        dataSource = m_SqlHelper.GetPatientListForNewTo(m_Host.User.CurrentDeptId);
                    }
                    else if (cardisshow == "3")
                    {
                        dataSource = m_SqlHelper.GetPatientListForNewToother(m_Host.User.CurrentDeptId);
                    }
                    else if (cardisshow == "4")
                    {
                        //edit by ywk 2013年8月22日 11:18:02
                        dataSource = m_SqlHelper.GetPatientListForCARDIOVAS(m_Host.User.CurrentDeptId);
                    }
                }
                else
                {
                    //补录的时候抓取全院患者
                    dataSource = m_SqlHelper.GetAllPatientListForNewTo();
                    //checkEditOutHospital.Visible = false;//补录可看到出院的人,edit  by ywk 2012年8月9日14:41:41
                }
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);

                gridControlPatientList.DataSource = dataSource.DefaultView;
                RefreshPatientList();
                gridControlPatientList.Focus();
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
コード例 #15
0
        /// <summary>
        /// 初始化病人列表
        /// edit by Yanqiao.Cai 2012-11-15
        /// 1、add try ... catch
        /// 2、加载性别图片
        /// </summary>
        private void InitInpatientList()
        {
            try
            {
                SetInHosOrInWardDate();
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);
                string sqlGetInpatient = DataManager.GetAllUnRebackRecordsByDeptRights(DS_Common.currentUser.Id);
                if (string.IsNullOrEmpty(sqlGetInpatient))
                {
                    return;
                }

                panelControlPatientList.Visible = true;

                Thread getInpatientListThread = new Thread(new ParameterizedThreadStart(
                                                               delegate
                {
                    try
                    {
                        DataTable dt = m_App.SqlHelper.ExecuteDataTable(sqlGetInpatient, CommandType.Text);
                        InitInpatientListInner(dt);
                    }
                    catch (Exception ex)
                    {
                        DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.Message);
                    }
                }
                                                               ));
                getInpatientListThread.Start();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #16
0
        /// <summary>
        /// 窗体加载事件
        /// edit by Yanqiao.Cai 2012-11-14
        /// 1、add try ... catch
        /// 2、名称添加婴儿
        /// 3、加载性别图片 edit by Yanqiao.Cai 2012-11-15
        /// 特殊符号处理  王冀 2013 1 7
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetInpatientSouce(string BeginTime, string EndTime, string inpatName, string dia)
        {
            try
            {
                //设置入院日期为入院时间还是入科日期(依据配置)add by cyq 2013-03-14
                SetInHosOrInWardDate();
                gridViewInpatientFail.CustomDrawEmptyForeground -= new DevExpress.XtraGrid.Views.Base.CustomDrawEventHandler(gridViewInpatientFail_CustomDrawEmptyForeground);
                SqlParameter[] sqlParams = new SqlParameter[] {
                    new SqlParameter("@deptcode", SqlDbType.VarChar),
                    new SqlParameter("@InpatName", SqlDbType.VarChar),
                    new SqlParameter("@datetimebegin", SqlDbType.VarChar),
                    new SqlParameter("@datetimeend", SqlDbType.VarChar),
                    new SqlParameter("@userid", SqlDbType.VarChar),
                    new SqlParameter("@qcstattype", SqlDbType.Int),
                    new SqlParameter("@result", SqlDbType.Structured)
                };

                sqlParams[0].Value     = App.User.CurrentDeptId == null ? "" : App.User.CurrentDeptId;
                sqlParams[1].Value     = inpatName;
                sqlParams[2].Value     = BeginTime;
                sqlParams[3].Value     = EndTime;
                sqlParams[4].Value     = App.User.Id;
                sqlParams[5].Value     = 1;
                sqlParams[6].Direction = ParameterDirection.Output;
                //DataSet ds = m_DataAccessEmrly.ExecuteDataSet("usp_GetInpatientFiling", sqlParams, CommandType.StoredProcedure);
                DrectSoft.DSSqlHelper.DS_SqlHelper.CreateSqlHelper();
                DataSet ds = DrectSoft.DSSqlHelper.DS_SqlHelper.ExecuteDataSet("EMRPROC.usp_GetInpatientFiling", sqlParams, CommandType.StoredProcedure);
                m_pageSouce = ds.Tables[0];
                if (dia.Length > 0)
                {
                    m_pageSouce = ToDataTable(m_pageSouce.Select(string.Format(@"ADMITDIAG like '%{0}%'", dia)));
                }
                if (m_pageSouce == null || m_pageSouce.Rows.Count == 0)
                {
                    //gridViewInpatientFail.CustomDrawEmptyForeground += new DevExpress.XtraGrid.Views.Base.CustomDrawEventHandler(gridViewInpatientFail_CustomDrawEmptyForeground);
                    MessageBox.Show("沒有符合条件的数据");
                    gridInpatientFail.DataSource = null;
                    return;
                }
                //名称添加婴儿个数
                DataTable dt         = m_pageSouce;
                string    ResultName = string.Empty;//声明最终要在列表显示的姓名的内容
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ResultName         = GetPatsBabyContent(_app, dt.Rows[i]["noofinpat"].ToString());
                    dt.Rows[i]["Name"] = ResultName;
                }
                //加载性别图片
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListXB);

                gridInpatientFail.DataSource = dt;
                _app.PublicMethod.ConvertGridDataSourceUpper(gridViewInpatientFail);
                if (m_pageSouce.Rows.Count == 0)
                {
                    MessageBox.Show("沒有符合条件的数据");
                    gridInpatientFail.DataSource = new DataTable();
                    return;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #17
0
        /// <summary>
        /// 查询事件
        /// edit by Yanqiao.Cai 2012-11-15
        /// 1、add try ... catch
        /// 2、性别加载图片
        /// Modify by xlb 2013-06-19 解决检索不出当天数据的问题
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQueryMedicalRecord_Click(object sender, EventArgs e)
        {
            try
            {
                SqlParameter[] sqlParam;
                DataTable      MedicalRrecordSet = new DataTable();

                //性别加载图片
                m_WaitDialog = new WaitDialogForm("正在查询数据...", "请稍等");
                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListBrxb);
                sqlParam = new SqlParameter[]
                {
                    new SqlParameter("@DeptID", SqlDbType.VarChar),
                    new SqlParameter("@DateOutHosBegin", SqlDbType.VarChar),
                    new SqlParameter("@DateOutHosEnd", SqlDbType.VarChar),
                    new SqlParameter("@DateInHosBegin", SqlDbType.VarChar),
                    new SqlParameter("@DateInHosEnd", SqlDbType.VarChar),
                    new SqlParameter("@Status", SqlDbType.VarChar),
                    new SqlParameter("@PatientName", SqlDbType.VarChar),
                    new SqlParameter("@RecordID", SqlDbType.VarChar),
                    new SqlParameter("@InDiag", SqlDbType.VarChar),
                    new SqlParameter("@OutDiag", SqlDbType.VarChar),
                    new SqlParameter("@CurDiag", SqlDbType.VarChar),
                    new SqlParameter("@diaGroupStatus", SqlDbType.VarChar),
                    new SqlParameter("@PatientStatus", SqlDbType.VarChar),
                    new SqlParameter("@ingroupid", SqlDbType.VarChar),
                    new SqlParameter("@outgroupid", SqlDbType.VarChar)
                };
                //科室编码
                sqlParam[0].Value = lookUpEditorDepartment.CodeValue == "0000" ? "" : lookUpEditorDepartment.CodeValue;
                //出院起始时间
                sqlParam[1].Value = dateEditStart.DateTime.Date.ToString("yyyy-MM-dd 00:00:00");
                //DateTime dteditEnd = DateTime.Now;
                //出院结束时间
                sqlParam[2].Value = dateEditEnd.DateTime.ToString("yyyy-MM-dd 23:59:59");
                //if (dateEditEnd.DateTime.Date.ToString("yyyy-MM-dd") != "0001-01-01")
                //{
                //    dteditEnd = dateEditEnd.DateTime.Date;
                //}
                //sqlParam[2].Value = dteditEnd.ToString("yyyy-MM-dd");
                //入院开始时间
                sqlParam[3].Value = dateEditInBegin.DateTime.Date.ToString("yyyy-MM-dd 00:00:00");

                //DateTime dteditInEnd = DateTime.Now;
                //if (dateEditInEnd.DateTime.Date.ToString("yyyy-MM-dd") != "0001-01-01")
                //{
                //    dteditInEnd = dateEditInEnd.DateTime.Date;
                //}
                sqlParam[4].Value = dateEditInEnd.DateTime.ToString("yyyy-MM-dd 23:59:59");
                //sqlParam[4].Value = dteditInEnd.ToString("yyyy-MM-dd");
                sqlParam[5].Value = "4700"; //"'4700','4702','4703'";

                if (cmbPatientInfo.SelectedIndex == 0)
                {//病历号
                    sqlParam[6].Value = string.Empty;
                    sqlParam[7].Value = txtcmbPatientInfo.Text.Trim();
                }
                else
                {//病人姓名
                    sqlParam[6].Value = txtcmbPatientInfo.Text.Trim();
                    sqlParam[7].Value = string.Empty;
                }
                sqlParam[8].Value  = this.lookUpEditorInDiag.CodeValue.Trim();
                sqlParam[9].Value  = this.lookUpEditorOutDiag.CodeValue.Trim();
                sqlParam[10].Value = "";// this.lookUpEditorCurrentDiag.CodeValue.Trim();
                sqlParam[11].Value = this.rdg_diag.SelectedIndex.ToString();
                #region
                //if (this.rdg_patient.SelectedIndex == 2)
                //{
                //    sqlParam[11].Value = "1";
                //    sqlParam[12].Value = "2";
                //}
                //else
                //{
                //    sqlParam[11].Value = "1";
                //    sqlParam[12].Value = "1";
                //}
                #endregion
                sqlParam[12].Value = this.rdg_patient.SelectedIndex.ToString();
                sqlParam[13].Value = "";
                sqlParam[14].Value = "";
                if (this.rdg_diag.SelectedIndex == 1)
                {
                    sqlParam[8].Value = "";
                    sqlParam[9].Value = "";
                    //入院组合
                    if (!string.IsNullOrEmpty(this.lookUpEditorInDiagGroup.CodeValue))
                    {
                        #region
                        //int groupID = int.Parse(this.lookUpEditorInDiagGroup.CodeValue.Trim());
                        //List<string> diseaseIDs = DS_BaseService.GetDiseaseIDsByGroupID(groupID);
                        //string filterExpression = string.Empty;
                        //for (int i = 0; i < diseaseIDs.Count; i++)
                        //{
                        //    filterExpression += "'" + diseaseIDs[i] + "',";
                        //}
                        //filterExpression = filterExpression.Substring(0, filterExpression.Length - 1);
                        sqlParam[13].Value = "";//"admitdiagnosis in (" + filterExpression + ")";
                        #endregion
                        sqlParam[13].Value = this.lookUpEditorInDiagGroup.CodeValue.Trim();
                    }
                    //出院组合
                    if (!string.IsNullOrEmpty(this.lookUpEditorOutDiagGroup.CodeValue))
                    {
                        #region
                        //int groupID = int.Parse(this.lookUpEditorOutDiagGroup.CodeValue.Trim());
                        //List<string> diseaseIDs = DS_BaseService.GetDiseaseIDsByGroupID(groupID);
                        //string filterExpression = string.Empty;
                        //for (int i = 0; i < diseaseIDs.Count; i++)
                        //{
                        //    filterExpression += "'" + diseaseIDs[i] + "',";
                        //}
                        //filterExpression = filterExpression.Substring(0, filterExpression.Length - 1);
                        sqlParam[13].Value = "";//"diagnosis_code in (" + filterExpression + ")";
                        #endregion
                        sqlParam[14].Value = this.lookUpEditorOutDiagGroup.CodeValue.Trim();
                    }
                }
                MedicalRrecordSet = sql_Helper.ExecuteDataTable("usp_getattendrecordnoonfile", sqlParam, CommandType.StoredProcedure);
                #region
                ////edit by cyq 2013-01-10
                //List<DataRow> fillterList = MedicalRrecordSet.Select(" 1=1 ").ToList();
                //if (this.rdg_patient.SelectedIndex == 1)
                //{//在院病人
                //    fillterList = fillterList.Where(p => p["STATUS"].ToString() == "1500" || p["STATUS"].ToString() == "1501").ToList();
                //}
                //else if (this.rdg_patient.SelectedIndex == 2)
                //{//出院病人
                //    fillterList = fillterList.Where(p => p["STATUS"].ToString() == "1502" || p["STATUS"].ToString() == "1503").ToList();
                //}
                //if (null != fillterList && fillterList.Count() > 0)
                //{
                //    MedicalRrecordSet = fillterList.CopyToDataTable();
                //}
                //else
                //{
                //    MedicalRrecordSet = MedicalRrecordSet.Clone();
                //}

                //List<DataRow> fillterList1 = fillterList;

                ////按组合  zyx 2013-1-11
                //if (this.rdg_diag.SelectedIndex == 1)
                //{
                //    //入院组合
                //    if (!string.IsNullOrEmpty(this.lookUpEditorInDiagGroup.CodeValue))
                //    {
                //        int groupID = int.Parse(this.lookUpEditorInDiagGroup.CodeValue.Trim());
                //        List<string> diseaseIDs = DS_BaseService.GetDiseaseIDsByGroupID(groupID);
                //        string filterExpression = string.Empty;
                //        for (int i = 0; i < diseaseIDs.Count; i++)
                //        {
                //            filterExpression += "'" + diseaseIDs[i] + "',";
                //        }
                //        filterExpression = filterExpression.Substring(0, filterExpression.Length - 1);
                //        filterExpression = "admitdiagnosis in (" + filterExpression + ")";
                //        if (MedicalRrecordSet.Select(filterExpression).Count() > 0)
                //        {
                //            MedicalRrecordSet = MedicalRrecordSet.Select(filterExpression).CopyToDataTable();
                //        }
                //        else
                //        {
                //            gridControlMedicalRecord.DataSource = null;
                //            lbl_totalCount1.Text = "共0条记录";
                //            m_app.CustomMessageBox.MessageShow("没有符合条件的记录");
                //            HideWaitDialog();
                //            return;
                //        }
                //    }
                //    //出院组合
                //    if (!string.IsNullOrEmpty(this.lookUpEditorOutDiagGroup.CodeValue))
                //    {
                //        int groupID = int.Parse(this.lookUpEditorOutDiagGroup.CodeValue.Trim());
                //        List<string> diseaseIDs = DS_BaseService.GetDiseaseIDsByGroupID(groupID);
                //        string filterExpression = string.Empty;
                //        for (int i = 0; i < diseaseIDs.Count; i++)
                //        {
                //            filterExpression += "'" + diseaseIDs[i] + "',";
                //        }
                //        filterExpression.Substring(0, filterExpression.Length - 1);
                //        filterExpression = "diagnosis_code in (" + filterExpression + ")";
                //        if (MedicalRrecordSet.Select(filterExpression).Count() > 0)
                //        {
                //            MedicalRrecordSet = MedicalRrecordSet.Select(filterExpression).CopyToDataTable();
                //        }
                //        else
                //        {
                //            gridControlMedicalRecord.DataSource = null;
                //            lbl_totalCount1.Text = "共0条记录";
                //            m_app.CustomMessageBox.MessageShow("没有符合条件的记录");
                //            HideWaitDialog();
                //            return;
                //        }
                //    }
                //}
                #endregion
                //MedicalRrecordSet = fillterList.CopyToDataTable();
                DataTable dataSum = MedicalRrecordSet.Clone();
                //-------------分组 合并 2013-3-7 add by tj-----------------
                DataRow[] drs = MedicalRrecordSet.Select("1=1");//所有结果行
                for (int i = 0; i < drs.Length; i++)
                {
                    if (dataSum.Rows.Count == 0)
                    {
                        dataSum.Rows.Add(drs[i].ItemArray);
                        continue;
                    }
                    if (drs[i]["NOOFINPAT"].ToString().Equals(dataSum.Rows[dataSum.Rows.Count - 1]["NOOFINPAT"].ToString()))//与上一条记病案首页号相等,认为是同一病人
                    {
                        dataSum.Rows[dataSum.Rows.Count - 1]["DIAGNOSISNAME"] += ";" + drs[i]["DIAGNOSISNAME"].ToString();
                    }
                    else
                    {
                        dataSum.Rows.Add(drs[i].ItemArray);
                    }
                }
                //----------------------------------------------------------
                gridControlMedicalRecord.DataSource = dataSum;
                lbl_totalCount1.Text = "共" + dataSum.Rows.Count + "条记录";
                m_app.PublicMethod.ConvertGridDataSourceUpper(gridviewMedicalRecord);
                this.HideWaitDialog();

                if (MedicalRrecordSet.Rows.Count <= 0)
                {
                    MessageBox.Show("没有符合条件的记录");
                }
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
コード例 #18
0
ファイル: IndexCard.cs プロジェクト: xuanximoming/key
        /// <summary>
        /// 刷新数据 - 姓名索引卡
        /// </summary>
        private void RefreshNameCardData()
        {
            try
            {
                string sqlStr = @" select i.noofinpat,i.patid,i.name,i.py,i.wb,i.sexid,i.age,i.agestr,i.outbed,
                                          case when i.status in(1502,1503) then '出院' else '在院' end as statusname,
                                          i.admitdate,i.inwarddate,i.admitdept,d1.name as admitdeptname,i.outhosdate,
                                          i.outwarddate,i.outhosdept,
                                          (sp.provincename || sc.cityname || sd.districtname || i.xzzdetailaddress) as xzzaddressunion,
                                          i.xzzaddress,d2.name as outhosdeptname,dia.diagnosis_code,dia.diagnosis_name,bas.zg_flag,
                                          case bas.zg_flag when '1' then '治愈' 
                                                           when '2' then '好转' 
                                                           when '3' then '未愈' 
                                                           when '4' then '死亡' 
                                          end zg_name,i.status
                                     from inpatient i 
                                     left join department d1 on i.admitdept=d1.id 
                                     left join department d2 on i.outhosdept=d2.id 
                                     left join iem_mainpage_basicinfo_2012 bas on i.noofinpat=bas.noofinpat 
                                     left join iem_mainpage_diagnosis_2012 dia on bas.iem_mainpage_no=dia.iem_mainpage_no 
                                     left join s_province sp on i.xzzproviceid=sp.provinceid 
                                     left join s_city sc on i.xzzcityid=sc.cityid 
                                     left join s_district sd on i.xzzdistrictid=sd.districtid where 1=1 ";
                List <OracleParameter> paramList = new List <OracleParameter>();
                if (!string.IsNullOrEmpty(date_InHosBegin.Text))
                {///入院开始时间
                    sqlStr += " and i.inwarddate >= @inwarddatebegin ";
                    OracleParameter param1 = new OracleParameter("inwarddatebegin", OracleType.VarChar);
                    param1.Value = date_InHosBegin.DateTime.ToString("yyyy-MM-dd 00:00:00");
                    paramList.Add(param1);
                }
                if (!string.IsNullOrEmpty(date_InHosEnd.Text))
                {///入院结束时间
                    sqlStr += " and i.inwarddate <= @inwarddateend ";
                    OracleParameter param2 = new OracleParameter("inwarddateend", OracleType.VarChar);
                    param2.Value = date_InHosEnd.DateTime.ToString("yyyy-MM-dd 23:59:59");
                    paramList.Add(param2);
                }
                if (radio_HosState.SelectedIndex == 1)
                {///在院状态
                    sqlStr += " and i.status not in(1502,1503) ";
                }
                else
                {
                    string outHosSql = string.Empty;
                    if (!string.IsNullOrEmpty(date_OutHosBegin.Text))
                    {///出院开始时间
                        outHosSql += " and i.outwarddate >= @outwarddatebegin ";
                        OracleParameter param3 = new OracleParameter("outwarddatebegin", OracleType.VarChar);
                        param3.Value = date_OutHosBegin.DateTime.ToString("yyyy-MM-dd 00:00:00");
                        paramList.Add(param3);
                    }
                    if (!string.IsNullOrEmpty(date_OutHosEnd.Text))
                    {///出院结束时间
                        outHosSql += " and i.outwarddate <= @outwarddateend ";
                        OracleParameter param4 = new OracleParameter("outwarddateend", OracleType.VarChar);
                        param4.Value = date_OutHosEnd.DateTime.ToString("yyyy-MM-dd 23:59:59");
                        paramList.Add(param4);
                    }
                    if (!string.IsNullOrEmpty(outHosSql))
                    {
                        if (radio_HosState.SelectedIndex == 0)
                        {///全部
                            sqlStr += " and (i.status not in(1502,1503) or (i.status in(1502,1503) " + outHosSql + ") ) ";
                        }
                        else if (radio_HosState.SelectedIndex == 2)
                        {///出院状态 Modified By wwj 2013-08-07
                            sqlStr += outHosSql + " and i.status in(1502,1503) ";
                        }
                    }
                }
                if (!string.IsNullOrEmpty(lookUpEditorDepartment.CodeValue.ToString()) && lookUpEditorDepartment.CodeValue.ToString() != "0000")
                {///科室
                    sqlStr += " and i.outhosdept = @outhosdept ";
                    OracleParameter param5 = new OracleParameter("outhosdept", OracleType.VarChar);
                    param5.Value = lookUpEditorDepartment.CodeValue.ToString();
                    paramList.Add(param5);
                }
                if (!string.IsNullOrEmpty(txt_Patid.Text.Trim()))
                {///住院号
                    string patid = DS_Common.FilterSpecialCharacter(txt_Patid.Text.Trim());
                    sqlStr += " and i.patid like '%" + patid + "%' ";
                }
                sqlStr += " and dia.diagnosis_type_id=7 and dia.valide=1 and bas.valide=1 order by i.name,i.outwarddate,dia.order_value";

                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListBrxb);
                DataTable dt = DS_SqlHelper.ExecuteDataTable(sqlStr, paramList, CommandType.Text);

                //在此dt中将姓名拼音码产生更新到PY列 add by ywk 2013年8月30日 11:18:01

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["PY"] = ChinessConverter.GetPYResultStr(dt.Rows[i]["NAME"].ToString().Trim());
                }
                DataView dv = dt.DefaultView;
                dv.Sort = "py asc";
                dt      = dv.ToTable();

                SetDataTableAllNotSelect(dt);
                if (null != dt && dt.Rows.Count > 0)
                {
                    var            rowList    = dt.AsEnumerable().GroupBy(p => p["patid"]);
                    List <DataRow> resultList = new List <DataRow>();
                    foreach (var keyAndValue in rowList)
                    {
                        resultList.Add(keyAndValue.FirstOrDefault());
                    }
                    gridControlMain.DataSource = resultList.CopyToDataTable();
                    lbl_TotalCount.Text        = "共" + resultList.Count() + "条记录";
                }
                else
                {
                    gridControlMain.DataSource = dt.Clone();
                    lbl_TotalCount.Text        = "共0条记录";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #19
0
ファイル: IndexCard.cs プロジェクト: xuanximoming/key
        /// <summary>
        /// 刷新数据 - 疾病索引卡
        /// Add by wwj 2013-07-29
        /// </summary>
        private void RefreshDiseaseCardData()
        {
            try
            {
                string sqlStr = @"select distinct i.noofinpat,i.patid,i.name,i.py,i.wb,i.sexid,i.age,i.agestr,i.outbed,
                            case when i.status in(1502,1503) then '出院' else '在院' end as statusname,
                            i.admitdate,i.inwarddate,i.admitdept,d1.name as admitdeptname,i.outhosdate,i.outwarddate,i.outhosdept,
                            (sp.provincename || sc.cityname || sd.districtname || i.xzzdetailaddress) as xzzaddressunion,
                            i.xzzaddress,d2.name as outhosdeptname, imd.diagnosis_code, diag.name DIAGNOSIS_NAME, i.status
                            from inpatient i 
                                 left join department d1 on i.admitdept=d1.id
                                 left join department d2 on i.outhosdept=d2.id
                                 left join iem_mainpage_basicinfo_2012 bas on i.noofinpat=bas.noofinpat and bas.valide = '1'
                                 left join iem_mainpage_diagnosis_2012 imd on bas.iem_mainpage_no = imd.iem_mainpage_no and imd.valide = '1'
                                 left join diagnosis diag on imd.diagnosis_code = diag.icd
                                 left join s_province sp on i.xzzproviceid=sp.provinceid
                                 left join s_city sc on i.xzzcityid=sc.cityid 
                                 left join s_district sd on i.xzzdistrictid=sd.districtid 
                            where 1=1 ";
                List <OracleParameter> paramList = new List <OracleParameter>();
                if (!string.IsNullOrEmpty(date_InHosBegin.Text))
                {///入院开始时间
                    sqlStr += " and i.inwarddate >= @inwarddatebegin ";
                    OracleParameter param1 = new OracleParameter("inwarddatebegin", OracleType.VarChar);
                    param1.Value = date_InHosBegin.DateTime.ToString("yyyy-MM-dd 00:00:00");
                    paramList.Add(param1);
                }
                if (!string.IsNullOrEmpty(date_InHosEnd.Text))
                {///入院结束时间
                    sqlStr += " and i.inwarddate <= @inwarddateend ";
                    OracleParameter param2 = new OracleParameter("inwarddateend", OracleType.VarChar);
                    param2.Value = date_InHosEnd.DateTime.ToString("yyyy-MM-dd 23:59:59");
                    paramList.Add(param2);
                }
                if (radio_HosState.SelectedIndex == 1)
                {///在院状态
                    sqlStr += " and i.status not in(1502,1503) ";
                }
                else
                {
                    string outHosSql = string.Empty;
                    if (!string.IsNullOrEmpty(date_OutHosBegin.Text))
                    {///出院开始时间
                        outHosSql += " and i.outwarddate >= @outwarddatebegin ";
                        OracleParameter param3 = new OracleParameter("outwarddatebegin", OracleType.VarChar);
                        param3.Value = date_OutHosBegin.DateTime.ToString("yyyy-MM-dd 00:00:00");
                        paramList.Add(param3);
                    }
                    if (!string.IsNullOrEmpty(date_OutHosEnd.Text))
                    {///出院结束时间
                        outHosSql += " and i.outwarddate <= @outwarddateend ";
                        OracleParameter param4 = new OracleParameter("outwarddateend", OracleType.VarChar);
                        param4.Value = date_OutHosEnd.DateTime.ToString("yyyy-MM-dd 23:59:59");
                        paramList.Add(param4);
                    }
                    if (!string.IsNullOrEmpty(outHosSql))
                    {
                        if (radio_HosState.SelectedIndex == 0)
                        {///全部
                            sqlStr += " and (i.status not in(1502,1503) or (i.status in(1502,1503) " + outHosSql + ") ) ";
                        }
                        else if (radio_HosState.SelectedIndex == 2)
                        {///出院状态 Modified By wwj 2013-08-07
                            sqlStr += outHosSql + " and i.status in(1502,1503) ";
                        }
                    }
                }
                if (!string.IsNullOrEmpty(lookUpEditorDepartment.CodeValue.ToString()) && lookUpEditorDepartment.CodeValue.ToString() != "0000")
                {///科室
                    sqlStr += " and i.outhosdept = @outhosdept ";
                    OracleParameter param5 = new OracleParameter("outhosdept", OracleType.VarChar);
                    param5.Value = lookUpEditorDepartment.CodeValue.ToString();
                    paramList.Add(param5);
                }
                if (!string.IsNullOrEmpty(txt_Patid.Text.Trim()))
                {///住院号
                    string patid = DS_Common.FilterSpecialCharacter(txt_Patid.Text.Trim());
                    sqlStr += " and i.patid like '%" + patid + "%' ";
                }
                sqlStr += " and imd.diagnosis_code is not null and imd.diagnosis_type_id = '7' order by i.name,i.outwarddate";

                DS_Common.InitializeImage_XB(repositoryItemImageXB, imageListBrxb);
                DataTable dt = DS_SqlHelper.ExecuteDataTable(sqlStr, paramList, CommandType.Text);
                SetDataTableAllNotSelect(dt);
                if (null != dt && dt.Rows.Count > 0)
                {
                    //var rowList = dt.AsEnumerable().GroupBy(p => p["noofinpat"]);
                    //List<DataRow> resultList = new List<DataRow>();
                    //foreach (var keyAndValue in rowList)
                    //{
                    //    resultList.Add(keyAndValue.FirstOrDefault());
                    //}
                    //gridControlMain.DataSource = resultList.CopyToDataTable();
                    //lbl_TotalCount.Text = "共" + resultList.Count() + "条记录";

                    gridControlMain.DataSource = dt;
                    lbl_TotalCount.Text        = "共" + dt.Rows.Count + "条记录";
                }
                else
                {
                    gridControlMain.DataSource = dt.Clone();
                    lbl_TotalCount.Text        = "共0条记录";
                }
            }
            catch (Exception)
            {
                throw;
            }
        }