private void btnHold_Click(object sender, EventArgs e) { DisableBtnAll(); try { int holdTime = PrePareData.StaticDataCls.HoldTime.Where(x => x.mhs_id == this.mhs_id).Select(x => x.holdTime).FirstOrDefault(); QueueClass.TransactionQueueCls.PatientHoldQueue hold = new QueueClass.TransactionQueueCls().HoldQueue((int)this.tps_id, holdTime, this.user.mut_username); if (hold.Status == QueueClass.TransactionQueueCls.PatientHoldQueue.StatusHoldQueue.Error) { lbAlertMsg.Text = "กรุณากด Hold Queue อีกครั้ง"; StatusWK(); } else { StatusEmptyRoom(); lbAlertMsg.Text = string.Format(Program.MsgHold, hold.QueueNo); this.tpr_id = null; } //if (Program.CurrentRegis != null) //{ // string QueueNo = Program.CurrentRegis.tpr_queue_no; // StatusTransaction result = CallQueue.P_CallHold(); // if (result == StatusTransaction.True) // { // // morn clear Unit Display // new ClsTCPClient().sendClearUnitDisplay(); // // morn clear Unit Display // StatusEmptyRoom(); // lbAlertMsg.Text = string.Format(Program.MsgHold, QueueNo); // this.tpr_id = null; // } // else if (result == StatusTransaction.Error) // { // lbAlertMsg.Text = "กรุณากด Hold Queue อีกครั้ง"; // StatusWK(); // } //} //else //{ // lbAlertMsg.Focus(); // lbAlertMsg.Text = "tpr_id is null please try again and close this page !"; // StatusWK(); //} } catch { lbAlertMsg.Text = "กรุณากด Hold Queue อีกครั้ง"; StatusWK(); } }
private void btnCallQueue_Click(object sender, EventArgs e) { DisableBtnAll(); this.AutoScrollPosition = new Point(0, 0); frmBGScreen frmbg = new frmBGScreen(); frmbg.Show(); try { //noina if (this.mrd_id != null && this.user != null) { QueueClass.TransactionQueueCls.PatientCallQueue CallQueue = new QueueClass.TransactionQueueCls().CallQueue((int)this.mrd_id, this.user.mut_id, this.user.mut_username); if (CallQueue.Status == QueueClass.TransactionQueueCls.PatientCallQueue.StatusCallQueue.Error) { lbAlertMsg.Text = "กรุณากด Call Queue อีกครั้ง"; StatusEmptyRoom(); } else if (CallQueue.Status == QueueClass.TransactionQueueCls.PatientCallQueue.StatusCallQueue.NoPatient) { lbAlertMsg.Text = "No patient on queue!"; StatusEmptyRoom(); } else { this.tpr_id = CallQueue.tpr_id; this.tps_id = CallQueue.tps_id; clsCountDown.startCountDown(0, clsCountDown.GetTimeCountDown()); StatusNSWR(); } } } catch (Exception ex) { Program.MessageError(this.Name, "btnCallQueue_Click", ex, false); } finally { frmbg.Close(); } }
private void cls_successCountDown(object sender, successTypeArgs e) { DisableBtnAll(); QueueClass.TransactionQueueCls.PatientReadyQueue ready = new QueueClass.TransactionQueueCls().ReadyQueue((int)this.tps_id, (int)this.mrd_id, this.user.mut_username); if (ready.Status == QueueClass.TransactionQueueCls.PatientReadyQueue.StatusReadyQueue.Error) { lbAlertMsg.Text = "กรุณากดปุ่ม Ready อีกครั้ง"; StatusNSWR(); } else { StatusTransaction showUnit = new ClsTCPClient().sendCallUnitDisplay(); if (showUnit == StatusTransaction.Error) { //lbAlertMsg.Text = "เกิดความผิดพลาดทางเทคนิค ไม่สามารถแสดงผลบน unit display ได้"; } AlertOutDepartment.LoadTime(); ReserveSkipCls reserveSkip = new ReserveSkipCls(); int? skipRoom = reserveSkip.CheckRoomSkip(this.tpr_id); StatusWK(); string alert = reserveSkip.MessegeAlertSkip(skipRoom); lbAlertMsg.Text = alert; } }
private void btnSendAuto_Click(object sender, EventArgs e) { DisableBtnAll(); DateTime startDate = DateTime.Now; this.AutoScrollPosition = new Point(0, 0); //tps_id = Program.CurrentPatient_queue.tps_id; Class.FunctionDataCls func = new Class.FunctionDataCls(); EmrClass.GetDataMasterCls mst = new EmrClass.GetDataMasterCls(); frmBGScreen frmbg = new frmBGScreen(); frmbg.Show(); Application.DoEvents(); try { int patientMvt = paRegis.trn_patient_queues.Where(x => x.tps_id == tps_id) .Select(x => (int)x.mvt_id).FirstOrDefault(); using (InhCheckupDataContext contxt = new InhCheckupDataContext()) { string mvt_code = contxt.mst_events.Where(x => x.mvt_id == patientMvt).Select(x => x.mvt_code).FirstOrDefault(); if (mvt_code == "PE") { if (new Class.FunctionDataCls().checkPassedCheckPointB((int)this.tpr_id)) { this.PatientEvent = PatientEventStatus.PEAfterCheckB; } else { this.PatientEvent = PatientEventStatus.PEBeforeCheckB; } } else { this.PatientEvent = PatientEventStatus.Result; } } if (saveData()) { if (this.PatientEvent == PatientEventStatus.PEBeforeCheckB) { bool sent = new QueueClass.TransactionQueueCls().SendQueueDoctorPEBeforeCheckB((int)tpr_id, (int)tps_id, user.mut_username); if (sent) { lbAlertMsg.Text = new Class.FunctionDataCls().getStringGotoNextRoom((int)tpr_id); StatusEmptyRoom(); } else { lbAlertMsg.Text = "โปรดกด Send Auto อีกครั้ง";; StatusWK(); } } else if (this.PatientEvent == PatientEventStatus.PEAfterCheckB) { if (resultUltrasound == PopupUltrasoundLower.ResultPopupUltrasoundLower.AfterStation) { List <int> mvt = mst.GetMstRoomEventByMrm(Program.CurrentRoom.mrm_id).Select(x => x.mvt_id).ToList(); Class.FunctionDataCls.sendQueueStatus result = func.sendQueueUltrasoundLower(resultUltrasound, mvt); if (result == Class.FunctionDataCls.sendQueueStatus.error) { lbAlertMsg.Text = "เกิดความผิดพลาดทางเทคนิค ไม่สามารถส่งไป ultrasound ได้ กรุณาติดต่อผู้ดูแลระบบ"; StatusWK(); } else if (result == Class.FunctionDataCls.sendQueueStatus.sendSuccess) { new ClsTCPClient().sendClearUnitDisplay(); lbAlertMsg.Text = func.GetStrSaveAndSend((int)tpr_id, "US", "UL"); StatusEmptyRoom(); this.tpr_id = null; } } else { if (new Class.FunctionDataCls().ChkSendAutoNewModule(Program.CurrentRegis)) { string msgAlert = ""; bool isPopup = false; List <int> list_mvt_id = new List <int> { patientMvt }; QueueClass.SendAutoCls.ResultSendQueue result = new QueueClass.SendAutoCls().SendAuto((int)tps_id, list_mvt_id, user, ref msgAlert, ref isPopup); if (result == QueueClass.SendAutoCls.ResultSendQueue.Error) { lbAlertMsg.Text = msgAlert; StatusWK(); } else { lbAlertMsg.Visible = true; if (result == QueueClass.SendAutoCls.ResultSendQueue.SendComplete) { new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.SendAuto, (int)tpr_id, (int)tps_id, Program.CurrentSite.mhs_id, Program.CurrentRoom.mrd_ename, Program.CurrentUser.mut_username, startDate); new ClsTCPClient().sendClearUnitDisplay(); new Class.ReserveSkipCls().SendAndReserve(tpr_id); StatusEmptyRoom(); this.tpr_id = null; if (isPopup) { MessageBox.Show(msgAlert, "EMR Checkup."); } else { lbAlertMsg.Text = msgAlert; } } else { if (isPopup) { MessageBox.Show(msgAlert, "EMR Checkup."); } else { lbAlertMsg.Text = msgAlert; } } } } else { StatusTransaction result = CallQueue.SendAutoOnStation(); if (result == StatusTransaction.True || result == StatusTransaction.SendCheckB) { new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.SendAuto, (int)tpr_id, (int)tps_id, Program.CurrentSite.mhs_id, Program.CurrentRoom.mrd_ename, Program.CurrentUser.mut_username, startDate); new ClsTCPClient().sendClearUnitDisplay(); lbAlertMsg.Visible = true; new Class.ReserveSkipCls().SendAndReserve(tpr_id); lbAlertMsg.Text = new Class.FunctionDataCls().getStringGotoNextRoom((int)tpr_id); StatusEmptyRoom(); this.tpr_id = null; } else if (result == StatusTransaction.Error) { lbAlertMsg.Text = "โปรดกด Send Auto อีกครั้ง"; StatusWK(); } else if (result == StatusTransaction.False) { lbAlertMsg.Text = "Save Data Complete."; StatusWK(); } } } } else if (this.PatientEvent == PatientEventStatus.Result) { bool sent = new QueueClass.TransactionQueueCls().SendQueueDoctorResult((int)tps_id, user.mut_username); if (sent) { lbAlertMsg.Text = "Sent To Checkpoint C."; StatusEmptyRoom(); } else { lbAlertMsg.Text = "Save Data Incomplete. Please Try Again."; StatusWK(); } } } else { lbAlertMsg.Text = "Save Data Incomplete. Please Try Again."; StatusWK(); } } catch (Exception ex) { lbAlertMsg.Text = ex.Message; StatusWK(); } frmbg.Close(); }