private void SetNA() { try { var id = new Guid("B25ED1C0-852F-11E7-BB31-BE2E44B06B34"); SelectedCoupleDiscordant = CoupleDiscordantOptions.FirstOrDefault(x => x.ItemId == id); } catch { } //throw new NotImplementedException(); }
private void LoadTests() { if (null != Encounter) { var tests = Encounter.ObsTestResults.Where(x => x.TestName == FirstTestEpisodeViewModel.TestName) .ToList(); foreach (var obsTestResult in tests) { try { obsTestResult.ResultDisplay = FirstTestResults.FirstOrDefault(x => x.ItemId == obsTestResult.Result).Display; obsTestResult.KitDisplay = Kits.FirstOrDefault(x => x.ItemId == obsTestResult.Kit).Display; } catch (Exception e) { } } FirstTestEpisodeViewModel.Tests = tests; var tests2 = Encounter.ObsTestResults.Where(x => x.TestName == SecondTestEpisodeViewModel.TestName) .ToList(); foreach (var obsTestResult in tests2) { try { obsTestResult.ResultDisplay = SecondTestResults .FirstOrDefault(x => x.ItemId == obsTestResult.Result).Item.Display; obsTestResult.KitDisplay = Kits.FirstOrDefault(x => x.ItemId == obsTestResult.Kit).Display; } catch (Exception e) { } } SecondTestEpisodeViewModel.Tests = tests2; var finalResult = ObsFinalTestResult = Encounter.ObsFinalTestResults.ToList().FirstOrDefault(); if (null != finalResult) { // Test 1 var result1 = FirstTestResults.FirstOrDefault(x => x.ItemId == finalResult.FirstTestResult); if (null != result1) { SelectedFirstTestResult = result1; } else { SelectedFirstTestResult = FinalTestResults.OrderBy(x => x.Rank).FirstOrDefault(); } // Test 2 var result2 = SecondTestResults.FirstOrDefault(x => x.ItemId == finalResult.SecondTestResult); if (null != result2) { SelectedSecondTestResult = result2; } else { SelectedSecondTestResult = SecondTestResults.OrderBy(x => x.Rank).FirstOrDefault(); } // Final var result3 = FinalTestResults.FirstOrDefault(x => x.ItemId == finalResult.FinalResult); if (null != result3) { SelectedFinalTestResult = result3; } else { SelectedFinalTestResult = FinalTestResults.OrderBy(x => x.Rank).FirstOrDefault(); } // Result given var resultg = ResultGivenOptions.FirstOrDefault(x => x.ItemId == finalResult.ResultGiven); if (null != resultg) { SelectedResultGiven = resultg; } else { SelectedResultGiven = ResultGivenOptions.OrderBy(x => x.Rank).FirstOrDefault(); } // couple discodant var resultcd = CoupleDiscordantOptions.FirstOrDefault(x => x.ItemId == finalResult.CoupleDiscordant); if (null != resultcd) { SelectedCoupleDiscordant = resultcd; } else { SelectedCoupleDiscordant = CoupleDiscordantOptions.OrderBy(x => x.Rank).FirstOrDefault(); } var isIndividial = _settings.GetValue("client.disco", false); EnableCoupleDiscordant = !isIndividial; // Self test var resultst = SelfTestOptions.FirstOrDefault(x => x.ItemId == finalResult.SelfTestOption); if (null != resultst) { SelectedSelfTest = resultst; } else { SelectedSelfTest = SelfTestOptions.OrderBy(x => x.Rank).FirstOrDefault(); } // PnsDeclined var resultpst = PnsDeclineds.FirstOrDefault(x => x.ItemId == finalResult.PnsDeclined); if (null != resultpst) { SelectedPnsDeclined = resultpst; } else { SelectedPnsDeclined = PnsDeclineds.OrderBy(x => x.Rank).FirstOrDefault(); } // Remarks Remarks = finalResult.Remarks; } } }