Пример #1
0
        public void ReadDrugMod_List()
        {
            string sql = "SELECT a.sid, b.drg_name, a.intake, a.medway, a.freq ";

            sql += "FROM drug_modual a ";
            sql += "LEFT JOIN drug_list b ON a.drg_code=b.drg_code ";
            sql += "WHERE a.status='Y' ";
            sql += "ORDER BY a.drg_code";
            DataTable dt     = db.Query(sql);
            Store     istore = Grid_DrugTerm.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
            dt.Dispose();
        }
        //2015.03.26 ANDY 新床位
        protected void FILL_BEDN()
        {
            DateTime now = DateTime.Now;

            this.txtTIME.Text = now.ToString("yyyy-MM-dd HH:mm:ss");
            sDATE.Text        = this.txtTIME.Text.Substring(0, 10);
            GET_WEEK();
            string sSQL = "";

            sSQL = "SELECT A.sched_year  AS sched_year,A.sched_mon  AS sched_mon, " +
                   " A.sched_flr  AS sched_flr,A.sched_sec  AS sched_sec,A.sched_bedno AS sched_bedno,A.sched_mactyp AS sched_mactyp,A.sched_timen  AS sched_timen," +
                   " A.SCHED_1D_NAME  AS SCHED_1D_NAME,A.SCHED_2D_NAME AS SCHED_2D_NAME,A.SCHED_3D_NAME AS SCHED_3D_NAME,A.SCHED_4D_NAME AS SCHED_4D_NAME,A.SCHED_5D  AS SCHED_5D," +
                   "       A.SCHED_6D  AS SCHED_6D,A.SCHED_7D AS SCHED_7D,A.SCHED_8D AS SCHED_8D,A.SCHED_9D AS SCHED_9D,A.SCHED_10D AS SCHED_10D," +
                   "       A.SCHED_11D AS SCHED_11D,A.SCHED_12D AS SCHED_12D,A.SCHED_13D AS SCHED_13D,A.SCHED_14D AS SCHED_14D,A.SCHED_15D AS SCHED_15D" +
                   " FROM data_sched A ";
            DBMysql db = new DBMysql();

            System.Data.DataTable dt = db.Query(sSQL);
            Store istore             = grdBED_LISTN.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();

            if (dt.Rows.Count > 0)
            {
            }
            ;


            //Column5.Text = "25";
            Panel5.Title = WFLOOR.Text + "楼" + WAREA.Text + "区";
        }
Пример #3
0
        protected void show_grid()
        {
            DBMysql db = new DBMysql();

            string    sql = string.Format(SQL_SELECT_BY_PATIENT, _PAT_ID);
            DataTable dt  = db.Query(sql);

            Store istore = Grid_clinical1_nurse.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
        }
        protected void show_grid()
        {
            DBMysql db  = new DBMysql();
            string  sql = "SELECT a.cln1_diadate,a.cln1_col1,a.cln1_col34,a.cln1_col5, a.cln1_col6,";

            sql += " a.cln1_col7,a.cln1_col8,a.cln1_col13,a.cln1_col14,a.cln1_col15 ";
            sql += "  FROM clinical1_nurse a,pat_info b ";
            sql += " WHERE b.pif_id = '" + _PAT_ID + "' ";
            sql += "   AND a.cln1_patic = b.pif_ic ";
            sql += "ORDER BY a.cln1_diadate DESC";

            DataTable dt = db.Query(sql);

            //sql = "SELECT pck_code AS CODE, pck_name AS NAME FROM package_setup ";
            //DataTable dt4 = db.Query(sql);
            //System.Data.DataView dv4 = dt4.DefaultView;
            //for (int i = 0; i < dt.Rows.Count; i++)
            //{
            //    dv4.RowFilter = "CODE='" + dt.Rows[i]["cln1_col4"].ToString() + "' ";
            //    if (dv4.Count > 0)
            //        dt.Rows[i]["cln1_col4"] = dv4[0]["NAME"].ToString();
            //}

            //20160321 Alex 沒作用刪除
            //sql = "SELECT hp_code AS CODE, hp_subgrp AS NAME FROM h_type ";
            //sql = "SELECT pck_code AS CODE, pck_name AS NAME FROM package_setup"; //修正與FLEX抓取相同資料表
            //DataTable dt34 = db.Query(sql);
            //System.Data.DataView dv34 = dt34.DefaultView;
            //for (int i = 0; i < dt.Rows.Count; i++)
            //{
            //    dv34.RowFilter = "CODE='" + dt.Rows[i]["cln1_col34"].ToString() + "' ";
            //    if (dv34.Count > 0)
            //        dt.Rows[i]["cln1_col34"] = dv34[0]["NAME"].ToString();
            //}



            Store istore = Grid_clinical1_nurse.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
        }
Пример #5
0
        protected void Show_shortdrughistory()
        {
            DBMysql db = new DBMysql();
            string  sql;

            //old sql = "SELECT a.shord_id,a.shord_dateord,a.shord_timeord,a.shord_usr1,b.drg_name,a.shord_intake,a.shord_freq,a.shord_comment,c.genst_desc ";
            //2015.01.20 andy 短期醫囑:增加給藥方式 執行護士 顯示
            sql  = "SELECT a.shord_id,a.shord_dateord,a.shord_timeord,a.shord_usr1,b.drg_name,a.shord_intake,a.shord_freq,a.shord_medway,a.shord_nurs,c.genst_desc,a.shord_comment ";
            sql += "from shortterm_ordermgt a,drug_list b, general_setup c ";
            sql += "where a.shord_patic = '" + patient_id.Text + "' ";
            sql += "and a.shord_drug = b.drg_code ";
            sql += "and c.genst_ctg = 'ActiveStatus' and a.shord_actst = c.genst_code order by a.shord_id DESC";

            DataTable dt = db.Query(sql);

            Store istore2 = Grid_Show_ORDSHORT.GetStore();

            istore2.DataSource = db.GetDataArray(dt);
            istore2.DataBind();
        }
