//dynamic listNum; /// <summary> /// 日期排班号源 /// </summary> /// <param name="time">日期</param> public void TimeScheduling(string hospitalId, string deptId, string doctorId, string time) { try { cmd.ShowOpaqueLayer(225, false); list = new List <string>(); Dictionary <string, string> prament = new Dictionary <string, string>(); prament.Add("hospitalId", hospitalId); //医院主键 prament.Add("deptId", deptId); //科室主键 prament.Add("doctorId", doctorId); //医生主键 prament.Add("workDate", time); //排班日期 prament.Add("type", "1"); //类型:0公开预约号源、1诊间预约号源 RestSharpHelper.ReturnResult <List <string> >("itf/booking/findTimeNum", prament, Method.POST, result => { #region switch (result.ResponseStatus) { case ResponseStatus.Completed: if (result.StatusCode == System.Net.HttpStatusCode.OK) { Log4net.LogHelper.Info("请求结果:" + string.Join(",", result.Data.ToArray())); JObject objT = JObject.Parse(string.Join(",", result.Data.ToArray())); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { List <TimeNum> timenum = objT["result"].ToObject <List <TimeNum> >(); List <Xr.Common.Controls.Item> listitem = new List <Xr.Common.Controls.Item>(); foreach (var item in timenum) { Xr.Common.Controls.Item it = new Xr.Common.Controls.Item(); it.name = item.beginTime + "-" + item.endTime + "" + "<" + item.num + ">"; it.value = item.id; it.tag = item.beginTime + "-" + item.endTime + "#" + item.mzType; it.parentId = item.id; if (item.mzType == "2") //特需门诊显红色 { it.spcialBColor = "Red"; } listitem.Add(it); } _context.Send((s) => this.mcTimeSpan.setDataSource(listitem), null); _context.Send((s) => cmd.HideOpaqueLayer(), null); } else { _context.Send((s) => cmd.HideOpaqueLayer(), null); _context.Send((s) => Xr.Common.MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm), null); } } break; } #endregion }); } catch (Exception ex) { Log4net.LogHelper.Error("获取日期排班号源错误信息:" + ex.Message); } }
/// <summary> /// 呼号到诊/过号重排 /// </summary> /// <param name="triageId">分诊记录主键,第一次可空</param> /// <param name="type">类型:0(呼号到诊)、1(过号重排)</param> public void PatientOkAndNext(string triageId, string type) { try { Dictionary <string, string> prament = new Dictionary <string, string>(); prament.Add("triageId", triageId); string Url = ""; if (type == "0") { Url = InterfaceAddress.inPlace;//呼号到诊接口 } else { Url = InterfaceAddress.passNum;//过号重排接口 } RestSharpHelper.ReturnResult <List <string> >(Url, prament, Method.POST, result => { switch (result.ResponseStatus) { case ResponseStatus.Completed: if (result.StatusCode == System.Net.HttpStatusCode.OK) { Log4net.LogHelper.Info("请求结果:" + string.Join(",", result.Data.ToArray())); JObject objT = JObject.Parse(string.Join(",", result.Data.ToArray())); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { if (type == "0") { if (Convert.ToBoolean(AppContext.AppConfig.WhetherToAssign)) { string patientId = objT["result"][0]["patientId"].ToString(); _context.Send((s) => Assignment(patientId), null); //把患者ID传给医生工作站并让医生工作站回车 } } else { _context.Send((s) => Form1.pCurrentWin.label2.Text = "等待呼叫病人 [请稍候...]", null); } _context.Send((s) => CloseForm(), null); _context.Send((s) => ShuaXin(), null); } else { _context.Send((s) => MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, this), null); } } break; } }); } catch (Exception ex) { Log4net.LogHelper.Error("获取完成下一位/过号下一位错误信息:" + ex.Message); } }
/// <summary> /// 当时间还没到时医生想呼叫下一位调用接口 /// </summary> public void CallNewPatient(string triageId, string clinicId) { try { Dictionary <string, string> prament = new Dictionary <string, string>(); prament.Add("triageId", triageId); prament.Add("clinicId", clinicId); RestSharpHelper.ReturnResult <List <string> >(InterfaceAddress.ForcedCall, prament, Method.POST, result => { if (result.ResponseStatus == ResponseStatus.Completed) { if (result.StatusCode == System.Net.HttpStatusCode.OK) { Log4net.LogHelper.Info("请求结果:" + string.Join(",", result.Data.ToArray())); JObject objT = JObject.Parse(string.Join(",", result.Data.ToArray())); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { _context.Send((s) => HelperClass.triageId = objT["result"][0]["triageId"].ToString(), null); _context.Send((s) => Form1.pCurrentWin.label2.Text = objT["result"][0]["smallCellShow"].ToString() + objT["result"][0]["nextCellShow"].ToString(), null); if (Convert.ToBoolean(AppContext.AppConfig.WhetherToAssign)) { string patientId = objT["result"][0]["patientId"].ToString(); Form1.pCurrentWin.PatientId = patientId; if (Convert.ToBoolean(AppContext.AppConfig.IsStart)) { _context.Send((s) => Form1.pCurrentWin.InputStr(patientId), null); } else { _context.Send((s) => Form1.pCurrentWin.Assignment(patientId), null); } } _context.Send((s) => PatientList(), null); } else { if (this.Size.Height == 28) { _context.Send((s) => MessageBoxUtils.Hint(objT["message"].ToString(), null), null); } else { _context.Send((s) => MessageBoxUtils.Hint(objT["message"].ToString(), Form1.pCurrentWin), null); } } } } }); } catch (Exception ex) { Log4net.LogHelper.Error("呼叫当前患者错误信息:" + ex.Message); } }
/// <summary> /// 患者列表 /// </summary> public void PatientList() { try { Dictionary <string, string> prament = new Dictionary <string, string>(); prament.Add("hospitalId", HelperClass.hospitalId); //医院ID prament.Add("deptId", HelperClass.deptId); //科室ID prament.Add("doctorId", HelperClass.doctorId); //医生ID prament.Add("status", Postoperative.EditValue.ToString()); RestSharpHelper.ReturnResult <List <string> >(InterfaceAddress.findPatientListByDoctor, prament, Method.POST, result => { switch (result.ResponseStatus) { case ResponseStatus.Completed: if (result.StatusCode == HttpStatusCode.OK) { Log4net.LogHelper.Info("请求结果:" + string.Join(",", result.Data.ToArray())); JObject objT = JObject.Parse(string.Join(",", result.Data.ToArray())); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { List <Patient> a = objT["result"].ToObject <List <Patient> >(); // a.Add(new Patient { triageId ="1", queueNum ="101", patientId="010", patientName="lisi", workTime="1" , triageTime="101", visitWinTime="101", sex ="1", statusTxt ="1", cardType ="2", cardTypeTxt="101", cardNo="101001" , telPhone ="10101", showRegTime =true }); for (int i = 0; i < a.Count; i++) { if (a[i].showRegTime != true) { a[i].workTime = ""; } } _context.Send((s) => this.gc_Pateion.DataSource = a, null); _context.Send((s) => label1.Text = a.Count + "人", null); } else { _context.Send((s) => MessageBoxUtils.Hint(objT["message"].ToString(), Form1.pCurrentWin), null); } } break; } }); } catch (Exception ex) { Log4net.LogHelper.Error("获取患者列表错误信息:" + ex.Message); } }
/// <summary> /// 下一位 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void skinButNext_Click(object sender, EventArgs e) { try { timer2.Enabled = false; label2.Left = 0; Dictionary <string, string> prament = new Dictionary <string, string>(); prament.Add("hospitalId", HelperClass.hospitalId); prament.Add("deptId", HelperClass.deptId); prament.Add("clinicId", HelperClass.clinicId); prament.Add("triageId", HelperClass.triageId); prament.Add("doctorId", HelperClass.doctorId); RestSharpHelper.ReturnResult <List <string> >(InterfaceAddress.callNextPerson, prament, Method.POST, result => { if (result.ResponseStatus == ResponseStatus.Completed) { if (result.StatusCode == System.Net.HttpStatusCode.OK) { Log4net.LogHelper.Info("请求结果:" + string.Join(",", result.Data.ToArray())); JObject objT = JObject.Parse(string.Join(",", result.Data.ToArray())); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { _context.Send((s) => HelperClass.triageId = objT["result"][0]["triageId"].ToString(), null); _context.Send((s) => label2.Text = objT["result"][0]["smallCellShow"].ToString() + objT["result"][0]["nextCellShow"].ToString(), null); if (label2.Text.Length > 17) { _context.Send((s) => timer2.Enabled = true, null); } if (Convert.ToBoolean(AppContext.AppConfig.WhetherToAssign)) { string patientId = objT["result"][0]["patientId"].ToString(); PatientId = patientId; _context.Send((s) => Assignment(patientId), null);//把患者ID传给医生工作站并让医生工作站回车 } if (Convert.ToBoolean(AppContext.AppConfig.WhetherToDisplay)) { _context.Send((s) => this.skinButton1.Enabled = true, null); _context.Send((s) => this.skinButton1.BackColor = Color.PaleGreen, null); } _context.Send((s) => ShuaXin(), null); } else { if (this.Size.Height == 28) { _context.Send((s) => MessageBoxUtils.Hint(objT["message"].ToString(), null), null); } else { _context.Send((s) => MessageBoxUtils.Hint(objT["message"].ToString(), Form1.pCurrentWin), null); } } } } }); } catch (Exception ex) { MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this); Log4net.LogHelper.Error("呼叫下一位错误信息:" + ex.Message); } }
/// <summary> /// 确认预约 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_reservation_Click(object sender, EventArgs e) { try { cmd.ShowOpaqueLayer(225, false); Dictionary <string, string> prament = new Dictionary <string, string>(); #region prament.Add("scheduPlanId", YuYueId); //排班记录主键 prament.Add("patientId", Patientid); //患者主键 prament.Add("patientName", lab_patientName.Text.Trim()); //患者姓名 prament.Add("cardType", lueCardType.EditValue.ToString()); //卡类型 prament.Add("cardNo", lab_cardID.Text.Trim()); //卡号 prament.Add("tempPhone", lab_tel.Text.Trim()); //手机号 prament.Add("note", ""); //备注 if (rBtn_visitType0.Checked) //就诊类别:0.初诊 ,1.复诊 { prament.Add("visitType", "0"); } else { prament.Add("visitType", "1"); } if (rBtn_addressType0.Checked)//地址类别:0市内、1市外 { prament.Add("addressType", "0"); } else { prament.Add("addressType", "1"); } if (rBtn_isShfzF.Checked)//术后复诊:0是、1否 { prament.Add("isShfz", "1"); } else { prament.Add("isShfz", "0"); } if (rBtn_isYwzzF.Checked)//外院转诊:0是、1否 { prament.Add("isYwzz", "1"); } else { prament.Add("isYwzz", "0"); } if (rBtn_isCyfzF.Checked)//出院复诊:0是、1否 { prament.Add("isCyfz", "1"); } else { prament.Add("isCyfz", "0"); } if (rBtn_isMxbF.Checked)//是否慢性病:0是、1否 { prament.Add("isMxb", "1"); } else { prament.Add("isMxb", "0"); } prament.Add("registerWay", "1");//预约途径:1诊间、2自助机、3公众号、4卫计局平台、5官网 #endregion #region RestSharpHelper.ReturnResult <List <string> >("itf/booking/confirmBooking", prament, Method.POST, result => { switch (result.ResponseStatus) { case ResponseStatus.Completed: if (result.StatusCode == System.Net.HttpStatusCode.OK) { Log4net.LogHelper.Info("请求结果:" + string.Join(",", result.Data.ToArray())); JObject objT = JObject.Parse(string.Join(",", result.Data.ToArray())); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { _context.Send((s) => ClearReservationUIInfo(), null); _context.Send((s) => cmd.HideOpaqueLayer(), null); _context.Send((s) => Xr.Common.MessageBoxUtils.Hint(objT["message"].ToString(), MainForm), null); _context.Send((s) => TimeScheduling(AppContext.Session.hospitalId, SelectDeptid, DoctorId, GetDateTime), null); _context.Send((s) => GetDoctorPatientInfo(SelectDeptid, DoctorId, GetDateTime, GetDateTime), null); } else { _context.Send((s) => ClearReservationUIInfo(), null); _context.Send((s) => cmd.HideOpaqueLayer(), null); _context.Send((s) => Xr.Common.MessageBoxUtils.Hint(objT["message"].ToString(), HintMessageBoxIcon.Error, MainForm), null); } } break; } }); #endregion } catch (Exception ex) { _context.Send((s) => cmd.HideOpaqueLayer(), null); Xr.Common.MessageBoxUtils.Show("确认预约错误信息" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm); Log4net.LogHelper.Error("确认预约错误信息:" + ex.Message); } }
/// <summary> /// 医生排班日期 /// </summary> public void DoctorSchedulings(string hospitalId, string deptId, string doctorId) { try { cmd.ShowOpaqueLayer(225, false); Dictionary <string, string> prament = new Dictionary <string, string>(); prament.Add("hospitalId", hospitalId); prament.Add("deptId", deptId); //科室主键 prament.Add("doctorId", doctorId); //医生主键 prament.Add("type", "1"); //类型:0公开预约号源、1诊间预约号源 RestSharpHelper.ReturnResult <List <string> >("itf/booking/findByDeptAndDoctor", prament, Method.POST, result => { switch (result.ResponseStatus) { case ResponseStatus.Completed: if (result.StatusCode == System.Net.HttpStatusCode.OK) { Log4net.LogHelper.Info("请求结果:" + string.Join(",", result.Data.ToArray())); JObject objT = JObject.Parse(string.Join(",", result.Data.ToArray())); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { //更新日历 List <Dictionary <int, String> > dcs = new List <Dictionary <int, String> >(); List <Xr.RtManager.Pages.triage.SpotBookingForm.AvaDateEntity> list = objT["result"].ToObject <List <Xr.RtManager.Pages.triage.SpotBookingForm.AvaDateEntity> >(); Dictionary <int, String> dc1 = new Dictionary <int, String>(); if (list.Count == 0) { _context.Send((s) => cmd.HideOpaqueLayer(), null); _context.Send((s) => Xr.Common.MessageBoxUtils.Show("当前选择医生没有排班日期", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, MainForm), null); _context.Send((s) => reservationCalendar1.ChangeValidDate(dcs), null); return; } string Month = System.DateTime.Now.ToString("MM"); //list[0].month; foreach (var item in list) { if (item.month != Month) { dcs.Add(dc1); dc1 = new Dictionary <int, String>(); Month = item.month; } if (item.syNum > 0) { dc1.Add(Int32.Parse(item.day), System.DateTime.Now.ToString()); } else { dc1.Add(Int32.Parse(item.day), "约满"); } } dcs.Add(dc1); _context.Send((s) => reservationCalendar1.ChangeValidDate(dcs), null); _context.Send((s) => cmd.HideOpaqueLayer(), null); } else { _context.Send((s) => cmd.HideOpaqueLayer(), null); _context.Send((s) => Xr.Common.MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm), null); } } break; } }); } catch (Exception ex) { Log4net.LogHelper.Error("获取医生排班号源错误信息:" + ex.Message); } }