/// <summary>
        /// Searches the message using the search query.
        /// </summary>
        /// <param name="m">The message to search</param>
        /// <returns>Returns true if the message matches the search query</returns>
        private bool SearchMessage(HL7Lib.Base.Message m)
        {
            try
            {
                bool returnValue = false;

                foreach (string item in txtSearchTerms.Text.Split('|'))
                {
                    bool allMatched = false;
                    List <SearchTerm> searchTerms = SearchTerm.GetSearchTerms(item.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries));
                    foreach (SearchTerm st in searchTerms)
                    {
                        HL7Lib.Base.Component c = m.GetByID(st.ID, st.Value.ToUpper());
                        if (!String.IsNullOrEmpty(c.ID))
                        {
                            allMatched = true;
                        }
                        else
                        {
                            allMatched = false;
                            break;
                        }
                    }
                    if (allMatched)
                    {
                        returnValue = true;
                        break;
                    }
                }
                return(returnValue);
            }
            catch (Exception ex)
            {
                Log.LogException(ex).ShowDialog();
                return(false);
            }
        }
Exemple #2
0
 /// <summary>
 /// Initialization Method: Sets the current search query for display
 /// </summary>
 /// <param name="query">The current search query</param>
 public frmBuildSearch(string query)
 {
     InitializeComponent();
     searchQuery          = SearchTerm.GetSearchTerms(query);
     txtCurrentQuery.Text = SearchTerm.BuildSearchQueryString(searchQuery);
 }