Пример #6
0
        protected void Load_Appointment()
        {
            toDay = DateTime.Now.ToString("yyyy-MM-dd");
            string sSQL = "";

            //sSQL = "SELECT a.apptst_patic AS pat_ic, b.pif_name AS pat_name, a.apptst_flr AS floor, a.apptst_sec AS area, a.apptst_bed AS bedno, a.apptst_mactyp AS mactype, a.apptst_daytyp AS daytype, a.apptst_timetyp AS timetype ";
            //sSQL += "FROM appointment_setup a ";
            //sSQL += "LEFT JOIN pat_info b ON b.pif_ic=a.apptst_patic ";
            //sSQL += "WHERE b.pif_ic='" + Text_IC.Text + "' ";
            //sSQL += "UNION ";
            //sSQL += "SELECT a.ah_patic AS pat_ic, b.pif_name AS pat_name, a.ah_flr AS floor, a.ah_sec AS area, a.ah_bed AS bedno, a.ah_mactyp AS mactype, a.ah_dycnt AS daytype, a.ah_timetyp AS timetype ";
            //sSQL += "FROM appointment_change a ";
            //sSQL += "LEFT JOIN pat_info b ON b.pif_ic=a.ah_patic ";
            //sSQL += "WHERE a.ah_patic='" + Text_IC.Text + "' AND a.ah_date>='" + toDay + "' ";
            sSQL  = "SELECT b.pif_ic AS pat_ic, b.pif_name AS pat_name, a.pv_floor AS floor, a.pv_sec AS area, a.pv_bedno AS bedno, a.appointment_date as ddate, '0' AS daytype, a.time_type as timetype ";
            sSQL += "FROM appointment a ";
            sSQL += "LEFT JOIN pat_info b ON a.pif_id=b.pif_id ";
            sSQL += "WHERE (b.pif_name='" + Text_Name.Text + "' OR b.pif_ic='" + Text_IC.Text + "') AND a.appointment_date>='" + toDay + "' ";
            sSQL += "UNION ";
            sSQL += "SELECT a.ah_patic AS pat_ic, b.pif_name AS pat_name, a.ah_flr AS floor, a.ah_sec AS area, a.ah_bed AS bedno, a.ah_date AS ddate, a.ah_dycnt AS daytype, a.ah_timetyp AS timetype ";
            sSQL += "FROM appointment_change a ";
            sSQL += "LEFT JOIN pat_info b ON a.ah_patic=b.pif_ic ";
            sSQL += "WHERE (b.pif_name='" + Text_Name.Text + "' OR a.ah_patic='" + Text_IC.Text + "') AND a.ah_date>='" + toDay + "' ";
            sSQL += "ORDER BY ddate";
            DataTable dt = db.Query(sSQL);

            System.Data.DataView dv = dt.DefaultView;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DateTime ddate = Convert.ToDateTime(dt.Rows[i]["ddate"].ToString());
                dv[i]["daytype"]  = GetWeekNo((int)ddate.DayOfWeek);
                dv[i]["timetype"] = set_ctime(dt.Rows[i]["timetype"].ToString());
            }
            Store istore = GridPanel1.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
        }
