Ejemplo n.º 1
0
        protected void BtnQuery_Click(object sender, DirectEventArgs e)
        {
            string sql = "SELECT a.pif_ic, b.apptst_patrefid, b.apptst_flr, b.apptst_sec, b.apptst_bed, b.apptst_mactyp, b.apptst_wktyp, b.apptst_daytyp, b.apptst_timetyp FROM pat_info a ";

            sql += "LEFT JOIN appointment_setup b ON a.pif_ic=b.apptst_patic ";
            sql += "WHERE pif_mrn='" + TextQuery.Text + "' ";
            sql += "AND b.apptst_flr='" + sFLOOR.Text + "' ";
            sql += "AND b.apptst_timetyp='" + sTIME.Text + "' ";
            sql += "AND b.apptst_daytyp='" + sWEEK.Text + "'";
            DataTable dt = db.Query(sql);

            if (dt.Rows.Count > 0)
            {
                string pid     = dt.Rows[0]["pif_ic"].ToString();
                string pname   = dt.Rows[0]["apptst_patrefid"].ToString();
                string bedno   = dt.Rows[0]["apptst_bed"].ToString();
                string mactype = dt.Rows[0]["apptst_mactyp"].ToString();
                string area    = dt.Rows[0]["apptst_sec"].ToString();
                Common._NotificationShow("开始报到");
                string url = "Patient_detail.aspx?personid=" + pid + "&patient_name=" + pname + "&machine_type=" + mactype + "&floor=" + sFLOOR.Text;
                url += "&area=" + area + "&time=" + sTIME.Text + "&bedno=" + bedno + "&daytyp=" + sWEEK.Text + "&sdate=" + sDATE.Text;
                X.Redirect(url);
            }
            else
            {
                Common._NotificationShow("查无此人或已逾时" + TextQuery.Text);
            }
            TextQuery.Text = "";
            TextQuery.Focus(false, 100);
        }
Ejemplo n.º 2
0
        protected new void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                if (Session["USER_NAME"] == null || Session["USER_RIGHT"] == null)
                {
                    X.Redirect("../login.aspx");
                }
                else
                {
                    if (Session["sDATE"] == null)
                    {
                        DateTime now = DateTime.Now;
                        sDATE.Text = now.ToString("yyyy-MM-dd");
                    }
                    else
                    {
                        sDATE.Text = Session["sDATE"].ToString();
                    }
                    GetWeek();
                    Label1.Text = sDATE.Text + " " + txtWEEK.Text;

                    Show_TimeSec();   //顯示時段
                    Show_FloorArea(); //顯示樓層,床區
                    TextQuery.Focus(true, 100);
                }
            }
        }
Ejemplo n.º 3
0
        protected void Show_Checkin()
        {
            sDATE.Text = DateTime.Now.ToString("yyyy-MM-dd");
            GetWeek();
            Label_Date.Text = sDATE.Text + " " + txtWEEK.Text;

            Show_TimeSec();   //顯示時段
            Show_FloorArea(); //顯示樓層,床區
            FormPanel2.Enabled = true;
            TextQuery.Focus(true, 100);
        }
