private void butLoad_Click(object sender, EventArgs e) { if (listSheets.Items.Count == 0) { MsgBox.Show(this, "There are no sheets to send to the kiosk for the current patient."); return; } if (gridMain.GetSelectedIndex() == -1 || gridMain.GetSelectedIndex() >= _terminalList.Count) { MsgBox.Show(this, "Please select a terminal first."); return; } TerminalActive terminal = _terminalList[gridMain.GetSelectedIndex()]; if (terminal.PatNum != 0 && !MsgBox.Show(this, true, "A patient is currently using the terminal. If you continue, they will lose the information that is on their " + "screen. Continue anyway?")) { return; } TerminalActives.SetPatNum(terminal.TerminalActiveNum, _patNumCur); Signalods.SetInvalid(InvalidType.Kiosk, KeyType.ProcessId, Process.GetCurrentProcess().Id); FillGrid(); FillPat(); }
///<summary>Sets the PatNum for the selected Kiosk or MobileDevice.</summary> public void SetPatNum(long patNum) { if (IsKiosk) { TerminalActives.SetPatNum(_computerKiosk.TerminalActiveNum, patNum); Signalods.SetInvalid(InvalidType.Kiosk, KeyType.ProcessId, Process.GetCurrentProcess().Id); //signal the terminal manager to refresh its grid } else { MobileAppDevices.SetPatNum(_mobileDevice.MobileAppDeviceNum, patNum); if (patNum > 0) { OpenDentBusiness.WebTypes.PushNotificationUtils.CI_CheckinPatient(patNum, _mobileDevice.MobileAppDeviceNum); } else { OpenDentBusiness.WebTypes.PushNotificationUtils.CI_GoToCheckin(_mobileDevice.MobileAppDeviceNum); } } }
private void butDone_Click(object sender, EventArgs e) { Sheets.ClearFromTerminal(PatNum); labelForms.Visible = false; listForms.Visible = false; butDone.Visible = false; if (IsSimpleMode) //not subscribed to signals if IsSimpleMode { PatNum = 0; _listSheets = new List <Sheet>(); labelThankYou.Visible = true; return; } //NOT IsSimpleMode from here down TerminalActive terminal; Process processCur = Process.GetCurrentProcess(); try{ terminal = TerminalActives.GetForCmptrSessionAndId(Environment.MachineName, processCur.SessionId, processCur.Id); labelConnection.Visible = false; } catch (Exception) { //SocketException if db connection gets lost. labelConnection.Visible = true; return; } //this terminal shouldn't be running, receptionist must've deleted this kiosk, close the form (causes application exit if NOT IsSimpleMode). if (terminal == null) { Close(); //signal sent in form closing return; } if (terminal.PatNum != 0) { labelWelcome.Visible = true; TerminalActives.SetPatNum(terminal.TerminalActiveNum, 0); PatNum = 0; _listSheets = new List <Sheet>(); Signalods.SetInvalid(InvalidType.Kiosk, KeyType.ProcessId, processCur.Id); //signal the terminal manager to refresh its grid } }
private void butClear_Click(object sender, EventArgs e) { if (gridMain.GetSelectedIndex() == -1 || gridMain.GetSelectedIndex() >= _terminalList.Count) { MsgBox.Show(this, "Please select a terminal first."); return; } TerminalActive terminal = _terminalList[gridMain.GetSelectedIndex()]; if (terminal.PatNum == 0) { return; } if (!MsgBox.Show(this, true, "A patient is currently using the terminal. If you continue, they will lose the information that is on their screen. " + "Continue anyway?")) { return; } TerminalActives.SetPatNum(terminal.TerminalActiveNum, 0); Signalods.SetInvalid(InvalidType.Kiosk, KeyType.ProcessId, Process.GetCurrentProcess().Id); FillGrid(); FillPat(); }
///<summary>Used in both modes. Loads the list of sheets into the listbox. Then launches the first sheet and goes through the sequence of sheets. ///If user clicks cancel, the seqeunce will exit. If NOT IsSimpleMode, then the TerminalManager can also send a signal to immediately terminate ///the sequence. If PatNum is 0, this will unload the patient by making the form list not visible and the welcome message visible.</summary> private void LoadPatient(bool isRefreshOnly) { TerminalActive terminal = null; _listSheets = new List <Sheet>(); Process processCur = Process.GetCurrentProcess(); if (IsSimpleMode) { if (PatNum > 0) { _listSheets = Sheets.GetForTerminal(PatNum); } } else //NOT IsSimpleMode { try{ terminal = TerminalActives.GetForCmptrSessionAndId(Environment.MachineName, processCur.SessionId, processCur.Id); labelConnection.Visible = false; } catch (Exception) { //SocketException if db connection gets lost. labelConnection.Visible = true; return; } if (terminal == null) { //this terminal shouldn't be running, receptionist must've deleted this kiosk, close the form (causes application exit if NOT IsSimpleMode) Close(); //signal sent in form closing return; } if (terminal.PatNum > 0) { _listSheets = Sheets.GetForTerminal(terminal.PatNum); } if (_listSheets.Count == 0) //either terminal.PatNum is 0 or no sheets for pat { labelWelcome.Visible = true; labelForms.Visible = false; listForms.Visible = false; butDone.Visible = false; if (terminal.PatNum > 0) //pat loaded but no sheets to show, unload pat, update db, send signal { TerminalActives.SetPatNum(terminal.TerminalActiveNum, 0); Signalods.SetInvalid(InvalidType.Kiosk, KeyType.ProcessId, processCur.Id); } PatNum = 0; if (_formSheetFillEdit != null && !_formSheetFillEdit.IsDisposed) { _formSheetFillEdit.ForceClose(); } return; } } //we have a patient loaded who has some sheets to show in the terminal labelWelcome.Visible = false; labelForms.Visible = true; listForms.Visible = true; butDone.Visible = true; listForms.Items.Clear(); _listSheets.ForEach(x => listForms.Items.Add(x.Description)); if (!IsSimpleMode) { if (PatNum == terminal.PatNum) { return; //if the pat was not cleared or replaced just return, if sheets are currently being displayed (loop below), continue displaying them } //PatNum is changed, set it to the db terminalactive and signal others, then begin displaying sheets (loop below) PatNum = terminal.PatNum; if (_formSheetFillEdit != null && !_formSheetFillEdit.IsDisposed) { _formSheetFillEdit.ForceClose(); } Signalods.SetInvalid(InvalidType.Kiosk, KeyType.ProcessId, processCur.Id); } if (!isRefreshOnly) { AutoShowSheets(); } }