Пример #7
0
        protected void FILL_BED()
        {
            string   sp_pic = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAAxJREFUGFdj+P//PwAF/gL+pzWBhAAAAABJRU5ErkJggg==";
            DateTime now    = DateTime.Now;

            this.txtTIME.Text = now.ToString("yyyy-MM-dd HH:mm:ss");
            sDATE.Text        = this.txtTIME.Text.Substring(0, 10);
            Show_Week();
            string sSQL = "";

            sSQL = "SELECT P.cln1_diadate FROM clinical1_nurse P WHERE A.cln1_patica=P.cln1_patica AND P.cln1_diadate<>'" + sDATE.Text + "' ORDER BY cln1_diadate DESC LIMIT 1";
            if (Hospital == "Hospital_Henan")
            {
                sSQL  = "SELECT M.mac_bedno AS BED_NO, ";
                sSQL += "N.cln1_col26 AS MAC_MODEL, "; //透析器型號
                sSQL += "IFNULL(N.cln1_col3, M.mac_typ) AS MAC_TYPE, ";
                sSQL += "case UPPER(M.mac_status) when 'Y' then '正常' when 'N' then '保养中' end AS MAC_STATE, ";
                sSQL += "P.pif_name AS PERSON_NAME, ";
                sSQL += "N.cln1_col15 AS PERSON_ID, ";                         //肝素
                sSQL += "IFNULL(N.cln1_col5, V.pv_weight) AS PERSON_WEIGHT, "; //報到體重
                sSQL += "P.pif_ic AS PERSON_IC, IF(STRCMP(N.cln1_col5,''), 'images/tick_16.png', '" + sp_pic + "') as img_url FROM mac_setup M ";
                sSQL += "LEFT JOIN appointment_setup A ON M.mac_flr=A.apptst_flr AND M.mac_sec=A.apptst_sec ";
                sSQL += "AND M.mac_bedno=A.apptst_bed AND A.apptst_daytyp='" + sWEEK.Text + "' AND A.apptst_timetyp='" + sTIME.Text + "' ";
                sSQL += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN general_setup G ON M.mac_brand=G.genst_code AND G.genst_ctg='macbrd' ";
                sSQL += "LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.apptst_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE M.mac_flr='" + sFLOOR.Text + "' AND M.mac_sec='" + sAREA.Text + "' ";
                sSQL += "ORDER BY M.mac_bedno ";
            }
            else if (Hospital == "Hospital_117")
            {
                sSQL  = "SELECT M.mac_bedno AS BED_NO, ";
                sSQL += "G.genst_desc AS MAC_MODEL, "; //透析器型號
                sSQL += "M.mac_typ AS MAC_TYPE, ";
                sSQL += "case UPPER(M.mac_status) when 'Y' then '正常' when 'N' then '保养中' end AS MAC_STATE, ";
                sSQL += "P.pif_name AS PERSON_NAME, ";
                sSQL += "(SELECT R.cln1_col15 FROM clinical1_nurse R WHERE A.apptst_patic=R.cln1_patic AND R.cln1_diadate<>'" + sDATE.Text + "' ";
                sSQL += "ORDER BY R.cln1_diadate DESC LIMIT 1) AS PERSON_ID, "; //肝素
                sSQL += "N.cln1_col5 AS PERSON_WEIGHT, ";                       //報到體重
                sSQL += "P.pif_ic AS PERSON_IC, IF(STRCMP(N.cln1_col5,''), 'images/tick_16.png', '" + sp_pic + "') as img_url FROM mac_setup M ";
                sSQL += "LEFT JOIN appointment_setup A ON M.mac_flr=A.apptst_flr AND M.mac_sec=A.apptst_sec ";
                sSQL += "AND M.mac_bedno=A.apptst_bed AND A.apptst_daytyp='" + sWEEK.Text + "' AND A.apptst_timetyp='" + sTIME.Text + "' ";
                sSQL += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN general_setup G ON M.mac_brand=G.genst_code AND G.genst_ctg='macbrd' ";
                sSQL += "LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.apptst_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE M.mac_flr='" + sFLOOR.Text + "' AND M.mac_sec='" + sAREA.Text + "' ";
                sSQL += "ORDER BY M.mac_bedno ";
            }
            else
            {
                sSQL  = "SELECT M.mac_bedno AS BED_NO, ";
                sSQL += "G.genst_desc AS MAC_MODEL, ";
                sSQL += "IFNULL(N.cln1_col3, M.mac_typ) AS MAC_TYPE, ";
                sSQL += "case UPPER(M.mac_status) when 'Y' then '正常' when 'N' then '保养中' end AS MAC_STATE, ";
                sSQL += "P.pif_name AS PERSON_NAME, A.apptst_patic AS PERSON_ID, ";
                sSQL += "IFNULL(N.cln1_col5, V.pv_weight) AS PERSON_WEIGHT, "; //報到體重
                sSQL += "P.pif_ic AS PERSON_IC, IF(STRCMP(N.cln1_col5,''), 'images/tick_16.png', '" + sp_pic + "') as img_url FROM mac_setup M ";
                sSQL += "LEFT JOIN appointment_setup A ON M.mac_flr=A.apptst_flr AND M.mac_sec=A.apptst_sec ";
                sSQL += "AND M.mac_bedno=A.apptst_bed AND A.apptst_daytyp='" + sWEEK.Text + "' AND A.apptst_timetyp='" + sTIME.Text + "' ";
                sSQL += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN general_setup G ON M.mac_brand=G.genst_code AND G.genst_ctg='macbrd' ";
                sSQL += "LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.apptst_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE M.mac_flr='" + sFLOOR.Text + "' AND M.mac_sec='" + sAREA.Text + "' ";
                sSQL += "ORDER BY M.mac_bedno ";
            }
            DataTable dt = db.Query(sSQL);

            //補上臨時預約
            if (Hospital == "Hospital_Henan")
            {
                sSQL  = "SELECT A.ah_bed, A.ah_patic, A.ah_flr, A.ah_sec, A.ah_timetyp, P.pif_name, V.pv_weight, ";
                sSQL += "P.pif_ic AS PERSON_IC, IF(STRCMP(N.cln1_col5,''), 'images/tick_16.png', '" + sp_pic + "') as img_url, ";
                sSQL += "N.cln1_col26, N.cln1_col15, N.cln1_col5 ";
                sSQL += "FROM appointment_change A ";
                sSQL += "LEFT JOIN pat_info P ON A.ah_patic=P.pif_ic ";
                sSQL += "LEFT JOIN pat_visit V ON A.ah_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.ah_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE ah_date='" + sDATE.Text + "' AND ah_timetyp='" + sTIME.Text + "' ";
            }
            else if (Hospital == "Hospital_117")
            {
                sSQL  = "SELECT A.ah_bed, A.ah_patic, A.ah_flr, A.ah_sec, A.ah_timetyp, P.pif_name, V.pv_weight, ";
                sSQL += "P.pif_ic AS PERSON_IC, IF(STRCMP(N.cln1_col5,''), 'images/tick_16.png', '" + sp_pic + "') as img_url, ";
                sSQL += "N.cln1_col26, N.cln1_col15, N.cln1_col5 ";
                sSQL += "FROM appointment_change A ";
                sSQL += "LEFT JOIN pat_info P ON A.ah_patic=P.pif_ic ";
                sSQL += "LEFT JOIN pat_visit V ON A.ah_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.ah_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE ah_date='" + sDATE.Text + "' AND ah_timetyp='" + sTIME.Text + "' ";
            }
            else
            {
                sSQL  = "SELECT A.ah_bed, A.ah_patic, A.ah_flr, A.ah_sec, A.ah_timetyp, P.pif_name, V.pv_weight, ";
                sSQL += "P.pif_ic AS PERSON_IC, IF(STRCMP(N.cln1_col5,''), 'images/tick_16.png', '" + sp_pic + "') as img_url, ";
                sSQL += "N.cln1_col26, N.cln1_col15, N.cln1_col5 ";
                sSQL += "FROM appointment_change A ";
                sSQL += "LEFT JOIN pat_info P ON A.ah_patic=P.pif_ic ";
                sSQL += "LEFT JOIN pat_visit V ON A.ah_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.ah_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE ah_date='" + sDATE.Text + "' AND ah_timetyp='" + sTIME.Text + "' ";
            }
            DataTable dt2 = db.Query(sSQL);

            System.Data.DataView dv = dt.DefaultView;

            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                dv.RowFilter = "BED_NO='" + dt2.Rows[i]["ah_bed"].ToString() + "' ";
                if (dv.Count > 0)
                {
                    if (Hospital == "Hospital_Henan")
                    {
                        dv[0]["MAC_MODEL"]     = dt2.Rows[i]["cln1_col26"].ToString();
                        dv[0]["PERSON_ID"]     = dt2.Rows[i]["cln1_col15"].ToString();
                        dv[0]["PERSON_WEIGHT"] = dt2.Rows[i]["cln1_col5"].ToString();
                    }
                    else if (Hospital == "Hospital_117")
                    {
                        dv[0]["MAC_MODEL"]     = dt2.Rows[i]["cln1_col26"].ToString();
                        dv[0]["PERSON_ID"]     = dt2.Rows[i]["cln1_col15"].ToString();
                        dv[0]["PERSON_WEIGHT"] = dt2.Rows[i]["cln1_col5"].ToString();
                    }
                    else
                    {
                        dv[0]["PERSON_ID"]     = dt2.Rows[i]["ah_patic"].ToString();
                        dv[0]["PERSON_WEIGHT"] = dt2.Rows[i]["cln1_col5"].ToString();
                    }

                    dv[0]["PERSON_NAME"] = dt2.Rows[i]["pif_name"].ToString();
                    dv[0]["PERSON_IC"]   = dt2.Rows[i]["PERSON_IC"].ToString();
                    dv[0]["img_url"]     = dt2.Rows[i]["img_url"].ToString();
                }
            }

            Session.Add("PAD_TIME", sTIME.Text);
            Session.Add("PAD_FLOOR", sFLOOR.Text);
            Session.Add("PAD_AREA", sAREA.Text);
            ROW_CNT.Text = dt.Rows.Count.ToString();
            Store istore = grdBED_LIST.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
        }
        protected void FILL_BED()
        {
            //if (GetComboBoxValu(this.cboFLOOR) != "")
            //    sFLOOR.Text = GetComboBoxValu(this.cboFLOOR);
            //if (GetComboBoxValu(this.cboAREA) != "")
            //    sAREA.Text = GetComboBoxValu(this.cboAREA);
            DateTime now = DateTime.Now;

            //this.txtDATE.Text = now.ToString("yyyy-MM-dd");
            this.txtTIME.Text = now.ToString("yyyy-MM-dd HH:mm:ss");
            //sDATE.Text = this.txtDATE.Text;
            sDATE.Text = this.txtTIME.Text.Substring(0, 10);
            GET_WEEK();
            string sSQL = "";

            sSQL = "SELECT M.mac_bedno AS BED_NO, G.genst_desc AS MAC_MODEL, M.mac_typ AS MAC_TYPE, M.mac_status AS MAC_STATE, " +
                   "P.pif_name AS PERSON_NAME, A.apptst_patic AS PERSON_ID, " +
                   "V.pv_weight AS PERSON_WEIGHT, V.pv_macstat AS PERSON_STATE " +

                   "FROM mac_setup M " +
                   "LEFT JOIN appointment_setup A " +
                   "ON M.mac_flr=A.apptst_flr " +
                   "AND M.mac_sec=A.apptst_sec " +
                   "AND M.mac_bedno=A.apptst_bed " +
                   "AND A.apptst_daytyp='" + sWEEK.Text + "' " +
                   "AND A.apptst_timetyp='" + sTIME.Text + "' " +
                   "LEFT JOIN pat_visit V " +
                   "ON A.apptst_patic=V.pv_ic " +
                   "AND V.pv_datevisit='" + sDATE.Text + "' " +
                   "LEFT JOIN general_setup G " +
                   "ON M.mac_brand=G.genst_code " +
                   "AND G.genst_ctg='macbrd' " +
                   "LEFT JOIN pat_info P " +
                   "ON A.apptst_patic=P.pif_ic " +
                   "WHERE M.mac_flr='" + sFLOOR.Text + "' " +
                   "AND M.mac_sec='" + sAREA.Text + "' " +
                   "ORDER BY CONVERT(SUBSTRING_INDEX(M.mac_bedno, '-', 1),UNSIGNED INTEGER), M.mac_bedno ";
            //                "AND M.mac_sec='" + sAREA.Text + "' " +
            DBMysql db = new DBMysql();

            System.Data.DataTable dt = db.Query(sSQL);

            //補上臨時預約 2015.03.26 ANDY 暫MARK
            sSQL = "SELECT A.ah_bed, A.ah_patic, A.ah_flr, A.ah_sec, " +
                   "A.ah_bed, A.ah_timetyp, P.pif_name, " +
                   "V.pv_weight, V.pv_macstat " +
                   "FROM appointment_change A " +
                   "LEFT JOIN pat_info P " +
                   "ON A.ah_patic=P.pif_ic " +
                   "LEFT JOIN pat_visit V " +
                   "ON A.ah_patic=V.pv_ic " +
                   "AND V.pv_datevisit='" + sDATE.Text + "' " +
                   "WHERE ah_date='" + sDATE.Text + "' " +
                   "AND ah_timetyp='" + sTIME.Text + "' ";
            System.Data.DataTable dt2 = db.Query(sSQL);
            System.Data.DataView  dv  = dt.DefaultView;


            //Column5.Text = sDATE.Text;
            Column5.Text = "25";


            //2015.01.07 這裡是臨時預約跟換床沒關 先把flag旗標關閉
            //bool changeFlag = false;

            //2014.01.05 Frank  開始點名換床的人
            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                dv.RowFilter = "PERSON_ID='" + dt2.Rows[i]["ah_patic"].ToString() + "' ";
                if (dv.Count > 0)
                {
                    dv[0]["PERSON_NAME"]   = "";
                    dv[0]["PERSON_WEIGHT"] = "";
                    dv[0]["PERSON_STATE"]  = "";
                    dv[0]["PERSON_ID"]     = "";
                    //2015.01.07 這裡是臨時預約跟換床沒關 先把flag旗標關閉
                    //changeFlag = true;
                }

                dv.RowFilter = "BED_NO='" + dt2.Rows[i]["ah_bed"].ToString() + "' ";
                if (dv.Count > 0)
                {
                    dv[0]["PERSON_ID"] = dt2.Rows[i]["ah_patic"].ToString();
                    //2015.01.07 這裡是臨時預約跟換床沒關 先把flag旗標關閉
                    //if (changeFlag)
                    //dv[0]["PERSON_NAME"] = dt2.Rows[i]["pif_name"].ToString() + "";
                    //2015.01.07 這裡是臨時預約跟換床沒關 先把flag旗標關閉
                    //else

                    //    dv[0]["PERSON_NAME"] = dt2.Rows[i]["pif_name"].ToString() + "(临)";
                    dv[0]["PERSON_NAME"] = dt2.Rows[i]["pif_name"].ToString();

                    dv[0]["PERSON_WEIGHT"] = dt2.Rows[i]["pv_weight"].ToString();
                    dv[0]["PERSON_STATE"]  = dt2.Rows[i]["pv_macstat"].ToString();
                }
            }

            Session.Add("PAD_TIME", sTIME.Text);
            Session.Add("PAD_FLOOR", sFLOOR.Text);
            Session.Add("PAD_AREA", sAREA.Text);
            ROW_CNT.Text = dt.Rows.Count.ToString();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                switch (dt.Rows[i]["PERSON_STATE"].ToString())
                {
                case "A":
                    dt.Rows[i]["PERSON_STATE"] = "开";
                    break;

                case "S":
                    dt.Rows[i]["PERSON_STATE"] = "关";
                    break;
                }
                switch (dt.Rows[i]["MAC_STATE"].ToString())
                {
                case "Y":
                    dt.Rows[i]["MAC_STATE"] = "正常";
                    break;

                case "y":
                    dt.Rows[i]["MAC_STATE"] = "正常";
                    break;

                case "N":
                    dt.Rows[i]["MAC_STATE"] = "保养中";
                    break;

                case "n":
                    dt.Rows[i]["MAC_STATE"] = "保养中";
                    break;
                }
            }
            dt.AcceptChanges();
            Store istore = grdBED_LIST.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
        }
