private void btn_Operation_Click(object sender, EventArgs e, Object obj) { PatientReservationInfoEntity pr = obj as PatientReservationInfoEntity; if (pr.status == "0") //未分诊,调用签到接口 { String param = "registerId=" + pr.registerId; String url = AppContext.AppConfig.serverUrl + "sch/registerTriage/signIn?" + param; this.DoWorkAsync(0, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中) { String data = HttpClass.httpPost(url); return(data); }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上) { //cmd.HideOpaqueLayer(); JObject objT = JObject.Parse(data.ToString()); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { String tipMsg = ""; if (objT["result"]["tipMsg"] != null && objT["result"]["tipMsg"].ToString().Length != 0) { tipMsg = objT["result"]["tipMsg"].ToString() + ","; } String regVisitTime = null; if (objT["result"]["regVisitTime"] != null) { regVisitTime = objT["result"]["regVisitTime"].ToString(); } PrintNoteEntity printData = new PrintNoteEntity() { HospitalName = objT["result"]["hospitalName"].ToString(), DeptName = objT["result"]["deptName"].ToString(), ClinicName = objT["result"]["clinicName"].ToString(), MzType = objT["result"]["mzType"].ToString(), DoctorPrice = objT["result"]["doctorPrice"].ToString(), DoctorName = objT["result"]["doctorName"].ToString(), PatientId = objT["result"]["patientId"].ToString(), QueueNum = objT["result"]["queueNum"].ToString(), Name = objT["result"]["patientName"].ToString(), WaitingNum = objT["result"]["waitingNum"].ToString(), Time = objT["result"]["currentTime"].ToString(), TipMsg = objT["result"]["tipMsg"].ToString(), DoctorTip = objT["result"]["doctorTip"].ToString(), RegVisitTime = regVisitTime }; //打印小票 PrintNote print = new PrintNote(printData); string message = ""; if (!print.Print(ref message)) { MessageBoxUtils.Show(tipMsg + "打印小票失败:" + message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this); } else { MessageBoxUtils.Hint(tipMsg + "打印小票完成", this); } getData(); } else { MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this); } }); } else if (pr.status == "1") //已签到取消候诊 { String param = "triageId=" + pr.triageId; String url = AppContext.AppConfig.serverUrl + "sch/registerTriage/cancelWaiting?" + param; this.DoWorkAsync(0, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中) { String data = HttpClass.httpPost(url); return(data); }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上) { //cmd.HideOpaqueLayer(); JObject objT = JObject.Parse(data.ToString()); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { getData(); } else { MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this); } }); } else if (pr.status == "2") //就诊中不需要操作 { return; } else if (pr.status == "3") //已就诊,调用复诊签到接口 { String param = "patientId=" + patientid; String url = AppContext.AppConfig.serverUrl + "itf/clab/checkLisReport?" + param; this.DoWorkAsync(0, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中) { String data = HttpClass.httpPost(url); return(data); }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上) { //cmd.HideOpaqueLayer(); JObject objT = JObject.Parse(data.ToString()); if (string.Compare(objT["state"].ToString(), "false", true) == 0) { ReSign(pr.triageId); } else { if (MessageBoxUtils.Show("该患者还有未出结果报告:\r\n" + objT["result"].ToString() + "是否继续为他复诊签到?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, this) == DialogResult.OK) { ReSign(pr.triageId); } } }); } else if (pr.status == "6") //该患者预约的医生已停诊,请选择其他医生签到 { this.registerId = pr.registerId; DialogResult = DialogResult.No; } else if (pr.status == "7") //该复诊患者预约的医生已停诊,请选择其他医生签到 { this.triageId = pr.triageId; DialogResult = DialogResult.Retry; } }
/// <summary> /// 补打指引单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_BuDa_Click(object sender, EventArgs e, Object obj) { PatientReservationInfoEntity pr = obj as PatientReservationInfoEntity; String param = "triageId=" + pr.triageId; String url = AppContext.AppConfig.serverUrl + "sch/registerTriage/waitingList?" + param; this.DoWorkAsync(0, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中) { String data = HttpClass.httpPost(url); return(data); }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上) { //cmd.HideOpaqueLayer(); JObject objT = JObject.Parse(data.ToString()); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { String tipMsg = ""; if (objT["result"]["tipMsg"] != null && objT["result"]["tipMsg"].ToString().Length != 0) { tipMsg = objT["result"]["tipMsg"].ToString() + ","; } String regVisitTime = null; if (objT["result"]["regVisitTime"] != null) { regVisitTime = objT["result"]["regVisitTime"].ToString(); } PrintNoteEntity printData = new PrintNoteEntity() { HospitalName = objT["result"]["hospitalName"].ToString(), DeptName = objT["result"]["deptName"].ToString(), ClinicName = objT["result"]["clinicName"].ToString(), MzType = objT["result"]["mzType"].ToString(), DoctorPrice = objT["result"]["doctorPrice"].ToString(), DoctorName = objT["result"]["doctorName"].ToString(), PatientId = objT["result"]["patientId"].ToString(), QueueNum = objT["result"]["queueNum"].ToString(), Name = objT["result"]["patientName"].ToString(), WaitingNum = objT["result"]["waitingNum"].ToString(), Time = objT["result"]["currentTime"].ToString(), TipMsg = objT["result"]["tipMsg"].ToString(), DoctorTip = objT["result"]["doctorTip"].ToString(), RegVisitTime = regVisitTime }; PrintNote print = new PrintNote(printData); string message = ""; if (!print.Print(ref message)) { MessageBoxUtils.Show(tipMsg + "打印小票失败:" + message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this); } else { MessageBoxUtils.Hint(tipMsg + "打印小票完成", this); } } else { MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this); } }); }