123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685 |
- using System;
- using System.Collections.Generic;
- //using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Text;
- using System.Data;
- namespace Com.Jpsoft.Hospital.Web.Module.FllowUp.MedicalQuality
- {
- public partial class InHospital : Com.Jpsoft.Hospital.Web.Common.BasePage
- {
- /// <summary>
- /// 获取或设置选中项的集合
- /// </summary>
- protected Dictionary<string, string> SelectedItems
- {
- get
- {
- return (ViewState["mySelectedItems"] != null) ? (Dictionary<string, string>)ViewState["mySelectedItems"] : null;
- }
- set
- {
- ViewState["mySelectedItems"] = value;
- }
- }
- #region 事件处理
- protected override void OnInit(EventArgs e)
- {
- if (!IsPostBack)
- {
- base.AutoCheckRight = false;
- base.CheckRightParam = Com.Jpsoft.Hospital.Web.Common.PageFuntionType.List;
- }
- base.OnInit(e);
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- if ((!string.IsNullOrEmpty(Request.QueryString["date"])) && (!string.IsNullOrEmpty(Request.QueryString["day"])))
- {
- StringBuilder strWhere = new StringBuilder(" where 1=1 and lxdh != '' ");
- DateTime date = DateTime.Parse(Request.QueryString["date"]);
- int day = int.Parse(Request.QueryString["day"]);
- DateTime date1 = new DateTime(date.Year, date.Month, date.Day, 0, 0, 0);
- DateTime date2;
- if (day == 0)
- {
- date2 = new DateTime(date.Year, date.Month, date.Day, 23, 59, 59);
- }
- else
- {
- date2 = date.AddDays(day);
- }
- strWhere.Append(" and xcsfrq>='" + date1.ToString() + "' ");
- strWhere.Append(" and xcsfrq<='" + date2.ToString() + "' ");
- ViewState["SearchTerms"] = strWhere.ToString();
- }
- if (Request.QueryString["curPage"] != null)
- {
- AspNetPager1.RecordCount = Convert.ToInt32(Request.QueryString["curPage"].ToString()) * AspNetPager1.PageSize;
- AspNetPager1.CurrentPageIndex = Convert.ToInt32(Request.QueryString["curPage"].ToString());
- }
- BindKS();
- BindData(0);
- }
- else
- {
- }
- }
- private void BindKS()
- {
- Com.Jpsoft.Hospital.BLL.Ex.ZY_BRSYKEx bll = new BLL.Ex.ZY_BRSYKEx();
- DataTable dt = bll.GetYY_KSBMKList(" (name NOT LIKE '%门诊%') AND (name NOT LIKE '%停用%') AND (kslb = 0) ");
- ddlKS.Items.Add(new ListItem("请选择", ""));
- foreach (DataRow dr in dt.Rows)
- {
- ddlKS.Items.Add(new ListItem(dr["name"].ToString(), dr["id"].ToString()));
- }
- }
- protected void txtQuery_Click(object sender, EventArgs e)
- {
- Query();
- }
- protected void btnSendSMS_Click(object sender, EventArgs e)
- {
- SendSMS();
- }
- protected void AspNetPager1_PageChanged(object sender, EventArgs e)
- {
- BindData(1);
- }
- protected void GvList_DataBinding(object sender, EventArgs e)
- {
- CollectSelected();
- }
- protected void GvList_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowIndex > -1 && this.SelectedItems != null)
- {
- DataRowView row = e.Row.DataItem as DataRowView;
- CheckBox cb = e.Row.FindControl("chbSelect") as CheckBox;
- HiddenField hdf = e.Row.FindControl("hdfLxdh") as HiddenField;
- HyperLink hyl = e.Row.FindControl("hylTel") as HyperLink;
- HyperLink hylSyList = e.Row.FindControl("hylSyList") as HyperLink;
- string name = e.Row.Cells[1].Text;
- string blh = GvList.DataKeys[e.Row.RowIndex].Value.ToString();
- if (this.SelectedItems.ContainsKey(blh))
- cb.Checked = true;
- else
- cb.Checked = false;
- string url = Page.ResolveClientUrl("~/Module/FllowUp/MedicalQuality/Call.aspx?customertypeR=1&type=1&blh=" + blh + "&customertype=1&curPage=" + AspNetPager1.CurrentPageIndex);
- //hyl.Attributes.Add("onclick", "javascript:openwin('" + url + "'); return false;");
- hyl.NavigateUrl = url;
- }
- }
- #endregion
- #region 事件方法
- /// <summary>
- /// 绑定数据
- /// </summary>
- private void BindData(int page)
- {
- string strWhere = " where 1=1 ";
- string orderby = " order by cqrq DESC";
- int recordCount = 0;
- if (!string.IsNullOrEmpty((string)ViewState["SearchTerms"]))
- {
- strWhere = ViewState["SearchTerms"].ToString();
- }
- if (!string.IsNullOrEmpty((string)ViewState["Order"]))
- {
- orderby = ViewState["Order"].ToString();
- }
- if (Request.QueryString["url"] != null)
- {
- if (page == 0 || page == 1)
- {
- if ((!string.IsNullOrEmpty((string)Session["Search_InHospital.aspx"]) || !string.IsNullOrEmpty((string)Session["Order_InHospital.aspx"])) && Request.QueryString["url"].ToString().IndexOf("FllowUp/MedicalQuality/Call.aspx") > 0)
- {
- if (!string.IsNullOrEmpty((string)Session["Search_InHospital.aspx"]))
- strWhere = Session["Search_InHospital.aspx"].ToString();
- if (!string.IsNullOrEmpty((string)Session["Order_InHospital.aspx"]))
- orderby = Session["Order_InHospital.aspx"].ToString();
- }
- }
- else
- {
- if ((!string.IsNullOrEmpty((string)Session["Search_InHospital.aspx"]) || !string.IsNullOrEmpty((string)Session["Order_InHospital.aspx"])) && Request.QueryString["url"].ToString().IndexOf("FllowUp/MedicalQuality/InHospital.aspx") > 0)
- {
- if (!string.IsNullOrEmpty((string)Session["Search_InHospital.aspx"]))
- strWhere = Session["Search_InHospital.aspx"].ToString();
- if (!string.IsNullOrEmpty((string)Session["Order_InHospital.aspx"]))
- orderby = Session["Order_InHospital.aspx"].ToString();
- }
- }
- }
- using (IDataReader idr = BLL.BaseClass.SelectPage("jp_view_brsyk_ks_zg", "*", "syxh", AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, strWhere, orderby))
- {
- if (idr.Read())
- {
- recordCount = int.Parse(idr["RecordCount"].ToString());
- }
- AspNetPager1.RecordCount = recordCount;
- idr.NextResult();
- this.GvList.DataSource = idr;
- this.GvList.DataBind();
- if (!string.IsNullOrEmpty(this.ddlKS.SelectedValue) && txtstart.Text != "" && txtEnd.Text != "")
- {
- this.labelSFL.Text = getSFL();
- }
- }
- }
- /// <summary>
- /// 查询数据
- /// </summary>
- private void Query()
- {
- StringBuilder strWhere = new StringBuilder(" where 1=1 ");
- if (ckbSW.Checked)
- {
- strWhere.Append(" and cyfs!='3' ");
- }
- if (ckbDH.Checked)
- {
- strWhere.Append(" and LEN(lxrdh) = 11 ");
- //strWhere.Append(" and (lxrdh not like '133%' and lxrdh not like '149%' and lxrdh not like '153%' and lxrdh not like '173%' and lxrdh not like '174%' and lxrdh not like '177%' and lxrdh not like '180%' and lxrdh not like '181%' and lxrdh not like '189%' and lxrdh not like '199%') ");
- }
- if (ckbST.Checked)
- {
- strWhere.Append(" and dateadd(d,3,Convert(datetime,substring(rqrq,1,8)+' '+substring(rqrq,9,8),120))<=Convert(datetime,substring(cqrq,1,8)+' '+substring(cqrq,9,8),120) ");
- }
- if (ckbFY.Checked)
- {
- strWhere.Append(" and name not like '西院%' and name not like '肿瘤%' ");
- }
- if (ckbNY.Checked)
- {
- strWhere.Append(" and name not like '北院%' ");
- }
- if (ckbBY.Checked)
- {
- strWhere.Append(" and (name like '西院%' or name like '肿瘤%' or name like '北院%') ");
- }
- if (!string.IsNullOrEmpty(this.ddlKS.SelectedValue))
- {
- strWhere.Append(" and ksdm='" + ddlKS.SelectedValue + "'");
- }
- if (!string.IsNullOrEmpty(this.txtCardno.Text))
- {
- strWhere.Append(" and blh='" + this.txtCardno.Text + "' ");
- }
- if (!string.IsNullOrEmpty(this.txtHzxm.Text))
- {
- strWhere.Append(" and hzxm like '%" + this.txtHzxm.Text + "%'");
- }
- if (!string.IsNullOrEmpty(this.txtQtkh.Text))
- {
- strWhere.Append(" and qtkh like '%" + this.txtQtkh.Text + "%'");
- }
- if (!string.IsNullOrEmpty(this.txtSbh.Text))
- {
- strWhere.Append(" and sbh like '%" + this.txtSbh.Text + "%'");
- }
- if (!string.IsNullOrEmpty(this.txtSfzh.Text))
- {
- strWhere.Append(" and sfzh like '%" + this.txtSfzh.Text + "%'");
- }
- if (this.ddlOpSex.SelectedIndex > 0)
- {
- strWhere.Append(" and sex ='" + this.ddlOpSex.SelectedValue.ToString() + "'");
- }
- if (txtstart.Text != "")
- {
- strWhere.Append(" and cqrq>='" + Convert.ToDateTime(txtstart.Text).ToString("yyyyMMdd00:00:00") + "' ");
- }
- if (txtEnd.Text != "")
- {
- strWhere.Append(" and cqrq<'" + Convert.ToDateTime(txtEnd.Text).AddDays(1).ToString("yyyyMMdd00:00:00") + "' ");
- }
- //入区日期
- //if (txtouts.Text == "" && txtoute.Text == "")
- //{
- // strWhere.Append(" and dateadd(d,3,Convert(datetime,substring(rqrq,1,8)+' '+substring(rqrq,9,8),120))<=Convert(datetime,substring(cqrq,1,8)+' '+substring(cqrq,9,8),120) ");
- //}
- //else
- //{
- if (txtouts.Text != "")
- {
- strWhere.Append(" and rqrq>='" + Convert.ToDateTime(txtouts.Text).ToString("yyyyMMdd00:00:00") + "' ");
- }
- if (txtoute.Text != "")
- {
- strWhere.Append(" and rqrq<='" + Convert.ToDateTime(txtoute.Text).ToString("yyyyMMdd00:00:00") + "' ");
- }
- //}
- if (txtYSXM.Text != "")
- {
- strWhere.Append(" and ygxm like '%" + txtYSXM.Text.ToString().Trim() + "%' ");
- }
- if (txtTel.Text != "")
- {
- strWhere.Append(" and lxrdh like '%" + txtTel.Text.ToString().Trim() + "%' ");
- }
- if (txtCYZD.Text != "")
- {
- strWhere.Append(" and cyzd like '%" + txtCYZD.Text.ToString().Trim() + "%' ");
- }
- if (txtPageSize.Text != "")
- {
- int i = 0;
- if (int.TryParse(txtPageSize.Text.Trim(), out i))
- AspNetPager1.PageSize = i;
- }
- ViewState["SearchTerms"] = strWhere.ToString();
- Session["Search_InHospital.aspx"] = strWhere.ToString();
- StringBuilder strOrder = new StringBuilder();
- if (!string.IsNullOrEmpty(ddlOrder.SelectedValue))
- strOrder.Append(" order by " + ddlOrder.SelectedValue);
- ViewState["Order"] = strOrder.ToString();
- Session["Order_InHospital.aspx"] = strOrder.ToString();
- BindData(0);
- }
- /// <summary>
- /// 统计随访率
- /// </summary>
- private string getSFL()
- {
- string str = "出院患者总数:{0}。护理随访人数:{1},护理随访率:{2},护理有效随访人数:{3},护理有效随访率:{4}。医生随访人数:{5},医生随访率:{6},医生有效随访人数:{7},医生有效随访率:{8}。科室随访人数:{9},科室有效随访率:{10}。";
- int total = 0;
- int hs = 0;
- int hsall = 0;
- int ys = 0;
- int ysall = 0;
- int ks = 0;
- string sql = "SELECT blh FROM jp_view_brsyk_ks_zg WHERE 1=1 ";
- sql += " and ksdm='" + ddlKS.SelectedValue + "'";
- if (txtstart.Text != "")
- {
- sql += " and cqrq>='" + Convert.ToDateTime(txtstart.Text).ToString("yyyyMM0100:00:00") + "' ";
- sql += " and cqrq<'" + Convert.ToDateTime(txtstart.Text).AddMonths(1).ToString("yyyyMM0100:00:00") + "' ";
- }
- if (ckbSW.Checked)
- {
- sql += " and cyfs!='3' ";
- }
- if (ckbST.Checked)
- {
- sql += " and dateadd(d,3,Convert(datetime,substring(rqrq,1,8)+' '+substring(rqrq,9,8),120))<=Convert(datetime,substring(cqrq,1,8)+' '+substring(cqrq,9,8),120) ";
- }
- if (ckbDH.Checked)
- {
- sql += " and LEN(lxrdh) = 11 ";
- //sql += " and (lxrdh not like '133%' and lxrdh not like '149%' and lxrdh not like '153%' and lxrdh not like '173%' and lxrdh not like '174%' and lxrdh not like '177%' and lxrdh not like '180%' and lxrdh not like '181%' and lxrdh not like '189%' and lxrdh not like '199%') ";
- }
- DataTable dtRY = BLL.BaseClass.GetTable(sql);
- total = dtRY.Rows.Count;
- foreach (DataRow drRY in dtRY.Rows)
- {
- Com.Jpsoft.Hospital.BLL.Ex.jp_followup_recordEx bllRY = new BLL.Ex.jp_followup_recordEx();
- string yshfsj = bllRY.GetScsfrq(int.Parse(drRY["blh"].ToString()), 2);
- string yshfsj1 = bllRY.GetScsfrq1(int.Parse(drRY["blh"].ToString()), 2);
- string hshfsj = bllRY.GetScsfrq(int.Parse(drRY["blh"].ToString()), 5);
- string hshfsj1 = bllRY.GetScsfrq1(int.Parse(drRY["blh"].ToString()), 5);
- if (yshfsj != "无")
- {
- ys++;
- }
- if (yshfsj1 != "无")
- {
- ysall++;
- }
- if (hshfsj != "无")
- {
- hs++;
- }
- if (hshfsj1 != "无")
- {
- hsall++;
- }
- if (yshfsj != "无" || hshfsj != "无")
- {
- ks++;
- }
- }
- if (total != 0)
- {
- str = String.Format(str, total, hsall, ((double)hsall / total).ToString("0.00%"), hs, ((double)hs / total).ToString("0.00%"), ysall, ((double)ysall / total).ToString("0.00%"), ys, ((double)ys / total).ToString("0.00%"), ks, ((double)ks / total).ToString("0.00%"));
- }
- return str;
- }
- /// <summary>
- /// 发送短信
- /// </summary>
- private void SendSMS()
- {
- CollectSelected();
- if (SelectedItems == null || SelectedItems.Count == 0)
- {
- Response.Write("<script>alert('请选择一个病人!');</script>");
- return;
- }
- string ids = string.Empty;
- foreach (KeyValuePair<string, string> kvp in SelectedItems)
- {
- ids += ",'" + kvp.Key + "'";
- }
- if (ids != string.Empty)
- {
- ids = ids.Substring(1);
- }
- if (txtNextFollowUpDate.Text != "")
- {
- DateTime.Parse(txtNextFollowUpDate.Text);
- }
- Response.Redirect("../SendMsg.aspx?ct=1&ids=" + ids + "&con=" + this.txtSMSContent.Text + "&next=" + txtNextFollowUpDate.Text);
- //string msgContent = this.txtSMSContent.Text;
- //BLL.jp_followup_record bll = new Com.Jpsoft.Hospital.BLL.jp_followup_record();
- //Model.jp_followup_record model;
- //foreach (KeyValuePair<string, string> kvp in SelectedItems)
- //{
- // string msgPhone = kvp.Value;
- // try
- // {
- // if (Common.SMS.SendSMG(msgPhone, msgContent))
- // {
- // model = new Com.Jpsoft.Hospital.Model.jp_followup_record();
- // model.visitway = 0;
- // model.visitcontent = msgContent;
- // model.date = DateTime.Now;
- // model.customerid = int.Parse(kvp.Key);
- // if (txtNextFollowUpDate.Text != "")
- // {
- // model.xcsfrq = DateTime.Parse(txtNextFollowUpDate.Text);
- // }
- // model.customertype = 1;
- // model.ksmc = txtks.Text;
- // model.kslxr = txtkslxr.Text;
- // model.zyh = txtzyh.Text;
- // bll.Add(model);
- // }
- // }
- // catch
- // {
- // Response.Write("<script>alert('出现错误,请检查!');</script>");
- // }
- //}
- ////if (!string.IsNullOrEmpty(this.txtNextFollowUpDate.Text))
- ////{
- //// SetNextFollowUpDate();
- ////}
- //Response.Write("<script>alert('短信发送成功!');</script>");
- }
- /// <summary>
- /// 收集选中项
- /// </summary>
- protected void CollectSelected()
- {
- Dictionary<string, string> selectedItems = null;
- if (this.SelectedItems == null)
- selectedItems = new Dictionary<string, string>();
- else
- selectedItems = this.SelectedItems;
- for (int i = 0; i < this.GvList.Rows.Count; i++)
- {
- string lxdh = this.GvList.Rows[i].Cells[5].Text;
- CheckBox cb = this.GvList.Rows[i].FindControl("chbSelect") as CheckBox;
- string patid = this.GvList.DataKeys[i].Value.ToString();
- if (selectedItems.ContainsKey(patid) && !cb.Checked)
- selectedItems.Remove(patid);
- if (!selectedItems.ContainsKey(patid) && cb.Checked)
- selectedItems.Add(patid, lxdh);
- }
- this.SelectedItems = selectedItems;
- }
- /// <summary>
- /// 设置下次随访日期
- /// </summary>
- protected void SetNextFollowUpDate()
- {
- CollectSelected();
- Jpsoft.Hospital.BLL.Ex.ZY_BRXXKEx zyBll = new Com.Jpsoft.Hospital.BLL.Ex.ZY_BRXXKEx();
- if (SelectedItems == null || SelectedItems.Keys.Count == 0)
- {
- //Response.Write("<script>alert('请选择一个病人!');</script>");
- return;
- }
- foreach (KeyValuePair<string, string> kvp in SelectedItems)
- //for (int i = 0; i < SelectedItems.Keys.Count; i++)
- {
- decimal patid = Convert.ToDecimal(kvp.Key);
- DateTime date = DateTime.Parse(this.txtNextFollowUpDate.Text);
- zyBll.UpdateFollowUpDate(date, patid);
- }
- //Response.Write("<script>alert('已成功设置下次随访日期!');</script>");
- }
- /// <summary>
- /// 回访数
- /// </summary>
- private string KSHF()
- {
- int total = 0;
- int hs = 0;
- int ys = 0;
- int ks = 0;
- string sql = "SELECT blh FROM jp_view_brsyk_ks_zg WHERE 1=1 ";
- sql += " and ksdm='" + ddlKS.SelectedValue + "'";
- if (txtstart.Text != "")
- {
- sql += " and cqrq>='" + Convert.ToDateTime(txtstart.Text).ToString("yyyyMMdd00:00:00") + "' ";
- sql += " and cqrq<'" + Convert.ToDateTime(txtEnd.Text).ToString("yyyyMMdd00:00:00") + "' ";
- }
- if (ckbSW.Checked)
- {
- sql += " and cyfs!='3' ";
- }
- if (ckbST.Checked)
- {
- sql += " and dateadd(d,3,Convert(datetime,substring(rqrq,1,8)+' '+substring(rqrq,9,8),120))<=Convert(datetime,substring(cqrq,1,8)+' '+substring(cqrq,9,8),120) ";
- }
- if (ckbDH.Checked)
- {
- sql += " and LEN(lxrdh) = 11 ";
- }
- DataTable dtRY = BLL.BaseClass.GetTable(sql);
- total = dtRY.Rows.Count;
- foreach (DataRow drRY in dtRY.Rows)
- {
- Com.Jpsoft.Hospital.BLL.Ex.jp_followup_recordEx bllRY = new BLL.Ex.jp_followup_recordEx();
- string yshfsj = bllRY.GetScsfrq(int.Parse(drRY["blh"].ToString()), 2);
- string hshfsj = bllRY.GetScsfrq(int.Parse(drRY["blh"].ToString()), 5);
- if (yshfsj != "无")
- {
- ys++;
- }
- if (hshfsj != "无")
- {
- hs++;
- }
- if (yshfsj != "无" || hshfsj != "无")
- {
- ks++;
- }
- }
- return string.Format("出院患者共{0}人。医师随访{1}人,护士随访{2}人,科室总随访{3}人。", total, ys, hs, ks);
- }
- #endregion
- protected void LinkButton1_Click(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.txtstart.Text) && !string.IsNullOrEmpty(this.txtstart.Text) && !string.IsNullOrEmpty(this.ddlKS.SelectedValue))
- {
- this.Label1.Text = KSHF();
- }
- else
- {
- Response.Write("<script>alert('出区时间及科室必选!');</script>");
- }
- }
- private void exportXls()
- {
- DataTable dt = new DataTable();
- //dt.Columns.Add("科室");
- dt.Columns.Add("病人姓名");
- dt.Columns.Add("住院号");
- dt.Columns.Add("电话号码");
- dt.Columns.Add("出院时间");
- dt.Columns.Add("护理有效随访");
- dt.Columns.Add("医师有效随访");
- dt.Columns.Add("科室随访");
- int total = 0;
- int hs = 0;
- int hsall = 0;
- int ys = 0;
- int ysall = 0;
- int ks = 0;
- string sql = "SELECT * FROM jp_view_brsyk_ks_zg WHERE 1=1 ";
- sql += " and ksdm='" + ddlKS.SelectedValue + "'";
- if (txtstart.Text != "")
- {
- sql += " and cqrq>='" + Convert.ToDateTime(txtstart.Text).ToString("yyyyMM0100:00:00") + "' ";
- sql += " and cqrq<'" + Convert.ToDateTime(txtstart.Text).AddMonths(1).ToString("yyyyMM0100:00:00") + "' ";
- }
- if (ckbSW.Checked)
- {
- sql += " and cyfs!='3' ";
- }
- if (ckbST.Checked)
- {
- sql += " and dateadd(d,3,Convert(datetime,substring(rqrq,1,8)+' '+substring(rqrq,9,8),120))<=Convert(datetime,substring(cqrq,1,8)+' '+substring(cqrq,9,8),120) ";
- }
- if (ckbDH.Checked)
- {
- sql += " and LEN(lxrdh) = 11 ";
- //sql += " and (lxrdh not like '133%' and lxrdh not like '149%' and lxrdh not like '153%' and lxrdh not like '173%' and lxrdh not like '174%' and lxrdh not like '177%' and lxrdh not like '180%' and lxrdh not like '181%' and lxrdh not like '189%' and lxrdh not like '199%') ";
- }
- DataTable dtRY = BLL.BaseClass.GetTable(sql);
- total = dtRY.Rows.Count;
- foreach (DataRow drRY in dtRY.Rows)
- {
- DataRow dr = dt.NewRow();
- //dr["科室"] = Com.Jpsoft.Hospital.BLL.Ex.ZY_BRSYKEx().GetYY_KSBMKName(Eval("ksdm").ToString());
- dr["病人姓名"] = drRY["hzxm"];
- dr["住院号"] = drRY["blh"];
- dr["电话号码"] = drRY["lxrdh"];
- dr["出院时间"] = drRY["cqrq"];
- Com.Jpsoft.Hospital.BLL.Ex.jp_followup_recordEx bllRY = new BLL.Ex.jp_followup_recordEx();
- string yshfsj = bllRY.GetScsfrq(int.Parse(drRY["blh"].ToString()), 2);
- string yshfsj1 = bllRY.GetScsfrq1(int.Parse(drRY["blh"].ToString()), 2);
- string hshfsj = bllRY.GetScsfrq(int.Parse(drRY["blh"].ToString()), 5);
- string hshfsj1 = bllRY.GetScsfrq1(int.Parse(drRY["blh"].ToString()), 5);
- if (yshfsj != "无")
- {
- ys++;
- dr["医师有效随访"] = "√";
- }
- if (yshfsj1 != "无")
- {
- ysall++;
- }
- if (hshfsj != "无")
- {
- hs++;
- dr["护理有效随访"] = "√";
- }
- if (hshfsj1 != "无")
- {
- hsall++;
- }
- if (yshfsj != "无" || hshfsj != "无")
- {
- ks++;
- dr["科室随访"] = "√";
- }
- dt.Rows.Add(dr);
- }
- if (total != 0)
- {
- string str = "出院患者总数:{0}。护理随访人数:{1},护理随访率:{2},护理有效随访人数:{3},护理有效随访率:{4}。医生随访人数:{5},医生随访率:{6},医生有效随访人数:{7},医生有效随访率:{8}。科室随访人数:{9},科室有效随访率:{10}。";
- str = String.Format(str, total, hsall, ((double)hsall / total).ToString("0.00%"), hs, ((double)hs / total).ToString("0.00%"), ysall, ((double)ysall / total).ToString("0.00%"), ys, ((double)ys / total).ToString("0.00%"), ks, ((double)ks / total).ToString("0.00%"));
- DataRow drLast = dt.NewRow();
- drLast["病人姓名"] = str;
- dt.Rows.Add(drLast);
- }
- if (dt != null)
- {
- Session["FileName"] = "医护人员电话随访率";
- Session["Report"] = dt;
- Response.Redirect("Export.ashx");
- }
- else
- {
- Response.Write("<script>alert('请检索,以确定数据存在!');location.href='ReportSFTJ.aspx';</script>");
- }
- }
- protected void btnXls_Click(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.ddlKS.SelectedValue) && txtstart.Text != "" && txtEnd.Text != "")
- {
- exportXls();
- }
- else
- {
- Response.Write("<script>alert('出区时间及科室必选!');</script>");
- }
- }
- }
- }
|