public override void OnSetActive(object sender, WizardCancelEventArgs e) { base.OnSetActive(sender, e); if (e.PreviousPage != null && e.PreviousPage.GetType() == typeof(PatientPage)) { PatientPage p = e.PreviousPage as PatientPage; Patient previous = _Patient; _Patient = p.Patient; comboBoxAccessionNumber.Items.Clear(); // *** if ( (previous == null) || (previous.IssuerOfPatientID != p.Patient.IssuerOfPatientID || previous.PatientID != p.Patient.PatientID) || string.IsNullOrEmpty(Program.MyMainForm.MyImagingServiceRequestPage.comboBoxAccessionNumber.Text)) { ProgressDialog dlgProgresss = new ProgressDialog(); CustomBrokerClient client = GetWizard().Tag as CustomBrokerClient; List <string> accessionNumbers = null; dlgProgresss.Title = "Find"; dlgProgresss.Description = "Getting list of accession numbers"; dlgProgresss.Action = () => { accessionNumbers = client.GetAccessionNumbers(_Patient.PatientID, _Patient.IssuerOfPatientID); }; UpdateUI(true); comboBoxAccessionNumber.Items.Clear(); if (dlgProgresss.ShowDialog(this) == DialogResult.OK) { foreach (string accessionNumber in accessionNumbers) { comboBoxAccessionNumber.Items.Add(accessionNumber); } } if (dlgProgresss.Exception != null) { Messager.ShowError(this, dlgProgresss.Exception); } } } errorProvider.SetIconAlignment(comboBoxAccessionNumber, ErrorIconAlignment.TopLeft); }
public override void OnSetActive(object sender, WizardCancelEventArgs e) { base.OnSetActive(sender, e); GetWizard().Option1Caption = "Clear"; if (_PatientKeys == null) { ProgressDialog dlgProgresss = new ProgressDialog(); CustomBrokerClient client = GetWizard().Tag as CustomBrokerClient; List <string> ids = null; dlgProgresss.Title = "Find"; dlgProgresss.Description = "Getting list of patient ids"; dlgProgresss.Action = () => { ids = client.GetPatientIDs(); }; if (dlgProgresss.ShowDialog(this) == DialogResult.OK) { _PatientKeys = new List <PatientKey>(); foreach (string id in ids) { string[] info = id.Split(';'); PatientKey key = new PatientKey() { PatientId = info[0], IssurerOfPatientId = info[1] }; _PatientKeys.Add(key); comboBoxPatientId.Items.Add(key); } } if (dlgProgresss.Exception != null) { string errorMessage = dlgProgresss.Exception.Message; if (errorMessage.Contains("There was no endpoint listening at")) { string append = string.Format("\n\nThis can happen if the '{0}' listening service is not running. To start '{0}' listening service:\n* Run 'CSLeadtools.Dicom.Server.Manager_Original.exe'\n* Click the double-green arrow (Start All Servers)", _worklistServer); errorMessage += append; } Messager.ShowError(this, errorMessage); } } }
private void GetImagingServiceRequestInfo() { ProgressDialog dlgProgresss = new ProgressDialog(); CustomBrokerClient client = GetWizard().Tag as CustomBrokerClient; string accessionNumber = comboBoxAccessionNumber.Text; dlgProgresss.Title = "Search"; dlgProgresss.Description = "Searching for imaging service request"; dlgProgresss.Action = () => { _ImagingServiceRequest = client.FindImagingServiceRequest(accessionNumber, _Patient.PatientID, _Patient.IssuerOfPatientID); }; _Update = false; _OriginalAccessionNumber = string.Empty; if (dlgProgresss.ShowDialog(this) == DialogResult.OK) { if (_ImagingServiceRequest != null) { _Update = true; UpdateUI(false); _OriginalAccessionNumber = _ImagingServiceRequest.AccessionNumber; errorProvider.Clear(); } else { Messager.ShowError(this, "Imaging service request not found."); } } else { if (dlgProgresss.Exception != null) { Messager.ShowError(this, dlgProgresss.Exception); } } }
public override void OnWizardNext(object sender, WizardPageEventArgs e) { if (!IsValid()) { e.Cancel = true; return; } else { ProgressDialog dlgProgresss = new ProgressDialog(); CustomBrokerClient client = GetWizard().Tag as CustomBrokerClient; // // See if the user wants to update are add. The user will only be asked if the originally did a search but // changed one of the patient ids. // if (_Update && (comboBoxPatientId.Text != _OriginalPatientId)) { DialogResult r = Messager.ShowQuestion(this, "You searched for a patient but have changed some of the identifying information. " + "Would you like to update this patient with the new information? \r\n\r\nClicking No will add a new patient.", MessageBoxButtons.YesNo); _Update = r == DialogResult.Yes; } UpdatePatient(); dlgProgresss.Title = _Update ? "Update patient" : "Add Patient"; dlgProgresss.Description = _Update ? "Updating..." : "Adding..."; dlgProgresss.Action = () => { if (_Update) { client.UpdatePatient(_OriginalPatientId, _OriginalIssuerOfPatientId, _Patient); } else { client.AddPatient(_Patient); } }; if (dlgProgresss.ShowDialog(this) == DialogResult.Cancel) { if (dlgProgresss.Exception != null) { e.Cancel = true; Messager.ShowError(this, dlgProgresss.Exception); } } else { if (_Update) { UpdatePatient(_OriginalPatientId, _OriginalIssuerOfPatientId, _Patient.PatientID, _Patient.IssuerOfPatientID); } else { comboBoxPatientId.Items.Add(new PatientKey() { PatientId = _Patient.PatientID, IssurerOfPatientId = _Patient.IssuerOfPatientID }); } comboBoxPatientId.Text = _Patient.PatientID; if (_Patient != null) { _OriginalPatientId = _Patient.PatientID; _OriginalIssuerOfPatientId = _Patient.IssuerOfPatientID; } else { e.Cancel = true; ParentWizard.Reset(); } } } base.OnWizardNext(sender, e); }
public override void OnWizardNext(object sender, WizardPageEventArgs e) { if (!IsValid()) { e.Cancel = true; return; } else { ProgressDialog dlgProgresss = new ProgressDialog(); CustomBrokerClient client = GetWizard().Tag as CustomBrokerClient; // // See if the user wants to update are add. The user will only be asked if the originally did a search but // changed one of the patient ids. // if (_Update && (comboBoxAccessionNumber.Text != _OriginalAccessionNumber)) { DialogResult r = Messager.ShowQuestion(this, "You searched for an imaging service request but have changed the accession number. " + "Would you like to update this imaging service request with the accession number? " + "\r\n\r\nClicking No will add a new imaging service request.", MessageBoxButtons.YesNo); _Update = r == DialogResult.Yes; } UpdateImagingServiceRequest(); dlgProgresss.Title = _Update ? "Update Imaging Service Request" : "Add Imaging Service Request"; dlgProgresss.Description = _Update ? "Updating..." : "Adding..."; dlgProgresss.Action = () => { if (_Update) { client.UpdateImagingServiceRequest(_OriginalAccessionNumber, _Patient.PatientID, _Patient.IssuerOfPatientID, _ImagingServiceRequest); } else { client.AddImagingServiceRequest(_Patient.PatientID, _Patient.IssuerOfPatientID, _ImagingServiceRequest); } }; if (dlgProgresss.ShowDialog(this) == DialogResult.Cancel) { if (dlgProgresss.Exception != null) { e.Cancel = true; Messager.ShowError(this, dlgProgresss.Exception); } } else { if (_Update) { int index = comboBoxAccessionNumber.Items.IndexOf(_OriginalAccessionNumber); if (index != -1) { comboBoxAccessionNumber.Items.Remove(_OriginalAccessionNumber); } } comboBoxAccessionNumber.Items.Add(_ImagingServiceRequest.AccessionNumber); comboBoxAccessionNumber.Text = _ImagingServiceRequest.AccessionNumber; _OriginalAccessionNumber = _ImagingServiceRequest.AccessionNumber; } } base.OnWizardNext(sender, e); }