private void CalculateEstimatedFixationDuration() { foreach (EmbeddingBreastCaseListItem item in this.m_EmbeddingBreastCaseList) { if (item.FixationStartTime.HasValue == true) { if (item.FixationEndTime.HasValue == false) { if (DateTime.Today.DayOfWeek == DayOfWeek.Friday) { DateTime sundayAt550 = DateTime.Parse(DateTime.Today.AddDays(2).ToString("yyyy-MM-dd") + "T17:50"); Business.Surgical.ProcessorRun run = new Business.Surgical.ProcessorRun("Sunday", sundayAt550, new TimeSpan(2, 30, 0)); DateTime expectedFixationEndTime = run.GetFixationEndTime(item.FixationStartTime.Value); TimeSpan expectedDurationTS = expectedFixationEndTime.Subtract(item.FixationStartTime.Value); item.FixationDurationExpected = Convert.ToInt32(Math.Round(expectedDurationTS.TotalHours, 0)); } else { DateTime todayAtFive = DateTime.Parse(DateTime.Today.ToString("yyyy-MM-dd") + "T17:00"); Business.Surgical.ProcessorRun run = new Business.Surgical.ProcessorRun("Today", todayAtFive, new TimeSpan(2, 30, 0)); DateTime expectedFixationEndTime = run.GetFixationEndTime(item.FixationStartTime.Value); TimeSpan expectedDurationTS = expectedFixationEndTime.Subtract(item.FixationStartTime.Value); item.FixationDurationExpected = Convert.ToInt32(Math.Round(expectedDurationTS.TotalHours, 0)); } } } } }
private void ComboBoxProcessorRun_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (this.ComboBoxProcessorRuns.SelectedItem != null) { Business.Surgical.ProcessorRun run = (Business.Surgical.ProcessorRun) this.ComboBoxProcessorRuns.SelectedItem; this.m_ProcessorStartTime = run.StartTime; this.m_ProcessorFixationDuration = run.FixationDuration; this.NotifyPropertyChanged(string.Empty); } }
private bool HandleBreastFixationTime() { bool result = true; if (string.IsNullOrEmpty(this.m_ClientOrderDetail.DescriptionToAccession) == false) { if (this.m_ClientOrderDetail.DescriptionToAccession.ToUpper().Contains("BREAST") == true) { if (YellowstonePathology.Business.Helper.DateTimeExtensions.DoesDateHaveTime(this.m_ClientOrderDetail.CollectionDate) == false) { MessageBoxResult collectionDateResult = MessageBox.Show("This case appears to be a breast case and there is no Collection Time. Are you sure you want to continue?", "Continue?", MessageBoxButton.YesNo); if (collectionDateResult == MessageBoxResult.No) { result = false; } } else { if (this.m_ClientOrderDetail.FixationStartTime.HasValue == true) { DateTime todayAt500 = DateTime.Parse(DateTime.Today.ToString("yyyy-MM-dd") + "T17:00"); Business.Surgical.ProcessorRun run = new Business.Surgical.ProcessorRun("This Afternoon", todayAt500, new TimeSpan(2, 30, 0)); DateTime fixationEndTime = run.GetFixationEndTime(this.m_ClientOrderDetail.FixationStartTime.Value); TimeSpan fixationDuration = fixationEndTime.Subtract(this.m_ClientOrderDetail.FixationStartTime.Value); if (fixationDuration.TotalHours < 6) { MessageBox.Show("Warning! Fixation duration will be under 6 hours unless this specimen is held."); } else if (fixationDuration.TotalHours > 72) { MessageBox.Show("Warning! Fixation duration will be over 72 hours if processed normally."); } } } } } return(result); }
private bool HandleBreastFixationTime() { bool result = true; if(string.IsNullOrEmpty(this.m_ClientOrderDetail.DescriptionToAccession) == false) { if (this.m_ClientOrderDetail.DescriptionToAccession.ToUpper().Contains("BREAST") == true) { if (YellowstonePathology.Business.Helper.DateTimeExtensions.DoesDateHaveTime(this.m_ClientOrderDetail.CollectionDate) == false) { MessageBoxResult collectionDateResult = MessageBox.Show("This case appears to be a breast case and there is no Collection Time. Are you sure you want to continue?", "Continue?", MessageBoxButton.YesNo); if (collectionDateResult == MessageBoxResult.No) result = false; } else { if(this.m_ClientOrderDetail.FixationStartTime.HasValue == true) { Business.Surgical.ProcessorRun processorRun = new Business.Surgical.ProcessorRun("Standard Run", DateTime.Parse(DateTime.Today.ToString("yyyy-MM-dd") + "T17:50"), new TimeSpan(2, 30, 0)); DateTime fixationEndTime = processorRun.GetFixationEndTime(this.m_ClientOrderDetail.FixationStartTime.Value); TimeSpan fixationDuration = fixationEndTime.Subtract(this.m_ClientOrderDetail.FixationStartTime.Value); if (fixationDuration.TotalHours < 6) { MessageBox.Show("Warning! Fixation duration will be under 6 hours unless this specimen is held."); } else if (fixationDuration.TotalHours > 72) { MessageBox.Show("Warning! Fixation duration will be over 72 hours if processed normally."); } } } } } return result; }