public object GetSearchObject() { object result = null; YellowstonePathology.Business.OrderIdParser orderIdParser = new Business.OrderIdParser(this.m_SearchText); if (orderIdParser.IsValidReportNo == true) { result = new YellowstonePathology.Business.ReportNo(this.m_SearchText); } else if (orderIdParser.IsValidMasterAccessionNo == true) { result = YellowstonePathology.Business.MasterAccessionNo.Parse(this.m_SearchText, true); } else { YellowstonePathology.Business.MasterAccessionNo masterAccessionNo = null; if (YellowstonePathology.Business.MasterAccessionNo.TryParse(this.m_SearchText, false, out masterAccessionNo) == true) { result = masterAccessionNo; } else { YellowstonePathology.Business.PatientName patientName = null; if (YellowstonePathology.Business.PatientName.TryParse(this.m_SearchText, out patientName) == true) { result = patientName; } } } return(result); }
public object GetSearchObject() { object result = null; YellowstonePathology.Business.OrderIdParser orderIdParser = new Business.OrderIdParser(this.m_SearchText); if(orderIdParser.IsValidReportNo == true) { result = new YellowstonePathology.Business.ReportNo(this.m_SearchText); } else if(orderIdParser.IsValidMasterAccessionNo == true) { result = YellowstonePathology.Business.MasterAccessionNo.Parse(this.m_SearchText, true); } else { YellowstonePathology.Business.MasterAccessionNo masterAccessionNo = null; if (YellowstonePathology.Business.MasterAccessionNo.TryParse(this.m_SearchText, false, out masterAccessionNo) == true) { result = masterAccessionNo; } else { YellowstonePathology.Business.PatientName patientName = null; if (YellowstonePathology.Business.PatientName.TryParse(this.m_SearchText, out patientName) == true) { result = patientName; } } } return result; }
public void TextBoxSearchANPN_KeyUp(object sender, KeyEventArgs args) { if (args.Key == Key.Return) { if (this.TextBoxSearchANPN.Text.Length >= 1) { this.ReleaseLock(); this.m_PathologistUI.Save(true); TextSearchHandler textSearchHandler = new TextSearchHandler(this.TextBoxSearchANPN.Text); object textSearchObject = textSearchHandler.GetSearchObject(); if (textSearchObject is YellowstonePathology.Business.ReportNo) { YellowstonePathology.Business.ReportNo reportNo = (YellowstonePathology.Business.ReportNo)textSearchObject; this.m_PathologistUI.DoReportNoSearch(reportNo.Value); } else if (textSearchObject is YellowstonePathology.Business.MasterAccessionNo) { YellowstonePathology.Business.MasterAccessionNo masterAccessionNo = (YellowstonePathology.Business.MasterAccessionNo)textSearchObject; this.m_PathologistUI.DoMasterAccessionNoSearch(masterAccessionNo.Value); } else if (textSearchObject is YellowstonePathology.Business.PatientName) { YellowstonePathology.Business.PatientName patientName = (YellowstonePathology.Business.PatientName)textSearchObject; this.m_PathologistUI.DoPatientNameSearch(patientName.FirstName, patientName.LastName); } } if (this.ListViewSearchResults.Items.Count == 1) { this.ListViewSearchResults.SelectedIndex = 0; } } }
private void TextBoxMasterAccessionNo_KeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { if (this.TextBoxMasterAccessionNo.Text.Length >= 1) { Surgical.TextSearchHandler textSearchHandler = new Surgical.TextSearchHandler(this.TextBoxMasterAccessionNo.Text); object textSearchObject = textSearchHandler.GetSearchObject(); if (textSearchObject is YellowstonePathology.Business.ReportNo) { YellowstonePathology.Business.ReportNo reportNo = (YellowstonePathology.Business.ReportNo)textSearchObject; this.m_LoginUI.GetReportSearchListByReportNo(reportNo.Value); } else if (textSearchObject is YellowstonePathology.Business.MasterAccessionNo) { YellowstonePathology.Business.MasterAccessionNo masterAccessionNo = (YellowstonePathology.Business.MasterAccessionNo)textSearchObject; this.m_LoginUI.GetReportSearchListByMasterAccessionNo(masterAccessionNo.Value); } else if (textSearchObject is YellowstonePathology.Business.PatientName) { YellowstonePathology.Business.PatientName patientName = (YellowstonePathology.Business.PatientName)textSearchObject; this.m_LoginUI.GetReportSearchListByPatientName(patientName); } if (this.m_LoginUI.AccessionOrder != null) { YellowstonePathology.Business.Persistence.DocumentGateway.Instance.ReleaseLock(this.m_LoginUI.AccessionOrder, this.m_Writer); } } } }
private string ReportNoFromText(string text) { string result = string.Empty; Surgical.TextSearchHandler textSearchHandler = new Surgical.TextSearchHandler(text); object textSearchObject = textSearchHandler.GetSearchObject(); if (textSearchObject is YellowstonePathology.Business.ReportNo) { YellowstonePathology.Business.ReportNo reportNo = (YellowstonePathology.Business.ReportNo)textSearchObject; result = reportNo.Value; } else if (textSearchObject is YellowstonePathology.Business.MasterAccessionNo) { YellowstonePathology.Business.MasterAccessionNo masterAccessionNo = (YellowstonePathology.Business.MasterAccessionNo)textSearchObject; result = masterAccessionNo.Value + ".F1"; } return(result); }