Пример #1
0
        private bool IsMatch(SearchPatient patient, string[] searchTerms)
        {
            switch (searchTerms.Length)
            {
            case 0:
                return(false);

            case 1:
                return(IsMatchWithOneSearchTerm(patient, searchTerms[0]));

            default:
                return(IsMatchWithTwoSearchTerms(patient, searchTerms[0], searchTerms[1]));
            }
        }
Пример #2
0
 private bool IsMatchWithLastThenFirstName(SearchPatient patient, string lastName, string firstName) =>
 IsSubstring(lastName, patient.LastName) && IsSubstring(firstName, patient.FirstName);
Пример #3
0
 private bool IsMatchWithTwoSearchTerms(SearchPatient patient, string term1, string term2) =>
 IsMatchWithLastThenFirstName(patient, term1, term2) ||
 IsMatchWithLastThenFirstName(patient, term2, term1);
Пример #4
0
 private bool IsMatchWithOneSearchTerm(SearchPatient patient, string term) =>
 IsSubstring(term, patient.Id) ||
 IsSubstring(term, patient.LastName) ||
 IsSubstring(term, patient.FirstName);