Beispiel #1
0
 /// <summary>
 /// 根据婴儿数量动态创建按钮
 /// <auth>zyx</auth>
 /// <date>2013-1-7</date>
 /// </summary>
 /// <param name="dateTable"></param>
 private void CreateButton(DataTable dateTable)
 {
     try
     {
         gcBaby.Controls.Clear();
         if (dateTable != null && dateTable.Rows.Count > 0)
         {
             int            count      = int.Parse(dateTable.Rows[0]["babycount"].ToString());
             string         sqlGetBaby = "select i.noofinpat,i.name from inpatient i where i.mother=@mother";
             SqlParameter[] parms      = new SqlParameter[]
             {
                 new SqlParameter("@mother", SqlDbType.Decimal)
             };
             parms[0].Value = dateTable.Rows[0]["noofinpat"];
             DataTable dtBaby = DS_SqlHelper.ExecuteDataTable(sqlGetBaby, parms, CommandType.Text);
             for (int i = 0; i < count; i++)
             {
                 SimpleButton btn = new SimpleButton();
                 Point        pt  = new Point(10 + i * 85, 26);
                 btn.Location = pt;
                 btn.Text     = dtBaby.Rows[i]["name"].ToString();
                 btn.Name     = dtBaby.Rows[i]["noofinpat"].ToString();
                 btn.Click   += new EventHandler(btn_Click);
                 gcBaby.Controls.Add(btn);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
 public DataTable SearchInpatientData(string hour, string date)
 {
     try
     {
         string         departcode = CommonObjects.CurrentUser.CurrentDeptId;
         string         wardcode   = CommonObjects.CurrentUser.CurrentWardId;
         SqlParameter[] sqlParams  = new SqlParameter[]
         {
             new SqlParameter("@departCode", SqlDbType.VarChar, 50),
             new SqlParameter("@wardcode", SqlDbType.VarChar, 50),
             new SqlParameter("@Timelot", SqlDbType.VarChar, 50),
             new SqlParameter("@TimelotSave", SqlDbType.VarChar, 50),
             new SqlParameter("@date", SqlDbType.NVarChar, 50),
             new SqlParameter("@result", SqlDbType.Structured, int.MaxValue)
         };
         sqlParams[0].Value = departcode;
         sqlParams[1].Value = wardcode;
         sqlParams[2].Value = hour;
         sqlParams[3].Value = timelotSave;   //天数据存为2时段
         string surveyDate = m_CurrDatetime; //dateEdit.Text.Replace('/', '-');
         sqlParams[4].Value     = surveyDate;
         sqlParams[5].Direction = ParameterDirection.Output;
         DataTable dtInpatient = DS_SqlHelper.ExecuteDataTable("EMR_NURSE_STATION.usp_GetPatientsOfDept", sqlParams, CommandType.StoredProcedure);
         dtInpatient.DefaultView.Sort = "BED asc ";
         return(dtInpatient);
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
     return(null);
 }
Beispiel #3
0
        /// <summary>
        /// 初始化数据
        /// <auth>zyx</auth>
        /// <date>2013-1-7</date>
        /// </summary>
        /// <param name="noofinpat">病案号</param>
        private void Init(string noofinpat)
        {
            try
            {
                _nursingRecordFrm.xtraTabControl1.SelectedTabPage = xtraTabPage2;
                gcCurrentList.DataSource = null;
                string         sqlGetNursing = "select * from notesonnursing where noofinpat=@noofinpat and dateofsurvey between @preDate and @curDate  order by DATEOFSURVEY, to_number(timeslot)";
                SqlParameter[] parms         = new SqlParameter[]
                {
                    new SqlParameter("@noofinpat", SqlDbType.VarChar),
                    new SqlParameter("@preDate", SqlDbType.VarChar),
                    new SqlParameter("@curDate", SqlDbType.VarChar)
                };

                parms[0].Value = noofinpat;
                parms[1].Value = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
                parms[2].Value = DateTime.Now.ToString("yyyy-MM-dd");
                DataTable dt = DS_SqlHelper.ExecuteDataTable(sqlGetNursing, parms, CommandType.Text);
                if (dt != null && dt.Rows.Count > 0)
                {
                    BindDate(dt);
                }
                else
                {
                    lblPre.Visible           = true;
                    lblCurrent.Visible       = true;
                    gcCurrentList.DataSource = null;
                    gcPreList.DataSource     = null;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #4
0
        /// <summary>
        /// 初始化科室
        /// </summary>
        private void InitDepartment()
        {
            try
            {
                lookUpEditorDepartment.Kind       = WordbookKind.Sql;
                lookUpEditorDepartment.ListWindow = lookUpWindowDepartment;

                string    sqlInitdepart = @"select * from department  where  valid='1'";
                DataTable dtDepartment  = DS_SqlHelper.ExecuteDataTable(sqlInitdepart, CommandType.Text);
                for (int i = 0; i < dtDepartment.Columns.Count; i++)
                {
                    if (dtDepartment.Columns[i].ColumnName.ToUpper().Trim() == "ID")
                    {
                        dtDepartment.Columns[i].Caption = "科室代码";
                    }
                    else if (dtDepartment.Columns[i].ColumnName.ToUpper().Trim() == "NAME")
                    {
                        dtDepartment.Columns[i].Caption = "科室名称";
                    }
                }
                Dictionary <string, int> colWidths = new Dictionary <string, int>();
                colWidths.Add("ID", 60);
                colWidths.Add("NAME", 70);
                SqlWordbook wordBook = new SqlWordbook("Department", dtDepartment, "ID", "NAME", colWidths, "ID//NAME//PY//WB");
                lookUpEditorDepartment.SqlWordbook = wordBook;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #5
0
 /// <summary>
 /// 刷新数据 --- 员工列表
 /// </summary>
 /// <auth>Yanqiao.Cai</auth>
 /// <date>2012-12-28</date>
 private void RefreashUsersData()
 {
     try
     {
         string             sqlStr   = " select u.id as userid,u.name as username,u.py,u.wb,u.sexy,u.deptID,d1.name as deptName from users u join department d1 on u.deptid=d1.id ";
         List <DbParameter> listPars = new List <DbParameter>();
         if (!string.IsNullOrEmpty(this.lookUpEditorDepartment.CodeValue.Trim()) && this.lookUpEditorDepartment.CodeValue.Trim() != "0000")
         {
             sqlStr += " and u.deptid = @deptid ";
             SqlParameter param1 = new SqlParameter("@deptid", SqlDbType.Char, 12);
             param1.Value = this.lookUpEditorDepartment.CodeValue.Trim();
             listPars.Add(param1);
         }
         if (!string.IsNullOrEmpty(this.txt_userName.Text.Trim()))
         {
             sqlStr += " and (u.id like @userName or u.name like @userName or u.py like @userName or u.wb like @userName) ";
             SqlParameter param2 = new SqlParameter("@userName", SqlDbType.Char, 32);
             param2.Value = "%" + this.txt_userName.Text.Trim() + "%";
             listPars.Add(param2);
         }
         sqlStr += " order by deptName,username ";
         DS_SqlHelper.CreateSqlHelper();
         DataTable dt = DS_SqlHelper.ExecuteDataTable(sqlStr, listPars, CommandType.Text);
         this.gridControl_user.DataSource = dt;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Beispiel #6
0
        /// <summary>
        /// 右侧展示此病人的病案首页信息
        /// add by ywk 2013年7月30日 11:45:56
        /// </summary>
        /// <param name="drInpatient"></param>
        private void LoadIemMainPage(DataRow drInpatient)
        {
            try
            {
                if (string.IsNullOrEmpty(drInpatient["Noofinpat"].ToString()))
                {
                    return;
                }
                string    noofinpat = drInpatient["Noofinpat"].ToString();
                string    search    = " select mname from dict_catalog where ccode='AA' ";
                DataTable dt        = DS_SqlHelper.ExecuteDataTable(search, CommandType.Text);

                editor = (IEMREditor)Activator.CreateInstance(Type.GetType(dt.Rows[0]["mname"].ToString()), new object[] { noofinpat });
                editor.DesignUI.Dock = DockStyle.Fill;
                scrolInpIemInfo.Controls.Clear();
                scrolInpIemInfo.Controls.Add(editor.DesignUI);
                m_APP.CurrentPatientInfo = new DrectSoft.Common.Eop.Inpatient(Convert.ToDecimal(noofinpat));
                m_APP.CurrentPatientInfo.ReInitializeAllProperties();
                editor.Load(m_APP);
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("错误信息!" + ex.Message);
                return;
            }
        }
Beispiel #7
0
 /// <summary>
 /// <Auth>Add BY XLB</Auth>
 /// <Date>2013-06-05</Date>
 /// <Purpose>校验受邀医师是否已完成会诊意见</Purpose>
 /// </summary>
 /// <param name="employeeCode">受邀医师代码</param>
 /// <return>是否不可删除false表示可删除true表示不可删除</return>
 private bool GetEmployeeStatus(string employeeCode)
 {
     try
     {
         DataTable dtCount = DS_SqlHelper.ExecuteDataTable(@"select count(*) from consultsuggestion where 
         consultapplysn=@consultApplySn and valid='1'and createuser=@createUser and state='20'",
                                                           new SqlParameter[] { new SqlParameter("@consultApplySn", mconsultApplySn == null ? "" : mconsultApplySn),
                                                                                new SqlParameter("@createUser", employeeCode == null ? "" : employeeCode) }, CommandType.Text);
         if (dtCount == null || dtCount.Rows.Count <= 0)
         {
             return(false);
         }
         int result = int.Parse(dtCount.Rows[0][0].ToString());
         if (result > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #8
0
 /// <summary>
 ///根据传入的字符串查询结果绑定数据
 ///王冀 2012 10 24
 ///edit zyx 2012-12-17  系统参数配置中,当查询不到结果时给出提示框
 ///edit by xlb 2012-12-28 改用参数化查询
 /// </summary>
 /// <param name="key"></param>
 private void BindData(string sql, string key)
 {
     try
     {
         //sql_helper = DataAccessFactory.DefaultDataAccess;
         appdal = new AppConfigDalc();
         //sourceTable = sql_helper.ExecuteDataTable(sql_str);
         SqlParameter[] sps = { new SqlParameter("@conName", key) };
         //DataTable sourceTable = sql_helper.ExecuteDataTable(key);
         DataTable sourceTable = DS_SqlHelper.ExecuteDataTable(sql, sps, CommandType.Text);
         if (sourceTable == null || sourceTable.Rows.Count <= 0)
         {
             MessageBox.Show("没有符合条件的数据");
         }
         gridControl1.DataSource = sourceTable;
         //if (sourceTable == null || sourceTable.Rows.Count <= 0)
         //{
         //    MessageBox.Show("没有符合您查询的系统参数配置的相关数据!");
         //}
         m_app.PublicMethod.ConvertGridDataSourceUpper(gridView1);
         //绑定数据  查询结构加载时 changed事件获取不到句柄 不能自动绑定数据需要手动加载 2012-10-25
         DataRow dataRow = gridView1.GetDataRow(gridView1.FocusedRowHandle);
         if (dataRow == null)
         {
             return;
         }
         SetApp(dataRow);
         AddControlToMyPanel(dataRow);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #9
0
 /// <summary>
 /// 多科会诊且会诊意见由受邀医师填写申请人初次打开默认值是否组合其他医师意见
 /// Add xlb 2013-03-07
 /// </summary>
 private string SetComposeConsultSuggestion(ConsultRecordForWrite consultZDR)
 {
     try
     {
         //多科会诊且配置由受邀医师填写会诊意见 申请医师总结时根据配置是否组合其他医师意见
         if (consultZDR == ConsultRecordForWrite.MultiEmployee)
         {
             string value       = ConsultCommon.GetConfigKey("IsComposeSuggestion").Trim();
             string ComposeInfo = string.Empty;
             if (value != "0")
             {
                 string         sql = @"select s.consultsuggestion,u.name from consultsuggestion s join 
              users u on s.createuser=u.id where s.valid=1 and u.valid=1 and s.consultapplysn=@consultApplySn  and s.state='20'";
                 SqlParameter[] sps = { new SqlParameter("@consultApplySn", mconsultApplySn) };
                 DataTable      dt  = DS_SqlHelper.ExecuteDataTable(sql, sps, CommandType.Text);
                 if (dt == null || dt.Rows.Count <= 0)
                 {
                     return("");
                 }
                 foreach (DataRow row in dt.Rows)
                 {
                     ComposeInfo += "[" + row["NAME"] + "]" + ":" + row["CONSULTSUGGESTION"];
                     ComposeInfo += "\r\n";
                 }
                 return(ComposeInfo);
             }
         }
         return("");
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #10
0
 /// <summary>
 /// 保存方法 用于删除受邀医生或修改新增记录
 /// Add xlb 2013-03-08
 /// </summary>
 /// <param name="typeId"></param>
 /// <param name="row"></param>
 private void SaveConsultRecordDepartment(int typeId /*操作类型*/, DataRow row)
 {
     try
     {
         string departmentCode  = string.Empty;
         string departmentName  = string.Empty;
         string employeeCode    = string.Empty;
         string employeeName    = string.Empty;
         string employeeLevelID = string.Empty;
         string createUser      = m_app.User.Id; //创建人
         string createTime      = System.DateTime.Now.ToString();
         string modifyuser      = m_app.User.Id; //修改人
         string canceluser      = m_app.User.Id; //作废人
         int    ConsultID       = 0;
         int    ordervalue      = 1;
         string sql             = @"select id from hospitalinfo";
         //医院代码
         string hospitalCode = DS_SqlHelper.ExecuteDataTable(sql, CommandType.Text).Rows[0][0].ToString();
         //行状态为删除则记录删除行ID
         if (row.RowState == DataRowState.Deleted)
         {
             //获取删除前的ID值
             ConsultID = int.Parse(row["ID", DataRowVersion.Original].ToString());
         }
         else
         {//行状态为新增或修改状态则记录相应的值
             departmentCode  = row["DepartmentCode"].ToString();
             departmentName  = row["DepartmentName"].ToString();
             employeeCode    = row["EmployeeCode"].ToString();
             employeeName    = row["EmployeeName"].ToString();
             employeeLevelID = row["EmployeeLevelID"].ToString();
             if (!string.IsNullOrEmpty(row["ID"].ToString()))
             {
                 ConsultID = int.Parse(row["ID"].ToString());//ID
             }
         }
         SqlParameter[] sps =
         {
             new SqlParameter("@TypeID",          typeId),
             new SqlParameter("@ConsultId",       ConsultID),
             new SqlParameter("@consultapplysn",  mconsultApplySn),
             new SqlParameter("@ordervalue",      ordervalue),
             new SqlParameter("@hospitalcode",    hospitalCode),
             new SqlParameter("@departmentcode",  departmentCode),
             new SqlParameter("@departmentname",  departmentName),
             new SqlParameter("@employeecode",    employeeCode),
             new SqlParameter("@employeename",    employeeName),
             new SqlParameter("@employeelevelid", employeeLevelID),
             new SqlParameter("@createuser",      createUser),
             new SqlParameter("@createtime",      createTime),
             new SqlParameter("@canceluser",      canceluser),
             new SqlParameter("@modifyuser",      modifyuser)
         };
         DS_SqlHelper.ExecuteNonQuery("EMR_CONSULTATION.usp_SaveConsultRecord", sps, CommandType.StoredProcedure);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #11
0
 /// <summary>
 /// .ctor
 /// </summary>
 public WaterMarkConfig()
 {
     try
     {
         DataTable dt = DS_SqlHelper.ExecuteDataTable("select value from appcfg where configkey = 'EmrPDFWaterMark'", CommandType.Text);
         if (dt.Rows.Count == 0)
         {
             return;
         }
         string      xml = dt.Rows[0][0].ToString();
         XmlDocument doc = new XmlDocument();
         doc.LoadXml(xml);
         FontFamily = doc.GetElementsByTagName("font-family")[0].InnerText;
         FontSize   = int.Parse(doc.GetElementsByTagName("font-size")[0].InnerText);
         Content    = doc.GetElementsByTagName("content")[0].InnerText.Trim();
         TranslateX = float.Parse(doc.GetElementsByTagName("translate-x")[0].InnerText);
         TranslateY = float.Parse(doc.GetElementsByTagName("translate-y")[0].InnerText);
         ShearX     = float.Parse(doc.GetElementsByTagName("shear-x")[0].InnerText);
         ShearY     = float.Parse(doc.GetElementsByTagName("shear-y")[0].InnerText);
         ColorAlpha = int.Parse(doc.GetElementsByTagName("alpha")[0].InnerText);
         ColorRed   = int.Parse(doc.GetElementsByTagName("red")[0].InnerText);
         ColorGreen = int.Parse(doc.GetElementsByTagName("green")[0].InnerText);
         ColorBlue  = int.Parse(doc.GetElementsByTagName("blue")[0].InnerText);
     }
     catch (Exception ex)
     {
         throw new Exception("水印配置有误!  " + ex.Message);
     }
 }
 /// <summary>
 /// 查询方法
 /// by XLB 2012-12-14 9:41
 /// </summary>
 private void Search()
 {
     try
     {
         string         strSql = @"select ct.TempFlow,ct.TempName,ct.TempDesc,ct.CreateDateTime,ct.modifydatetime from CommonnotePrintTemp ct 
         where 1=1 and ct.Valide='1' and ct.TempName like '%'||@tname||'%' and ct.TempDesc like '%'||@desca||'%'order by  createdatetime desc ";
         SqlParameter[] sps    = { new SqlParameter("@tname", txtFileName.Text.Trim()),
                                   new SqlParameter("@desca",    txtDescription.Text.Trim()) };
         DataTable      dt = DS_SqlHelper.ExecuteDataTable(strSql, sps, CommandType.Text);
         // DataTable dt = m_app.SqlHelper.ExecuteDataTable(strSql, sps,CommandType.Text);
         if (dt != null && dt.Rows.Count > 0)
         {
             gcCommonModel.DataSource = dt;
         }
         else
         {
             gcCommonModel.DataSource = null;
             DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("没有符合条件的数据");
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #13
0
 /// <summary>
 /// 受邀医师切换联动事件
 /// Add by xlb 2013-03-11
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lookUpEditorEmployee_CodeValueChanged(object sender, EventArgs e)
 {
     try
     {
         string         sql = "select grade from users where id=@userId";
         SqlParameter[] sps = { new SqlParameter("@userId", lookUpEditorEmployee.CodeValue) };
         DataTable      dt  = DS_SqlHelper.ExecuteDataTable(sql, sps, CommandType.Text);
         if (dt == null || dt.Rows.Count <= 0)
         {
             return;
         }
         string valueLevel = dt.Rows[0][0].ToString();
         if (string.IsNullOrEmpty(valueLevel))
         {
             return;
         }
         lookUpEditorDocLevel.CodeValueChanged -= new EventHandler(lookUpEditorDocLevel_CodeValueChanged);
         lookUpEditorDocLevel.CodeValue         = valueLevel;//赋编码前取消联动事件赋值后再注册
         lookUpEditorDocLevel.CodeValueChanged += new EventHandler(lookUpEditorDocLevel_CodeValueChanged);
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }
Beispiel #14
0
        public UserLoginInfo()
        {
            InitializeComponent();
            string sql = "select * from USERLOGIN";

            this.gridControl1.DataSource = DS_SqlHelper.ExecuteDataTable(sql);
        }
Beispiel #15
0
        public ActiveUser()
        {
            InitializeComponent();
            string sql = "select * from ACTIVEUSER";

            this.gridControl1.DataSource = DS_SqlHelper.ExecuteDataTable(sql);
        }
Beispiel #16
0
        /// <summary>
        /// 获取该病程所在科室的所有病程记录
        /// </summary>
        /// <returns></returns>
        private XmlDocument GetAllDailyEmrContentInOneDept()
        {
            try
            {
                string id           = m_Model.InstanceId.ToString();
                string changeid     = m_Model.DeptChangeID;
                string sqlGetRecord = string.Format(
                    @"SELECT r.content FROM recorddetail r WHERE r.noofinpat in (select noofinpat from recorddetail where recorddetail.id = '{0}')
                        and r.changeid = '{1}' and r.valid = '1' order by r.captiondatetime", id, changeid);
                DataTable dt = DS_SqlHelper.ExecuteDataTable(sqlGetRecord);

                //如果出现异常上面没有捞到数据,则直接通过ID到数据库中查找数据
                if (dt.Rows.Count == 0)
                {
                    sqlGetRecord = string.Format(
                        @"SELECT r.content FROM recorddetail r where r.id = '{0}'", id);
                    dt = DS_SqlHelper.ExecuteDataTable(sqlGetRecord);
                    return(ConcatCheckedEmrContent(dt));
                }
                return(ConcatCheckedEmrContent(dt));
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #17
0
 /// <summary>
 /// 初始化科室下拉框
 /// Add by xlb 2013-04-08
 /// </summary>
 /// <param name="lookUpEditor"></param>
 private void InitDataDept(LookUpEditor lookUpEditor)
 {
     try
     {
         LookUpWindow lookUpWindow = new LookUpWindow();
         lookUpEditor.Kind       = WordbookKind.Sql;
         lookUpEditor.ListWindow = lookUpWindow;
         DataTable dtDept = DS_SqlHelper.ExecuteDataTable(@"select ID,NAME,py,wb from department  
         where sort in('101','102') and valid='1' ", CommandType.Text);
         if (dtDept == null || dtDept.Columns.Count <= 0)
         {
             return;
         }
         for (int i = 0; i > dtDept.Columns.Count; i++)
         {
             if (dtDept.Columns[i].ColumnName.ToUpper().Trim() == "ID")
             {
                 dtDept.Columns[i].Caption = "编号";
             }
             else if (dtDept.Columns[i].ColumnName.ToUpper().Trim() == "NAME")
             {
                 dtDept.Columns[i].Caption = "科室";
             }
         }
         Dictionary <string, int> dictionary = new Dictionary <string, int>();
         dictionary.Add("ID", 30);
         dictionary.Add("NAME", 76);
         SqlWordbook sqlWordBook = new SqlWordbook("deptMent", dtDept, "ID", "NAME", dictionary, "ID//NAME//PY//WB");
         lookUpEditor.SqlWordbook = sqlWordBook;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #18
0
        /// <summary>
        /// 获取配置信息
        /// <auth>Yanqiao.Cai</auth>
        /// <date>2012-12-03</date>
        /// <param name="key"></param>
        /// <returns></returns>
        private string GetConfigValueByKey(string key)
        {
            try
            {
                if (!string.IsNullOrEmpty(key))
                {
                    string        sqlStr    = " select * from appcfg where configkey = @key ";
                    DbParameter[] sqlParams = new DbParameter[]
                    {
                        new SqlParameter("@key", SqlDbType.Char, 32)
                    };
                    sqlParams[0].Value = key;
                    DS_SqlHelper.DefaultDataAccess();
                    DataTable dt = DS_SqlHelper.ExecuteDataTable(sqlStr, sqlParams, CommandType.Text);
                    if (null != dt && dt.Rows.Count > 0)
                    {
                        return(null == dt.Rows[0]["value"] ? string.Empty : dt.Rows[0]["value"].ToString());
                    }
                }

                return(string.Empty);
            }
            catch (Exception ex)
            {
                io.WriteLog(ex.Message);
                throw ex;
            }
        }
Beispiel #19
0
 /// <summary>
 /// 通过存储过程来查找医嘱信息
 /// </summary>
 /// <param name="procedureName"></param>
 private void GetDateTableByPrc(string procedureName)
 {
     try
     {
         SqlParameter p_result = new SqlParameter("@result", SqlDbType.Structured);
         p_result.Direction = ParameterDirection.Output;
         SqlParameter[] sps =
         {
             new SqlParameter("@InpatId",   SqlDbType.VarChar),
             new SqlParameter("@DeptId",    SqlDbType.VarChar),
             new SqlParameter("@Type",      rdgOrderStyle.SelectedIndex),
             new SqlParameter("@BeginDate", SqlDbType.VarChar),
             new SqlParameter("@EndDate",   SqlDbType.VarChar),
             p_result
         };
         if (CurrentInpatient != null)
         {
             sps[0].Value = CurrentInpatient.NoOfHisFirstPage;
         }
         else
         {
             sps[0].Value = CurrentNoofinpat;
         }
         sps[1].Value = lookUpEditorDept.CodeValue;
         sps[3].Value = dateEditBegin.Text;
         sps[4].Value = dateEditEnd.Text;
         dtOrder      = DS_SqlHelper.ExecuteDataTable(procedureName, sps, CommandType.StoredProcedure);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #20
0
        /// <summary>
        /// 抓取所有数据元
        /// Add by xlb 2013-04-12
        /// </summary>
        /// <returns></returns>
        public List <DateElementEntity> GetAllDateElement()
        {
            try
            {
                SqlParameter p_result = new SqlParameter("@result", SqlDbType.Structured);
                p_result.Direction = ParameterDirection.Output;
                SqlParameter[] sqlParams = new SqlParameter[]
                {
                    new SqlParameter("@ElementId", SqlDbType.VarChar, 50),
                    new SqlParameter("@ElementName", SqlDbType.VarChar, 50),
                    new SqlParameter("@ElementClass", SqlDbType.VarChar, 50),
                    new SqlParameter("@ElementPYM", SqlDbType.VarChar, 50),
                    p_result
                };
                sqlParams[0].Value = "";
                sqlParams[1].Value = "";
                sqlParams[2].Value = "";
                sqlParams[3].Value = "";
                DataTable dtDateTable             = DS_SqlHelper.ExecuteDataTable("EMR_CommonNote.usp_GetDateElement", sqlParams, CommandType.StoredProcedure);
                List <DateElementEntity> dataList = DataTableToList <DateElementEntity> .ConvertToModel(dtDateTable);

                return(dataList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #21
0
 /// <summary>
 /// 查看维护数据元是否已被使用
 /// Add by xlb 2013-04-12
 /// </summary>
 /// <param name="iemeXId">维护对象数据元对应流水号</param>
 /// <returns>条数</returns>
 public int GetIsBeenUse(string iemeXId /*维护对象属性流水号*/)
 {
     try
     {
         //通过维护对象数据元查看是否该数据元已被使用
         //需串维护表确定该字段是否仍在使用
         string         sqlGetCount = @"select count(*) from iem_mainpage_except_use where 
                                                                          iemexid=@ieMexId and 
                                   exists(select 1 from iem_mainpage_except where iemexid=@ieMexId 
                                                                              and valide='1')";
         SqlParameter[] sps         = { new SqlParameter("@ieMexId", iemeXId) };
         DataTable      dtCount     = DS_SqlHelper.ExecuteDataTable(sqlGetCount, sps, CommandType.Text);
         if (dtCount == null || dtCount.Rows.Count <= 0)
         {
             return(0);
         }
         else
         {
             return(Int32.Parse(dtCount.Rows[0][0].ToString()));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #22
0
 /// <summary>
 /// 改用参数查询,避免特殊字符带来的问题
 /// by xlb 2012-12-20
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void simpleButtonQueryDG_Click(object sender, EventArgs e)
 {
     try
     {//add try catch 替换单引号,屏蔽基本引起问题的字符  XLB 2012-12-10
         //string sql = "select * from DiseaseGroup";
         //string name = this.textEditGroupNameQuery.Text.Trim().Replace("'","''");
         //if (name != "")
         //{
         //    if (name.Contains("["))
         //    {
         //        m_app.CustomMessageBox.MessageShow("请不要输入特殊字符");
         //        return;
         //    }
         string         name = this.textEditGroupNameQuery.Text.Trim();
         string         sql  = "select * from DiseaseGroup where name like '%'||@name||'%'";
         SqlParameter[] sps  = { new SqlParameter("@name", name) };
         // }
         //DataTable dt = m_app.SqlHelper.ExecuteDataTable(sql);
         DataTable dt = DS_SqlHelper.ExecuteDataTable(sql, sps, CommandType.Text);
         if (dt != null && dt.Rows.Count > 0)
         {
             this.gridControlDiseaseGroup.DataSource = dt;
         }
         else
         {
             this.gridControlDiseaseGroup.DataSource = null;
         }
     }
     catch (Exception ex)
     {
         //m_app.CustomMessageBox.MessageShow(ex.Message);
         MyMessageBox.Show(1, ex);
     }
 }
Beispiel #23
0
 /// <summary>
 /// 取得所有有效时限条件
 /// xlb 2013-01-06
 /// </summary>
 /// <returns></returns>
 public static DataTable GetAllQcCondition2(QCCondition _qcCondition)
 {
     try
     {
         if (_qcCondition == null)
         {
             return(null);
         }
         if (_qcCondition.Code == null)
         {
             _qcCondition.Code = "";
         }
         if (_qcCondition.Description == null)
         {
             _qcCondition.Description = "";
         }
         SqlParameter[] sps =
         {
             new SqlParameter("@code",        _qcCondition.Code),
             new SqlParameter("@description", _qcCondition.Description)
         };
         DataTable dtQCCondition = DS_SqlHelper.ExecuteDataTable(c_SqlQcCondition2, sps, CommandType.Text);
         return(dtQCCondition);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #24
0
        public DiagGroupInfo()
        {
            InitializeComponent();
            string sql = "select * from DIAGNOSIS_NEW";

            this.gridControl1.DataSource = DS_SqlHelper.ExecuteDataTable(sql);
        }
Beispiel #25
0
 /// <summary>
 ///  初始化科室信息
 ///  <auth>张业兴</auth>
 /// <date>2012-12-12</date>
 /// </summary>
 private void InitDepartment()
 {
     try
     {
         SqlParameter[] parms = new SqlParameter[]
         {
             new SqlParameter("@GetType", SqlDbType.VarChar),
             new SqlParameter("@result", SqlDbType.Structured)
         };
         parms[0].Value     = "1";
         parms[1].Direction = ParameterDirection.Output;
         DataTable Dept = DS_SqlHelper.ExecuteDataTable("emrproc.usp_GetMedicalRrecordViewFrm", parms, CommandType.StoredProcedure);
         Dept.Columns["ID"].Caption   = "科室代码";
         Dept.Columns["NAME"].Caption = "科室名称";
         Dictionary <string, int> cols = new Dictionary <string, int>();
         cols.Add("ID", 60);
         cols.Add("NAME", 90);
         SqlWordbook deptWordBook = new SqlWordbook("querydept", Dept, "ID", "NAME", cols, "ID//NAME//PY//WB");
         lookUpEditorDepartment.SqlWordbook = deptWordBook;
         lookUpEditorDepartment.CodeValue   = "0000";
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }
Beispiel #26
0
 /// <summary>
 /// 绑定图片签名窗体
 /// <auth>zyx</auth>
 /// <date>2012-12-13</date>
 /// </summary>
 private void BindTable()
 {
     try
     {
         string         sqlStr = "select a.name UserName,a.id  UserId ,b.name DepartmentName,c.userpicflow, case when c.Valide=1 then '是' else '否' end as  Valide from users a left join department b on a.deptid=b.id left join userpicsign  c on a.id=c.userid where a.id=@userid";
         SqlParameter[] parms  = new SqlParameter[] { new SqlParameter("@userid", SqlDbType.NVarChar) };
         parms[0].Value = m_app.User.Id;
         DataTable dt = DS_SqlHelper.ExecuteDataTable(sqlStr, parms, CommandType.Text);
         DataRow   dr = null;
         if (dt != null && dt.Rows.Count > 0)
         {
             dr = dt.Rows[0];
         }
         PicSignForm picSignForm = new PicSignForm(m_app, dr);
         picSignForm.FormClosed     += new FormClosedEventHandler(picSignForm_FormClosed);
         picSignForm.Dock            = DockStyle.Fill;
         picSignForm.TopLevel        = false;
         picSignForm.FormBorderStyle = FormBorderStyle.None;
         picSignForm.Show();
         xtraTabPagePicSign.Controls.Clear();
         xtraTabPagePicSign.Controls.Add(picSignForm);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #27
0
        public DaLianYiBaoForm(Inpatient currentInpatient)
        {
            InitializeComponent();
            m_currentInpatient = currentInpatient;

            DS_SqlHelper.CreateSqlHelperByDBName("HISDB");
            string    sql = string.Format("select patnoofhis,yybh,bxbh,zlxh from YD_DLYBSC where patnoofhis='{0}'", m_currentInpatient.NoOfHisFirstPage);
            DataTable dt  = DS_SqlHelper.ExecuteDataTable(sql, CommandType.Text);
        }
Beispiel #28
0
 /// <summary>
 /// <auth>XLB</auth>
 /// <date>2013-06-09</date>
 /// <Purpose>抓取当前病人所有的状态</Purpose>
 /// </summary>
 /// <param name="noofinpat"></param>
 /// <returns></returns>
 private DataTable GetAllPatStatusByNoofinpat(string noofinpat)
 {
     try
     {
         return DS_SqlHelper.ExecuteDataTable(@"select a.dotime,b.name,b.id from PatientStatus a join THREE_CHECK_EVENT b on  a.ccode=b.id and a.noofinpat=@nOofinpat", new SqlParameter[] { new SqlParameter("@nOofinpat", noofinpat) }, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #29
0
        /// <summary>
        /// 保存方法
        /// xlb 2013-01-08
        /// </summary>
        private void SaveEmrQcItem()
        {
            try
            {
                string message = "";
                if (!ValidateEdit(ref message))
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(message);
                    return;
                }
                emrQcItem        = new EmrQcItem();
                emrQcItem.Name   = textEditCodeName.Text;
                emrQcItem.Code   = textEditCode.Text;
                emrQcItem.I_Code = textEditICode.Text.Trim();
                emrQcItem.I_Name = textEditICodeName.Text;
                List <EmrQcItem> emrQcItemList = gridControlEmrQcItem.DataSource as List <EmrQcItem>;
                if (emrQcItemList == null)
                {
                    emrQcItemList = new List <EmrQcItem>();
                }

                if (textEditICode.Enabled)
                {
                    SqlParameter[] sps = { new SqlParameter("@ICODE", textEditICode.Text.Trim()) };
                    DataTable      dt  = DS_SqlHelper.ExecuteDataTable("select count(1) from emrqcitem where I_CODE=@ICODE ", sps, CommandType.Text);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        int count = int.Parse(dt.Rows[0][0].ToString());
                        if (count > 0)
                        {
                            DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该监控代码已存在");
                            textEditICode.Focus();
                            return;
                        }
                    }
                    EmrQcItem.InsertToEmrQcItem(emrQcItem);
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("新增成功");
                    emrQcItemList.Add(emrQcItem);
                }
                else
                {
                    EmrQcItem.UpdateToEmrQcItem(emrQcItem);
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("修改成功");
                }
                gridControlEmrQcItem.DataSource = new List <EmrQcItem>(emrQcItemList);
                gridViewEmrQcItem.MoveBy(emrQcItemList.Count - 1);

                SetEditState(false, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #30
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="noOfInpat"></param>
 /// <returns></returns>
 public DataTable GetPatientInfoForThreeMeasureTable(decimal noOfInpat)
 {
     SqlParameter[] sqlParam = new SqlParameter[]
     {
         new SqlParameter("@NoOfInpat", SqlDbType.Decimal),
         new SqlParameter("@result", SqlDbType.Structured)
     };
     sqlParam[0].Value = noOfInpat;
     sqlParam[1].Direction = ParameterDirection.Output;
     return DS_SqlHelper.ExecuteDataTable("EMRPROC.usp_GetPatientInfoForThreeMeas", sqlParam, CommandType.StoredProcedure);
 }