Exemple #1
0
        public void DeleteStudy()
        {
            if (!Enabled)
            {
                return;
            }

            if (AtLeastOneStudyInUse())
            {
                return;
            }

            if (!ConfirmDeletion())
            {
                return;
            }

            try
            {
                var client = new DeleteBridge();
                if (Context.SelectedStudies.Count > 1)
                {
                    var count = ProcessItemsAsync(Context.SelectedStudies, client.DeleteStudy, false);
                    AlertMultipleStudiesDeleted(count);
                }
                else if (Context.SelectedStudies.Count == 1)
                {
                    var study = Context.SelectedStudies.First();
                    client.DeleteStudy(study);
                    AlertStudyDeleted(study);
                }
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, SR.MessageErrorDeletingStudies, Context.DesktopWindow);
            }
        }
        public void DeleteSeries()
        {
            if (!Enabled)
            {
                return;
            }

            if (StudyInUse())
            {
                return;
            }

            if (!ConfirmDeletion())
            {
                return;
            }

            try
            {
                var client     = new DeleteBridge();
                var seriesList = Context.SelectedSeries.Select(series => series.SeriesInstanceUid).ToList();
                client.DeleteSeries(Context.Study, seriesList);

                DateTime?studyDate = DateParser.Parse(Context.Study.StudyDate);
                Context.DesktopWindow.ShowAlert(AlertLevel.Info,
                                                String.Format(SR.MessageFormatDeleteSeriesScheduled, Context.SelectedSeries.Count, Context.Study.PatientsName.FormattedName, studyDate.HasValue ? Format.Date(studyDate.Value) : string.Empty,
                                                              Context.Study.AccessionNumber),
                                                SR.LinkOpenActivityMonitor, ActivityMonitorManager.Show, true);

                Context.RefreshSeriesTable();
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, SR.MessageFailedToDeleteSeries, Context.DesktopWindow);
            }
        }