Beispiel #1
0
        public SearchResults ExecuteSearch(Search search)
        {
            DataContext.YpiData dataContext = new ClientWebServices.DataContext.YpiData();
            Repository.SearchRepository repository = new Repository.SearchRepository(dataContext);

            SearchResults searchResults = new SearchResults();
            searchResults.Items = new List<SearchResult>();

            switch (search.SearchType)
            {
                case SearchTypeEnum.PatientLastNameSearch:
                    if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                    {
                        searchResults.Items = repository.GetClientCasesByPatientLastName(search);
                    }
                    else
                    {
                        searchResults.Items = repository.GetPhysicianCasesByPatientLastName(search);
                    }
                    break;
                case SearchTypeEnum.PatientLastAndFirstNameSearch:
                    if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                    {
                        searchResults.Items = repository.GetClientCasesByPatientLastNameAndFirstName(search);
                    }
                    else
                    {
                        searchResults.Items = repository.GetPhysicianCasesByPatientLastNameAndFirstName(search);
                    }
                    break;
                case SearchTypeEnum.RecentCases:
                    if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                    {
                        searchResults.Items = repository.GetClientRecentCases(search);
                    }
                    else
                    {
                        searchResults.Items = repository.GetPhysicianRecentCases(search);
                    }
                    break;
                case SearchTypeEnum.NotDownloaded: //Not Downloaded is Depricated SH 5/17/2010
                case SearchTypeEnum.NotAcknowledged:
                    if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                    {
                        searchResults.Items = repository.GetClientCasesNotAcknowledged(search);
                    }
                    else
                    {
                        searchResults.Items = repository.GetPhysicianCasesNotAcknowledged(search);
                    }
                    break;
                case SearchTypeEnum.DateOfBirth:
                    if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                    {
                        searchResults.Items = repository.GetClientCasesByPBirthDate(search);
                    }
                    else
                    {
                        searchResults.Items = repository.GetPhysicianCasesByPBirthDate(search);
                    }
                    break;
                case SearchTypeEnum.SocialSecurityNumber:
                    if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                    {
                        searchResults.Items = repository.GetClientCasesByPSSN(search);
                    }
                    else
                    {
                        searchResults.Items = repository.GetPhysicianCasesByPSSN(search);
                    }
                    break;
                case SearchTypeEnum.PhysicianId:
                    searchResults.Items = repository.GetClientCasesByPhysicianId(search);
                    break;
            }

            return searchResults;
        }
Beispiel #2
0
        public SearchResults ExecuteSearch(Search search)
        {
            DataContext.YpiData         dataContext = new ClientWebServices.DataContext.YpiData();
            Repository.SearchRepository repository  = new Repository.SearchRepository(dataContext);

            SearchResults searchResults = new SearchResults();

            searchResults.Items = new List <SearchResult>();

            switch (search.SearchType)
            {
            case SearchTypeEnum.PatientLastNameSearch:
                if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                {
                    searchResults.Items = repository.GetClientCasesByPatientLastName(search);
                }
                else
                {
                    searchResults.Items = repository.GetPhysicianCasesByPatientLastName(search);
                }
                break;

            case SearchTypeEnum.PatientLastAndFirstNameSearch:
                if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                {
                    searchResults.Items = repository.GetClientCasesByPatientLastNameAndFirstName(search);
                }
                else
                {
                    searchResults.Items = repository.GetPhysicianCasesByPatientLastNameAndFirstName(search);
                }
                break;

            case SearchTypeEnum.RecentCases:
                if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                {
                    searchResults.Items = repository.GetClientRecentCases(search);
                }
                else
                {
                    searchResults.Items = repository.GetPhysicianRecentCases(search);
                }
                break;

            case SearchTypeEnum.NotDownloaded:     //Not Downloaded is Depricated SH 5/17/2010
            case SearchTypeEnum.NotAcknowledged:
                if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                {
                    searchResults.Items = repository.GetClientCasesNotAcknowledged(search);
                }
                else
                {
                    searchResults.Items = repository.GetPhysicianCasesNotAcknowledged(search);
                }
                break;

            case SearchTypeEnum.DateOfBirth:
                if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                {
                    searchResults.Items = repository.GetClientCasesByPBirthDate(search);
                }
                else
                {
                    searchResults.Items = repository.GetPhysicianCasesByPBirthDate(search);
                }
                break;

            case SearchTypeEnum.SocialSecurityNumber:
                if (search.ClientUser.ClientSearchMode == ClientWebServices.ClientSearchModeEnum.UseClientList)
                {
                    searchResults.Items = repository.GetClientCasesByPSSN(search);
                }
                else
                {
                    searchResults.Items = repository.GetPhysicianCasesByPSSN(search);
                }
                break;

            case SearchTypeEnum.PhysicianId:
                searchResults.Items = repository.GetClientCasesByPhysicianId(search);
                break;
            }

            return(searchResults);
        }