123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465 |
- using System;
- using System.Collections.Generic;
- //using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Data;
- using System.Text.RegularExpressions;
- namespace Com.Jpsoft.Hospital.Web.Module.FllowUp.MedicalQuality
- {
- public partial class Call : Com.Jpsoft.Hospital.Web.Common.BasePage//System.Web.UI.Page
- {
- protected override void OnInit(EventArgs e)
- {
- if (!IsPostBack)
- {
- base.AutoCheckRight = false;
- base.CheckRightParam = Com.Jpsoft.Hospital.Web.Common.PageFuntionType.Insert;
- }
- base.OnInit(e);
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- txtDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
- int uid = 0;
- Com.Jpsoft.Hospital.Web.Common.BasePage.GetSession(out uid);
- if (uid != 0)
- {
- Com.Jpsoft.Hospital.BLL.jp_sys_userEx bll = new Com.Jpsoft.Hospital.BLL.jp_sys_userEx();
- Com.Jpsoft.Hospital.Model.jp_sys_user model = bll.GetModel(uid);
- if (model != null)
- {
- txtCreater.Text = model.user_name;
- }
- }
- if (!IsPostBack)
- {
- if (!string.IsNullOrEmpty(Request.QueryString["lxdh"]))
- {
- this.txtTelPhone.Text = Request.QueryString["lxdh"];
- this.able1.Text = CheckPhoneIsAble(this.txtTelPhone.Text);
- }
- if (!string.IsNullOrEmpty(Request.QueryString["hzxm"]))
- {
- this.txtCustomerName.Text = Request.QueryString["hzxm"].ToString();
- }
- int blh = 0;
- if (!string.IsNullOrEmpty(Request.QueryString["blh"]))
- {
- blh = Convert.ToInt32(Request.QueryString["blh"]);
- }
- Com.Jpsoft.Hospital.BLL.ZY_BRSYK bll = new BLL.ZY_BRSYK();
- DataTable dt = bll.GetList(" blh ='" + blh + "' and brzt!='9'");
- if (dt.Rows.Count > 0)
- {
- txtks.Text = new Com.Jpsoft.Hospital.BLL.Ex.ZY_BRSYKEx().GetYY_KSBMKName(dt.Rows[0]["ksdm"].ToString());
- txtksdm.Text = dt.Rows[0]["ksdm"].ToString();
- txtzyh.Text = blh.ToString();
- this.txtTelPhone.Text = dt.Rows[0]["lxrdh"].ToString();
- this.able1.Text = CheckPhoneIsAble(this.txtTelPhone.Text);
- this.txtCustomerName.Text = dt.Rows[0]["hzxm"].ToString();
- }
- Com.Jpsoft.Hospital.BLL.Ex.jp_followup_recordEx recordBll = new BLL.Ex.jp_followup_recordEx();
- dt = recordBll.GetListZY(" zyh='" + blh + "' and type=1 order by id desc").Tables[0];
- if (dt.Rows.Count > 0)
- {
- lblCumVisitDate.Text = dt.Rows[0]["date"].ToString();
- }
- dt = recordBll.GetListZY(" zyh='" + blh + "' and type=2 order by id desc").Tables[0];
- if (dt.Rows.Count > 0)
- {
- lblDocVisitDate.Text = dt.Rows[0]["date"].ToString();
- }
- dt = recordBll.GetListZY(" zyh='" + blh + "' and type=3 order by id desc").Tables[0];
- if (dt.Rows.Count > 0)
- {
- lblMagVisitDate.Text = dt.Rows[0]["date"].ToString();
- }
- dt = recordBll.GetListZY(" zyh='" + blh + "' and type=4 order by id desc").Tables[0];
- if (dt.Rows.Count > 0)
- {
- lblTFVisitDate.Text = dt.Rows[0]["date"].ToString();
- }
- int iCurPage = 1;
- Com.Jpsoft.Hospital.Web.Common.BasePage.FetchQueryString("LCurPage", out iCurPage);
- AspNetPager1.RecordCount = iCurPage * AspNetPager1.PageSize;
- AspNetPager1.CurrentPageIndex = iCurPage;
- BindData();
- ShowList(blh);
- }
- }
- protected void btnReturn_Click(object sender, EventArgs e)
- {
- //if (!string.IsNullOrEmpty(Request.QueryString["ReturnUrl"]))
- //{
- // Response.Redirect(Request.QueryString["ReturnUrl"]);
- //}
- Response.Redirect("InHospital.aspx?curPage=" + Request.QueryString["curPage"].ToString() + "&url=" + Request.Url.LocalPath);
- }
- //分页
- protected void AspNetPager1_PageChanged(object sender, EventArgs e)
- {
- BindData();
- }
- /// <summary>
- /// 绑定住院就诊信息
- /// </summary>
- private void BindData()
- {
- int RecordCount = 0;
- string strWhere = " where 1=1 ";
- if (!string.IsNullOrEmpty(Request.QueryString["blh"]))
- {
- strWhere += " and blh = '" + Request.QueryString["blh"] + "' and brzt!='9'";
- }
- string strOrder = " order by syxh DESC";
- Com.Jpsoft.Hospital.BLL.Ex.ZY_BRSYKEx bll = new Com.Jpsoft.Hospital.BLL.Ex.ZY_BRSYKEx();
- using (IDataReader idr = bll.SelectPage(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, strWhere, strOrder))
- {
- if (idr.Read())
- {
- RecordCount = Convert.ToInt32(idr["RecordCount"]);
- }
- idr.NextResult();
- GridView1.DataSource = idr;
- GridView1.DataBind();
- }
- this.AspNetPager1.RecordCount = RecordCount;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- Com.Jpsoft.Hospital.BLL.ZY_BRSYK bll = new Com.Jpsoft.Hospital.BLL.ZY_BRSYK();
- DataTable dt = bll.GetList("syxh=" + Request.QueryString["id"]);
- Response.Redirect("SYList.aspx?id=" + dt.Rows[0]["blh"].ToString());
- }
- /// <summary>
- /// 提交随访结果
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected void btnSure_Click(object sender, EventArgs e)
- {
- if (txtCreater.Text == "随访专员" && rbtnType.SelectedValue=="2")
- {
- Response.Write("<script>alert('请在随访人员中选择客服!');</script>");
- return;
- }
- if (txtCreater.Text == "护理部" && rbtnType.SelectedValue != "5")
- {
- Response.Write("<script>alert('请在随访人员中选择客服!');</script>");
- return;
- }
- int type = 0;
- string page = Request.QueryString["curPage"].ToString();
- string url = Request.Url.LocalPath;
- if (!string.IsNullOrEmpty(Request.QueryString["blh"]))
- {
- type = int.Parse(Request.QueryString["type"].ToString());
- this.Add(int.Parse(Request.QueryString["blh"].ToString()), int.Parse(Request.QueryString["type"].ToString()));
- if (type == 1)
- {
- Response.Write("<script>alert('保存成功!');window.location='InHospital.aspx?curPage=" + page + "&url=" + url + "';</script>");
- }
- else
- {
- Response.Write("<script>alert('保存成功!');window.location='Outpatient.aspx';</script>");
- }
- }
- else
- {
- if (type == 1)
- {
- Response.Write("<script>alert('保存失败!');window.navigate('InHospital.aspx?curPage=" + page + "&url=" + url + "';</script>");
- }
- else
- {
- Response.Write("<script>alert('保存成功!');window.location='Outpatient.aspx';</script>");
- }
- }
- }
- #region 方法
- /// <summary>
- /// 添加随访记录
- /// </summary>
- private void Add(int customerid, int type)
- {
- Com.Jpsoft.Hospital.BLL.jp_followup_record bll = new Com.Jpsoft.Hospital.BLL.jp_followup_record();
- Com.Jpsoft.Hospital.Model.jp_followup_record mode = new Com.Jpsoft.Hospital.Model.jp_followup_record();
- mode.customerid = customerid;
- mode.visitway = 1;
- mode.visitcontent = txtFollowUpContent.Text;
- mode.date = DateTime.Now;
- mode.customeridea = txtCustomeridea.Text;
- mode.customereval = int.Parse(ddlSatisfied.SelectedValue);
- mode.creater = txtCreater.Text.Trim();
- if (txtNextDate.Text != "")
- {
- mode.xcsfrq = DateTime.Parse(txtNextDate.Text);
- }
- mode.type = Convert.ToInt32(rbtnType.SelectedValue);
- mode.ksmc = txtksdm.Text;
- //mode.ksmc = txtks.Text;
- mode.kslxr = txtkslxr.Text;
- mode.zyh = txtzyh.Text;
- if (rbtnType.SelectedValue == "2")
- mode.isyssf = "是";
- else
- mode.isyssf = "否";
- mode.customertype = int.Parse(Request.QueryString["customertypeR"].ToString());
- mode.issuccess = int.Parse(RadioButtonList1.SelectedValue);
- bll.Add(mode);
- }
- /// <summary>
- /// 返回病人状态
- /// </summary>
- /// <param name="brzt"></param>
- /// <returns></returns>
- public string Getbrzt(string brzt)
- {
- string str = "";
- switch (brzt)
- {
- case "0":
- str = "入院登记";
- break;
- case "1":
- str = "病区分床";
- break;
- case "2":
- str = "病区出院";
- break;
- case "3":
- str = "病人出院";
- break;
- case "4":
- str = "取消结算";
- break;
- case "5":
- str = "进入ICU";
- break;
- case "6":
- str = "进入产房";
- break;
- case "7":
- str = "转科状态";
- break;
- case "8":
- str = "数据转出";
- break;
- case "9":
- str = "作废记录";
- break;
- }
- return str;
- }
- /// <summary>
- /// 区域状态
- /// </summary>
- /// <param name="ycqbz"></param>
- /// <returns></returns>
- public string Getycqbz(string ycqbz)
- {
- if (ycqbz == "1")
- {
- return "预出区";
- }
- else
- {
- return "正常";
- }
- }
- /// <summary>
- /// 住院状态
- /// </summary>
- /// <param name="jgbz"></param>
- /// <returns></returns>
- public string Getjgbz(string jgbz)
- {
- string str = "";
- switch (jgbz)
- {
- case "0":
- str = "住院";
- break;
- case "1":
- str = "在观";
- break;
- case "2":
- str = "出观";
- break;
- }
- return str;
- }
- public string GetVistWay(int vistWay)
- {
- string result = string.Empty;
- switch (vistWay)
- {
- case 0:
- result = "短信";
- break;
- case 1:
- result = "电话";
- break;
- default:
- result = "未知方式";
- break;
- }
- return result;
- }
- public string GetVistType(int type)
- {
- string result = string.Empty;
- switch (type)
- {
- case 0:
- result = "科研随访";
- break;
- case 1:
- result = "客服";
- break;
- case 2:
- result = "医生";
- break;
- case 3:
- result = "质管";
- break;
- case 4:
- result = "探访";
- break;
- case 5:
- result = "护理";
- break;
- default:
- result = "未知";
- break;
- }
- return result;
- }
- public string GetCustomerType(int customerType)
- {
- string result = string.Empty;
- switch (customerType)
- {
- case 0:
- result = "科研随访";
- break;
- case 1:
- result = "住院病人";
- break;
- case 2:
- result = "门诊病人";
- break;
- case 3:
- result = "潜在客户";
- break;
- default:
- result = "未知";
- break;
- }
- return result;
- }
- /// <summary>
- /// 住院状态
- /// </summary>
- /// <param name="jgbz"></param>
- /// <returns></returns>
- private void ShowList(int zyh)
- {
- //zyh = 1474062;
- string strWhere = " where zyh = " + zyh;
- int recordCount = 0;
- string orderby = " order by date DESC";
- using (IDataReader idr = BLL.BaseClass.SelectPage("jp_zy_followuprecord", "*", "id", 1, 100, strWhere, orderby))
- {
- if (idr.Read())
- {
- recordCount = int.Parse(idr["RecordCount"].ToString());
- }
- AspNetPager1.RecordCount = recordCount;
- idr.NextResult();
- this.GridView2.DataSource = idr;
- this.GridView2.DataBind();
- }
- }
- /// <summary>
- /// 电话号码运营商
- /// </summary>
- public string CheckPhoneIsAble(string phone)
- {
- phone = phone.Replace(" ", "").Replace("-", "");
- //电信手机号码
- string dianxin = @"^1(33|49|53|73|74|77|80|81|89|99)\d{8}";
- Regex regexDX = new Regex(dianxin);
- //联通手机号码
- string liantong = @"^1(30|31|32|45|46|55|56|66|71|75|76|85|86)\d{8}";
- Regex regexLT = new Regex(liantong);
- //移动手机号码
- string yidong = @"^1(34|35|36|37|38|39|47|48|50|51|52|57|58|59|72|78|82|83|84|87|88|98)\d{8}";
- Regex regexYD = new Regex(yidong);
- if (regexDX.IsMatch(phone))
- return "中国电信";
- else if (regexLT.IsMatch(phone))
- return "中国联通";
- else if (regexYD.IsMatch(phone))
- return "中国移动";
- else
- return "电话号码有误!";
- }
- public string GetIsSuccess(int isSuccess)
- {
- string result = string.Empty;
- switch (isSuccess)
- {
- case 0:
- result = "有效呼叫";
- break;
- case 1:
- result = "关机未接";
- break;
- case 2:
- result = "停机空号";
- break;
- case 3:
- result = "号码不符";
- break;
- default:
- result = "未知方式";
- break;
- }
- return result;
- }
- #endregion
- }
- }
|