private void GetDistinctRadiologyTests(TestCollection Tests) { var distinctRadiologyTests = (from t in Tests where t.IsRadiologyTest select t); distinctRadiologyTests.ToList(); this.radiologyTests = new TestResultViewModelCollection(); foreach (Test t in distinctRadiologyTests) { TestResultViewModel testResultViewModel = new TestResultViewModel(this.mainWindowViewModel.SelectedPatient.Admittance, t); this.radiologyTests.Add(testResultViewModel); } }
private void GetDistinctLabTests(TestCollection Tests) { //I need to distinctly compare test type names. This is different then the others. The cardio and radio //collections need only be distinct by test type. This is being used to give me my rows so I have to //base the collection just on testtype so the custom comparer is used rather then a where clause. var distinctLabTests = (from t in Tests select t).Distinct(new TestTypeComparer()); distinctLabTests.ToList(); this.distinctLabTests = new TestResultViewModelCollection(); foreach (Test t in distinctLabTests) { TestResultViewModel testResultViewModel = new TestResultViewModel(this.mainWindowViewModel.SelectedPatient.Admittance, t); this.distinctLabTests.Add(testResultViewModel); } }