Пример #9
0
        protected void FILL_BED()
        {
            GetWeek();
            string sSQL = "";

            sSQL  = "SELECT M.mac_sec AS AREA, M.mac_bedno AS BED_NO, ";
            sSQL += "REPLACE(P.pif_imgloc,'./','" + Myhaisv4 + "') AS url, ";
            sSQL += "CASE ";
            sSQL += "WHEN EXISTS(SELECT R.cln1_col26 FROM clinical1_nurse R WHERE A.apptst_patic=R.cln1_patic AND R.cln1_diadate='" + txtDate.Text + "') ";
            sSQL += "THEN (SELECT R.cln1_col26 FROM clinical1_nurse R WHERE A.apptst_patic=R.cln1_patic AND R.cln1_diadate='" + txtDate.Text + "') ";
            sSQL += "ELSE (SELECT cln1_col2 FROM clinical1_doc_henan WHERE cln1_patic=A.apptst_patic AND cln1_diadate='base') ";
            sSQL += "END AS MAC_MODEL, ";
            sSQL += "M.mac_typ AS MAC_TYPE, ";
            sSQL += "case UPPER(M.mac_status) when 'Y' then '正常' when 'N' then '保养中' end AS MAC_STATE, ";
            sSQL += "P.pif_name AS PERSON_NAME, A.apptst_patic AS PERSON_ID, ";
            sSQL += "case P.pif_sex when 'M' then '男' when 'F' then '女' end as PERSON_SEX, ";
            sSQL += "P.pif_height AS PERSON_HEIGHT, ";
            sSQL += "N.cln1_col5 AS PERSON_WEIGHT, ";
            sSQL += "case V.pv_macstat when 'A' then '开' when 'S' then '关' end as PERSON_STATE ";
            sSQL += "FROM mac_setup M ";
            sSQL += "LEFT JOIN appointment_setup A ON M.mac_flr=A.apptst_flr ";
            sSQL += "AND M.mac_sec=A.apptst_sec AND M.mac_bedno=A.apptst_bed AND A.apptst_daytyp='" + sWEEK.Text + "' AND A.apptst_timetyp='" + sTIME.Text + "' ";
            sSQL += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + txtDate.Text + "' ";
            sSQL += "LEFT JOIN general_setup G ON M.mac_brand=G.genst_code AND G.genst_ctg='macbrd' ";
            sSQL += "LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic ";
            sSQL += "LEFT JOIN clinical1_nurse N ON A.apptst_patic=N.cln1_patic AND N.cln1_diadate='" + txtDate.Text + "' "; //淨化參數表格
            sSQL += "WHERE M.mac_flr='" + sFLOOR.Text + "' AND A.apptst_patic<>'' ";
            if (sAREA.Text.Trim() != "全区")
            {
                sSQL += "AND M.mac_sec='" + sAREA.Text + "' ";
            }
            sSQL += "ORDER BY M.mac_bedno  ";
            DataTable dt = db.Query(sSQL);

            //補上臨時預約
            sSQL  = "SELECT A.ah_bed, A.ah_patic, A.ah_flr, A.ah_sec, A.ah_bed, A.ah_timetyp, P.pif_name, ";
            sSQL += "case P.pif_sex when 'M' then '男' when 'F' then '女' end as PERSON_SEX, ";
            sSQL += "P.pif_height, V.pv_weight, ";
            sSQL += "case V.pv_macstat when 'A' then '开' when 'S' then '关' end as PERSON_STATE, ";
            sSQL += "N.cln1_col5 ";
            sSQL += "FROM appointment_change A ";
            sSQL += "LEFT JOIN pat_info P ON A.ah_patic=P.pif_ic ";
            sSQL += "LEFT JOIN pat_visit V ON A.ah_patic=V.pv_ic AND V.pv_datevisit='" + txtDate.Text + "' ";
            sSQL += "LEFT JOIN clinical1_nurse N ON A.ah_patic=N.cln1_patic AND N.cln1_diadate='" + txtDate.Text + "' "; //淨化參數表格
            sSQL += "WHERE ah_date='" + txtDate.Text + "' AND ah_timetyp='" + sTIME.Text + "' AND A.ah_patic<>'' ";
            if (sAREA.Text.Trim() != "全区")
            {
                sSQL += "AND M.mac_sec='" + sAREA.Text + "' ";
            }
            DataTable dt2 = db.Query(sSQL);

            System.Data.DataView dv = dt.DefaultView;

            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                dv.RowFilter = "PERSON_ID='" + dt2.Rows[i]["ah_patic"].ToString() + "' ";
                if (dv.Count > 0)
                {
                    dv[0]["PERSON_NAME"]   = "";
                    dv[0]["PERSON_WEIGHT"] = "";
                    dv[0]["PERSON_STATE"]  = "";
                    dv[0]["PERSON_ID"]     = "";
                    dv[0]["PERSON_HEIGHT"] = "";
                    dv[0]["PERSON_SEX"]    = "";
                }

                dv.RowFilter = "BED_NO='" + dt2.Rows[i]["ah_bed"].ToString() + "' ";
                if (dv.Count > 0)
                {
                    dv[0]["PERSON_NAME"]   = dt2.Rows[i]["pif_name"].ToString();
                    dv[0]["PERSON_WEIGHT"] = dt2.Rows[i]["cln1_col5"].ToString();
                    dv[0]["PERSON_STATE"]  = dt2.Rows[i]["PERSON_STATE"].ToString();
                    dv[0]["PERSON_ID"]     = dt2.Rows[i]["ah_patic"].ToString();
                    dv[0]["PERSON_SEX"]    = dt2.Rows[i]["PERSON_SEX"].ToString();
                    dv[0]["PERSON_HEIGHT"] = dt2.Rows[i]["pif_height"].ToString();
                }
            }

            Session.Add("PAD_TIME", sTIME.Text);
            Session.Add("PAD_FLOOR", sFLOOR.Text);
            Session.Add("PAD_AREA", sAREA.Text);
            ROW_CNT.Text = dt.Rows.Count.ToString();
            Store istore = ImageView.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
        }
