private void CreateDiagnosisSearch() { var query = IcdQuery.BlockStartingWith(Session); DiagnosisSearch = new PopupSearchViewModel <IcdBlock>(query); DiagnosisSearch.Filter.Filtered += (s, e) => { inFiltered = true; MakeVms(Chapters, DiagnosisSearch.Filter.Results); inFiltered = false; }; DiagnosisSearch.IsResultsVisible = true; Func <string, IEnumerable <IcdBlock> > specBlocksQuery = (s) => { return(spec.IcdBlocks.Where(x => x.Code.StartsWith(s, StringComparison.OrdinalIgnoreCase) || x.Title.StartsWith(s, StringComparison.OrdinalIgnoreCase))); }; SpecDiagnosisSearch = new PopupSearchViewModel <IcdBlock>(specBlocksQuery); SpecDiagnosisSearch.Filter.Filtered += (s, e) => { inFiltered = true; MakeVms(SpecChapters, SpecDiagnosisSearch.Filter.Results); inFiltered = false; }; }
public void DiagnosisQueryBlockStartingWithUpperCase() { var p1 = session.Load <IcdBlock>(91); var res = IcdQuery.BlockStartingWith(session)(p1.Title.Substring(0, 5).ToUpper()); Assert.IsTrue(res.Contains(p1)); }