Ejemplo n.º 4
0
        protected void BtnQuery_Click(object sender, DirectEventArgs e)
        {
            string sql = "SELECT a.pif_ic, b.apptst_patrefid, b.apptst_flr, b.apptst_sec, b.apptst_bed, b.apptst_mactyp, b.apptst_wktyp, b.apptst_daytyp, b.apptst_timetyp FROM pat_info a ";

            sql += "LEFT JOIN appointment_setup b ON a.pif_ic=b.apptst_patic ";
            sql += "WHERE pif_mrn='" + TextQuery.Text + "' ";
            sql += "AND b.apptst_flr='" + sFLOOR.Text + "' ";
            sql += "AND b.apptst_timetyp='" + sTIME.Text + "' ";
            sql += "AND b.apptst_daytyp='" + sWEEK.Text + "'";
            DataTable dt = db.Query(sql);

            if (dt.Rows.Count > 0)
            {
                string pid     = dt.Rows[0]["pif_ic"].ToString();
                string pname   = dt.Rows[0]["apptst_patrefid"].ToString();
                string bedno   = dt.Rows[0]["apptst_bed"].ToString();
                string mactype = dt.Rows[0]["apptst_mactyp"].ToString();
                string area    = dt.Rows[0]["apptst_sec"].ToString();
                Common._NotificationShow("开始报到");
                string url = "checkin/Patient_detail.aspx?personid=" + pid + "&patient_name=" + pname + "&machine_type=" + mactype + "&floor=" + sFLOOR.Text;
                url += "&area=" + area + "&time=" + sTIME.Text + "&bedno=" + bedno + "&daytyp=" + sWEEK.Text + "&sdate=" + sDATE.Text;

                _PAT_IC            = pid;
                Session["PAT_IC"]  = pid;
                _PIF_NAME          = pname;
                _USER_NAME         = Session["USER_NAME"].ToString();
                FormPanel2.Enabled = false;

                Panel_Loader1.Hidden = false;
                Panel_Loader2.Hidden = true;
                Panel_Loader3.Hidden = true;
                Store istore = grdBED_LIST.GetStore();
                istore.RemoveAll();

                Panel_Loader1.Loader.SuspendScripting();
                Panel_Loader1.Loader.Url            = url;
                Panel_Loader1.Loader.DisableCaching = true;
                Panel_Loader1.LoadContent();
                Refreach_Label();
            }
            else
            {
                Common._NotificationShow("查无此人或已逾时" + TextQuery.Text);
            }
            TextQuery.Text = "";
            TextQuery.Focus(false, 100);
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                if (Session["USER_NAME"] == null || Session["USER_RIGHT"] == null)
                {
                    X.Redirect("index.aspx");
                }
                else
                {
                    if (Session["USER_RIGHT"].ToString() != "DC" && Session["USER_RIGHT"].ToString() != "DH")
                    {
                        Session["USER_RIGHT"] = "";
                        X.Redirect("index.aspx");
                    }
                }


                if (Session["sDATE"] == null)
                {
                    if (Request.QueryString["sdate"] != null)
                    {
                        txtTIME.Text = Request.QueryString["sdate"];
                    }
                    else
                    {
                        DateTime now = DateTime.Now;
                        txtTIME.Text = now.ToString("yyyy-MM-dd");
                    }
                    sDATE.Text = DateTime.Parse(txtTIME.Text).ToString("yyyy-MM-dd");
                }
                else
                {
                    sDATE.Text   = Session["sDATE"].ToString();
                    txtTIME.Text = sDATE.Text;
                }

                //txtTIME日期
                Show_TimeSec();   //顯示時段
                //Show_Week(); //顯示星期
                Show_FloorArea(); //顯示樓層,床區
                TextQuery.Focus(true, 100);
            }
        }
Ejemplo n.º 6
0
 protected void cboFLOOR_Click(object sender, DirectEventArgs e)
 {
     sFLOOR.Text = Common.GetComboBoxValue(this.cboFLOOR);
     FILL_BED();
     TextQuery.Focus(false, 100);
 }