Пример #10
0
        protected void FILL_BED()
        {
            DateTime now = DateTime.Now;

            this.txtTIME.Text = now.ToString("yyyy-MM-dd HH:mm:ss");
            sDATE.Text        = this.txtTIME.Text.Substring(0, 10);
            Show_Week();
            string sSQL = "";

            sSQL = "SELECT P.cln1_diadate FROM clinical1_nurse P WHERE A.cln1_patica=P.cln1_patica AND P.cln1_diadate<>'" + sDATE.Text + "' ORDER BY cln1_diadate DESC LIMIT 1";
            if (Hospital == "Hospital_Henan")
            {
                sSQL  = "SELECT M.mac_bedno AS BED_NO, ";
                sSQL += "N.cln1_col26 AS MAC_MODEL, "; //透析器型號
                sSQL += "IFNULL(N.cln1_col3, M.mac_typ) AS MAC_TYPE, ";
                sSQL += "case UPPER(M.mac_status) when 'Y' then '正常' when 'N' then '保养中' end AS MAC_STATE, ";
                sSQL += "P.pif_name AS PERSON_NAME, ";
                sSQL += "N.cln1_col15 AS PERSON_ID, ";                         //肝素
                sSQL += "IFNULL(N.cln1_col5, V.pv_weight) AS PERSON_WEIGHT, "; //報到體重
                sSQL += "case V.pv_macstat when 'A' then '开' when 'S' then '关' end As PERSON_STATE, P.pif_ic AS PERSON_IC FROM mac_setup M ";
                sSQL += "LEFT JOIN appointment_setup A ON M.mac_flr=A.apptst_flr AND M.mac_sec=A.apptst_sec ";
                sSQL += "AND M.mac_bedno=A.apptst_bed AND A.apptst_daytyp='" + sWEEK.Text + "' AND A.apptst_timetyp='" + sTIME.Text + "' ";
                sSQL += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN general_setup G ON M.mac_brand=G.genst_code AND G.genst_ctg='macbrd' ";
                sSQL += "LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.apptst_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE M.mac_flr='" + sFLOOR.Text + "' AND M.mac_sec='" + sAREA.Text + "' ";
                sSQL += "ORDER BY M.mac_bedno ";
            }
            else if (Hospital == "Hospital_117")
            {
                sSQL  = "SELECT M.mac_bedno AS BED_NO, ";
                sSQL += "G.genst_desc AS MAC_MODEL, "; //透析器型號
                sSQL += "M.mac_typ AS MAC_TYPE, ";
                sSQL += "case UPPER(M.mac_status) when 'Y' then '正常' when 'N' then '保养中' end AS MAC_STATE, ";
                sSQL += "P.pif_name AS PERSON_NAME, ";
                sSQL += "(SELECT R.cln1_col15 FROM clinical1_nurse R WHERE A.apptst_patic=R.cln1_patic AND R.cln1_diadate<>'" + sDATE.Text + "' ";
                sSQL += "ORDER BY R.cln1_diadate DESC LIMIT 1) AS PERSON_ID, "; //肝素
                sSQL += "N.cln1_col5 AS PERSON_WEIGHT, ";                       //報到體重
                sSQL += "case V.pv_macstat when 'A' then '开' when 'S' then '关' end as PERSON_STATE, P.pif_ic AS PERSON_IC FROM mac_setup M ";
                sSQL += "LEFT JOIN appointment_setup A ON M.mac_flr=A.apptst_flr AND M.mac_sec=A.apptst_sec ";
                sSQL += "AND M.mac_bedno=A.apptst_bed AND A.apptst_daytyp='" + sWEEK.Text + "' AND A.apptst_timetyp='" + sTIME.Text + "' ";
                sSQL += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN general_setup G ON M.mac_brand=G.genst_code AND G.genst_ctg='macbrd' ";
                sSQL += "LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.apptst_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE M.mac_flr='" + sFLOOR.Text + "' AND M.mac_sec='" + sAREA.Text + "' ";
                sSQL += "ORDER BY M.mac_bedno ";
            }
            else
            {
                sSQL  = "SELECT M.mac_bedno AS BED_NO, ";
                sSQL += "G.genst_desc AS MAC_MODEL, ";
                sSQL += "IFNULL(N.cln1_col3, M.mac_typ) AS MAC_TYPE, ";
                sSQL += "case UPPER(M.mac_status) when 'Y' then '正常' when 'N' then '保养中' end AS MAC_STATE, ";
                sSQL += "P.pif_name AS PERSON_NAME, A.apptst_patic AS PERSON_ID, ";
                sSQL += "IFNULL(N.cln1_col5, V.pv_weight) AS PERSON_WEIGHT, "; //報到體重
                sSQL += "case V.pv_macstat when 'A' then '开' when 'S' then '关' end as PERSON_STATE, P.pif_ic AS PERSON_IC FROM mac_setup M ";
                sSQL += "LEFT JOIN appointment_setup A ON M.mac_flr=A.apptst_flr AND M.mac_sec=A.apptst_sec ";
                sSQL += "AND M.mac_bedno=A.apptst_bed AND A.apptst_daytyp='" + sWEEK.Text + "' AND A.apptst_timetyp='" + sTIME.Text + "' ";
                sSQL += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN general_setup G ON M.mac_brand=G.genst_code AND G.genst_ctg='macbrd' ";
                sSQL += "LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.apptst_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE M.mac_flr='" + sFLOOR.Text + "' AND M.mac_sec='" + sAREA.Text + "' ";
                sSQL += "ORDER BY M.mac_bedno ";
            }
            DataTable dt = db.Query(sSQL);

            //補上臨時預約
            if (Hospital == "Hospital_Henan")
            {
                sSQL  = "SELECT A.ah_bed, A.ah_patic, A.ah_flr, A.ah_sec, A.ah_timetyp, P.pif_name, V.pv_weight, ";
                sSQL += "case V.pv_macstat when 'A' then '开' when 'S' then '关' end as PERSON_STATE, P.pif_ic AS PERSON_IC, ";
                sSQL += "N.cln1_col26, N.cln1_col15, N.cln1_col5 ";
                sSQL += "FROM appointment_change A ";
                sSQL += "LEFT JOIN pat_info P ON A.ah_patic=P.pif_ic ";
                sSQL += "LEFT JOIN pat_visit V ON A.ah_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.ah_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE ah_date='" + sDATE.Text + "' AND ah_timetyp='" + sTIME.Text + "' ";
            }
            else if (Hospital == "Hospital_117")
            {
                sSQL  = "SELECT A.ah_bed, A.ah_patic, A.ah_flr, A.ah_sec, A.ah_timetyp, P.pif_name, V.pv_weight, ";
                sSQL += "case V.pv_macstat when 'A' then '开' when 'S' then '关' end as PERSON_STATE, P.pif_ic AS PERSON_IC, ";
                sSQL += "N.cln1_col26, N.cln1_col15, N.cln1_col5 ";
                sSQL += "FROM appointment_change A ";
                sSQL += "LEFT JOIN pat_info P ON A.ah_patic=P.pif_ic ";
                sSQL += "LEFT JOIN pat_visit V ON A.ah_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.ah_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE ah_date='" + sDATE.Text + "' AND ah_timetyp='" + sTIME.Text + "' ";
            }
            else
            {
                sSQL  = "SELECT A.ah_bed, A.ah_patic, A.ah_flr, A.ah_sec, A.ah_timetyp, P.pif_name, V.pv_weight, ";
                sSQL += "case V.pv_macstat when 'A' then '开' when 'S' then '关' end as PERSON_STATE, P.pif_ic AS PERSON_IC, ";
                sSQL += "N.cln1_col26, N.cln1_col15, N.cln1_col5 ";
                sSQL += "FROM appointment_change A ";
                sSQL += "LEFT JOIN pat_info P ON A.ah_patic=P.pif_ic ";
                sSQL += "LEFT JOIN pat_visit V ON A.ah_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.ah_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE ah_date='" + sDATE.Text + "' AND ah_timetyp='" + sTIME.Text + "' ";
            }
            DataTable dt2 = db.Query(sSQL);

            System.Data.DataView dv = dt.DefaultView;

            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                dv.RowFilter = "BED_NO='" + dt2.Rows[i]["ah_bed"].ToString() + "' ";
                if (dv.Count > 0)
                {
                    if (Hospital == "Hospital_Henan")
                    {
                        dv[0]["MAC_MODEL"]     = dt2.Rows[i]["cln1_col26"].ToString();
                        dv[0]["PERSON_ID"]     = dt2.Rows[i]["cln1_col15"].ToString();
                        dv[0]["PERSON_WEIGHT"] = dt2.Rows[i]["cln1_col5"].ToString();
                    }
                    else if (Hospital == "Hospital_117")
                    {
                        dv[0]["MAC_MODEL"]     = dt2.Rows[i]["cln1_col26"].ToString();
                        dv[0]["PERSON_ID"]     = dt2.Rows[i]["cln1_col15"].ToString();
                        dv[0]["PERSON_WEIGHT"] = dt2.Rows[i]["cln1_col5"].ToString();
                    }
                    else
                    {
                        dv[0]["PERSON_ID"]     = dt2.Rows[i]["ah_patic"].ToString();
                        dv[0]["PERSON_WEIGHT"] = dt2.Rows[i]["cln1_col5"].ToString();
                    }

                    dv[0]["PERSON_NAME"]  = dt2.Rows[i]["pif_name"].ToString();
                    dv[0]["PERSON_STATE"] = dt2.Rows[i]["PERSON_STATE"].ToString();
                    dv[0]["PERSON_IC"]    = dt2.Rows[i]["PERSON_IC"].ToString();
                }
            }

            Session.Add("PAD_TIME", sTIME.Text);
            Session.Add("PAD_FLOOR", sFLOOR.Text);
            Session.Add("PAD_AREA", sAREA.Text);
            ROW_CNT.Text = dt.Rows.Count.ToString();
            Store istore = grdBED_LIST.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
        }
