Esempio n. 1
0
        private void 医嘱查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                //comment by wangzhi 2010-11-16
                //DataTable tb = (DataTable)dgvyjsq.DataSource;
                //if ( dataGridView1.CurrentCell == null )
                //    return;
                //if ( tb.Rows.Count <= 0 )
                //    return;
                //int nrow = dgvyjsq.CurrentCell.RowIndex;
                //Guid yzid = new Guid( tb.Rows[nrow]["yzid"].ToString() );
                //end comment

                // add by wangzhi 2010-11-16
                if (dgvyjsq.DataSource == null)
                {
                    return;
                }
                if (dgvyjsq.Rows.Count == 0)
                {
                    return;
                }
                DataView dv   = (DataView)dgvyjsq.DataSource;
                int      nrow = dgvyjsq.CurrentCell.RowIndex;
                Guid     yzid = new Guid(dv[nrow]["yzid"].ToString());
                //end add

                string ssql = " select a.inpatient_id,a.baby_id,a.ward_id,a.dept_br,0 dept_ly,flag, " +
                              " CAST(A.INPATIENT_ID AS CHAR(40)) + CAST(A.BABY_id AS CHAR(10)) + CAST(0 AS CHAR(10)) + CAST(A.dept_br AS CHAR(10)) + CAST(A.WARD_ID AS CHAR(10)) AS STAG " +
                              "from zy_orderrecord a inner join VI_ZY_VINPATIENT b " +
                              " on a.inpatient_id=b.inpatient_id   " +
                              " where order_id='" + yzid + "' ";
                DataTable tbmx = InstanceForm.BDatabase.GetDataTable(ssql);
                if (tbmx.Rows.Count == 0)
                {
                    return;
                }

                int _flag = Convert.ToInt32(tbmx.Rows[0]["flag"]);
                if (_flag == 2 || _flag == 4 || _flag == 5 || _flag == 6)
                {
                    MessageBox.Show("该病人已经出院!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                object[] communicateValue = new object[3];

                //这个是废参数,无所谓
                communicateValue[0] = "";
                communicateValue[1] = 0;
                //病人ID
                communicateValue[2] = tbmx.Rows[0]["inpatient_id"].ToString();

                WorkStaticFun.InstanceFormEx("ts_zyhs_yzgl", "Fun_ts_zyhs_yzgl_inpatient", "医嘱查询", InstanceForm.BCurrentUser, InstanceForm.BCurrentDept, new MenuTag(), -1, this.MdiParent, InstanceForm.BDatabase, ref communicateValue);
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 医嘱查询_麻醉,信息查询
        /// </summary>
        /// <param name="userid">开嘱医生userId</param>
        /// <param name="deptid">开嘱医生的科室ID</param>
        /// <param name="dept_br">病人所在科室ID</param>
        private void ShowFrmYZCX_MZ(long userid, long deptid, string ssNo)
        {
            if (this.txtPatID.Text == "")
            {
                MessageBox.Show("请输入住院号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            object[]   communicateValue = new object[3];
            User       _userid          = new User(userid, FrmMdiMain.Database);
            Department _deptid          = new Department(deptid, FrmMdiMain.Database);
            //add by zouchihua 2012-5-24 医生工作站 手术麻醉进入是否对婴儿记账 0=否,1=是
            SystemCfg cfg6034 = new SystemCfg(6034);
            string    ssql    = "";

            if (cfg6034.Config.Trim() == "0")
            {
                ssql = "select  INPATIENT_NO AS 住院号,NAME AS 姓名,INPATIENT_ID,0 as Baby_ID,DEPT_ID,0 as isMY " +
                       "from vi_zy_vinpatient " +
                       "where inpatient_no='" + ssNo + "' and flag<>10";
            }
            else
            {
                ssql = "select  INPATIENT_NO AS 住院号,NAME AS 姓名,INPATIENT_ID,Baby_ID,DEPT_ID,0 as isMY " +
                       "from VI_ZY_VINPATIENT_BED " +
                       "where inpatient_no='" + ssNo + "' and flag<>10";
            }

            if (type == 0)
            {
                //Modify By Tany 2011-03-03
                //9003是否允许对未开手术申请的病人录入医嘱 0=是 1=不是
                if (new SystemCfg(9003).Config == "1")
                {
                    ssql += " and inpatient_id in (select inpatient_id from ss_apprecord where (jzss=1 or shbj=1) and bdelete=0)";
                }
            }
            else//特殊治疗
            {
                ssql = "select  INPATIENT_NO AS 住院号,NAME AS 姓名,INPATIENT_ID,0 as Baby_ID,DEPT_ID,0 as isMY " +
                       "from vi_zy_vinpatient_bed " +
                       "where inpatient_no='" + ssNo + "' and flag<>10";
            }
            DataTable tb = FrmMdiMain.Database.GetDataTable(ssql);

            if (tb.Rows.Count == 0)
            {
                MessageBox.Show("不能查询该住院号的病人,请重新输入住院号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            ClassStatic.Current_BinID  = new Guid(tb.Rows[0]["INPATIENT_ID"].ToString());
            ClassStatic.Current_DeptID = Convert.ToInt64(tb.Rows[0]["DEPT_ID"]);
            ClassStatic.Current_BabyID = 0;
            communicateValue[0]        = ssql;
            communicateValue[1]        = 1;
            //Modify by zouchihua 2012-3-19
            if (type == 0)
            {
                //Modify By Tany 2015-05-11 手术和麻醉要根据科室来
                DataTable ssmzTb = FrmMdiMain.Database.GetDataTable("select * from ss_dept where deptid=" + FrmMdiMain.CurrentDept.DeptId);
                if (ssmzTb != null && ssmzTb.Rows.Count > 0)
                {
                    int ssmzType = Convert.ToInt32(ssmzTb.Rows[0]["type"]);
                    communicateValue[1] = ssmzType; //0=手术 1=麻醉
                }
                WorkStaticFun.InstanceFormEx("ts_zyhs_yzgl", "Fun_ts_zyhs_yzgl_ssmz", "医嘱管理", _userid, _deptid, InstanceForm._functions, InstanceForm._menuId, this.MdiParent, FrmMdiMain.Database, ref communicateValue);
            }
            if (type == 1)
            {
                communicateValue[2] = tb.Rows[0]["INPATIENT_ID"].ToString();
                WorkStaticFun.InstanceFormEx("ts_zyhs_yzgl", "Fun_ts_zyhs_yzgl_inpatient", "医嘱管理", _userid, _deptid, InstanceForm._functions, InstanceForm._menuId, this.MdiParent, FrmMdiMain.Database, ref communicateValue);
            }
        }