Ejemplo n.º 7
0
        protected void FILL_BED()
        {
            string sp_pic = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAAxJREFUGFdj+P//PwAF/gL+pzWBhAAAAABJRU5ErkJggg==";

            GetWeek();
            string sSQL = "";

            sSQL  = "SELECT M.mac_sec AS AREA, M.mac_bedno AS BED_NO, ";
            sSQL += "CASE ";
            sSQL += "WHEN EXISTS(SELECT R.cln1_col26 FROM clinical1_nurse R WHERE A.apptst_patic=R.cln1_patic AND R.cln1_diadate='" + sDATE.Text + "') ";
            sSQL += "THEN (SELECT R.cln1_col26 FROM clinical1_nurse R WHERE A.apptst_patic=R.cln1_patic AND R.cln1_diadate='" + sDATE.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_IC, ";
            sSQL += "case P.pif_sex when 'M' then '男' when 'F' then '女' end as PERSON_SEX, ";
            sSQL += "P.pif_height AS PERSON_HEIGHT, ";
            sSQL += "IFNULL(N.cln1_col5, V.pv_weight) AS PERSON_WEIGHT, ";
            sSQL += "IF(STRCMP(N.cln1_col5,''), 'images/tick_16.png', '" + sp_pic + "') as img_url, ";
            sSQL += "case V.pv_macstat when '' then '" + sp_pic + "' when 'A' then 'images/start_16.png' when 'S' then 'images/stop_16.png' end as PERSON_STATE, ";
            sSQL += "P.pif_id AS PERSON_ID ";
            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_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 += "LEFT JOIN general_setup G ON M.mac_brand=G.genst_code AND G.genst_ctg='macbrd' ";
            sSQL += "LEFT JOIN pat_visit V ON A.apptst_patic=V.pv_ic AND V.pv_datevisit='" + sDATE.Text + "' ";
            sSQL += "WHERE M.mac_flr='" + sFLOOR.Text + "' ";
            if (cb_patlist.Text != "")
            {
                sSQL += "AND P.pif_name LIKE '" + cb_patlist.Text + "%' ";
            }
            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 AS PERSON_IC, A.ah_flr, A.ah_sec, A.ah_bed, A.ah_timetyp, P.pif_name AS PERSON_NAME, ";
            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 += "IF(STRCMP(N.cln1_col5,''), 'images/tick_16.png', '" + sp_pic + "') as img_url, ";
            sSQL += "case V.pv_macstat when '' then '" + sp_pic + "' when 'A' then 'images/start_16.png' when 'S' then 'images/stop_16.png' end as PERSON_STATE, ";
            sSQL += "CASE ";
            sSQL += "WHEN EXISTS(SELECT R.cln1_col26 FROM clinical1_nurse R WHERE A.ah_patic=R.cln1_patic AND R.cln1_diadate='" + sDATE.Text + "') ";
            sSQL += "THEN (SELECT R.cln1_col26 FROM clinical1_nurse R WHERE A.ah_patic=R.cln1_patic AND R.cln1_diadate='" + sDATE.Text + "') ";
            sSQL += "ELSE (SELECT cln1_col2 FROM clinical1_doc_henan WHERE A.ah_patic=cln1_patic AND cln1_diadate='base') ";
            sSQL += "END AS MAC_MODEL, ";
            sSQL += "P.pif_id AS PERSON_ID ";
            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);

            if (dt2.Rows.Count > 0)
            {
                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 (dt2.Rows[i]["PERSON_ID"].ToString() != "")
                        {
                            dv[0]["PERSON_ID"] = dt2.Rows[i]["PERSON_ID"].ToString();
                        }
                        dv[0]["PERSON_IC"]     = dt2.Rows[i]["PERSON_IC"].ToString();
                        dv[0]["PERSON_NAME"]   = dt2.Rows[i]["PERSON_NAME"].ToString();
                        dv[0]["PERSON_SEX"]    = dt2.Rows[i]["PERSON_SEX"].ToString();
                        dv[0]["PERSON_HEIGHT"] = dt2.Rows[i]["PERSON_HEIGHT"].ToString();
                        dv[0]["PERSON_WEIGHT"] = dt2.Rows[i]["PERSON_WEIGHT"].ToString();
                        dv[0]["PERSON_STATE"]  = dt2.Rows[i]["PERSON_STATE"].ToString();
                        dv[0]["img_url"]       = dt2.Rows[i]["img_url"].ToString();
                        dv[0]["PERSON_STATE"]  = dt2.Rows[i]["PERSON_STATE"].ToString();
                        dv[0]["MAC_MODEL"]     = dt2.Rows[i]["MAC_MODEL"].ToString();
                    }
                }
            }

            if (CheckinEmpty == "false")
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows[i]["PERSON_NAME"].ToString() == "")
                    {
                        dt.Rows[i].Delete();
                    }
                }
                dt.AcceptChanges();
            }
            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();

            TextQuery.Focus(false, 100);
        }
Ejemplo n.º 8
0
        protected void FILL_BED()
        {
            //Show_Week();
            GetWeek();
            string sSQL = "";

            sSQL  = "SELECT M.mac_sec AS AREA, M.mac_bedno AS BED_NO, ";
            sSQL += "CASE ";
            sSQL += "WHEN EXISTS(SELECT R.cln1_col26 FROM clinical1_nurse R WHERE A.apptst_patic=R.cln1_patic AND R.cln1_diadate='" + sDATE.Text + "') ";
            sSQL += "THEN (SELECT R.cln1_col26 FROM clinical1_nurse R WHERE A.apptst_patic=R.cln1_patic AND R.cln1_diadate='" + sDATE.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 += "IF(STRCMP(N.cln1_col5,''), 'V', '') 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='" + 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 (cb_patlist.Text != "")
            {
                sSQL += "AND P.pif_name LIKE '" + cb_patlist.Text + "%' ";
            }
            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='" + 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 (cb_patlist.Text != "")
            //{
            //    sSQL += "AND P.pif_name LIKE '" + cb_patlist.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[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 = grdBED_LIST.GetStore();

            istore.DataSource = db.GetDataArray(dt);
            istore.DataBind();
            TextQuery.Focus(false, 100);
        }