Пример #11
0
        protected void FILL_BED()
        {
            GetWeek();
            string sSQL = "";

            sSQL = "SELECT P.cln1_diadate FROM clinical1_nurse P WHERE A.cln1_patica=P.cln1_patica AND P.cln1_diadate<>'" + sDATE.Text + "' ORDER BY cln1_diadate DESC LIMIT 1";
            if (sProcessOfPurifyingTheBlood == "Hospital_Henan")
            {
                sSQL  = "SELECT CONCAT(M.mac_sec,'-',M.mac_bedno) AS BED_NO, ";
                sSQL += "N.cln1_col26 AS MAC_MODEL, "; //透析器型號
                sSQL += "M.mac_typ AS MAC_TYPE, ";
                sSQL += "case UPPER(M.mac_status) when 'Y' then '正常' when 'N' then '保养中' end AS MAC_STATE, ";
                sSQL += "P.pif_name AS PERSON_NAME, ";
                sSQL += "N.cln1_col15 AS cln1_col15, "; //肝素
                sSQL += "N.cln1_col13 AS cln1_col13 FROM mac_setup M ";
                sSQL += "LEFT JOIN appointment_setup A ON M.mac_flr=A.apptst_flr AND M.mac_sec=A.apptst_sec ";
                sSQL += "AND M.mac_bedno=A.apptst_bed AND A.apptst_daytyp='" + sWEEK.Text + "' AND A.apptst_timetyp='" + sTIME.Text + "' ";
                sSQL += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN general_setup G ON M.mac_brand=G.genst_code AND G.genst_ctg='macbrd' ";
                sSQL += "LEFT JOIN pat_info P ON A.apptst_patic=P.pif_ic ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.apptst_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE M.mac_flr='" + sFLOOR.Text + "' ";
                if (sAREA.Text.Trim() != "全区")
                {
                    sSQL += "AND M.mac_sec='" + sAREA.Text + "' ";
                }
                sSQL += "ORDER BY M.mac_bedno  ";
            }
            DataTable dt = db.Query(sSQL);

            //補上臨時預約
            if (sProcessOfPurifyingTheBlood == "Hospital_Henan")
            {
                sSQL  = "SELECT CONCAT(A.ah_sec,'-',A.ah_bed), A.ah_patic, A.ah_flr, A.ah_sec, A.ah_timetyp, P.pif_name, V.pv_weight, ";
                sSQL += "N.cln1_col26, N.cln1_col15, N.cln1_col13 ";
                sSQL += "FROM appointment_change A ";
                sSQL += "LEFT JOIN pat_info P ON A.ah_patic=P.pif_ic ";
                sSQL += "LEFT JOIN pat_visit V ON A.ah_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
                sSQL += "LEFT JOIN clinical1_nurse N ON A.ah_patic=N.cln1_patic AND N.cln1_diadate='" + sDATE.Text + "' "; //淨化參數表格
                sSQL += "WHERE ah_date='" + sDATE.Text + "' AND ah_timetyp='" + sTIME.Text + "' ";
                if (sAREA.Text.Trim() != "全区")
                {
                    sSQL += "AND M.mac_sec='" + sAREA.Text + "' ";
                }
            }
            DataTable dt2 = db.Query(sSQL);

            System.Data.DataView dv = dt.DefaultView;

            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                dv.RowFilter = "PERSON_ID='" + dt2.Rows[i]["ah_patic"].ToString() + "' ";
                if (dv.Count > 0)
                {
                    dv[0]["PERSON_NAME"] = "";
                }

                dv.RowFilter = "BED_NO='" + dt2.Rows[i]["ah_bed"].ToString() + "' ";
                if (dv.Count > 0)
                {
                    if (sProcessOfPurifyingTheBlood == "Hospital_Henan")
                    {
                        dv[0]["MAC_MODEL"]   = dt2.Rows[i]["cln1_col26"].ToString();
                        dv[0]["PERSON_NAME"] = dt2.Rows[i]["pif_name"].ToString();
                        dv[0]["cln1_col15"]  = dt2.Rows[i]["cln1_col15"].ToString();
                        dv[0]["cln1_col13"]  = dt2.Rows[i]["cln1_col13"].ToString();
                    }
                }
            }

            Session.Add("PAD_TIME", sTIME.Text);
            Session.Add("PAD_FLOOR", sFLOOR.Text);
            Session.Add("PAD_AREA", sAREA.Text);
            ROW_CNT.Text = dt.Rows.Count.ToString();
            Store istore = grdBED_LIST.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
        }