Esempio n. 1
0
        public void RetrieveSeries()
        {
            if (!Enabled || SelectedSeries.Count == 0)
            {
                return;
            }

            var client     = new DicomRetrieveBridge();
            var seriesUids = Context.SelectedSeries.Select(item => item.SeriesInstanceUid).ToList();

            try
            {
                client.RetrieveSeries(Server, Context.Study, seriesUids.ToArray());

                DateTime?studyDate = DateParser.Parse(Context.Study.StudyDate);
                Context.DesktopWindow.ShowAlert(AlertLevel.Info,
                                                string.Format(SR.MessageFormatRetrieveSeriesScheduled, seriesUids.Count,
                                                              Server.Name, Context.Study.PatientsName.FormattedName, studyDate.HasValue ? Format.Date(studyDate.Value) : string.Empty,
                                                              Context.Study.AccessionNumber),
                                                SR.LinkOpenActivityMonitor, ActivityMonitorManager.Show, true);
            }
            catch (EndpointNotFoundException)
            {
                Context.DesktopWindow.ShowMessageBox(SR.MessageRetrieveDicomServerServiceNotRunning, MessageBoxActions.Ok);
            }
            catch (Exception ex)
            {
                ExceptionHandler.Report(ex, SR.MessageFailedToRetrieveSeries, Context.DesktopWindow);
            }

            //TODO (CR Sept 2010): put a Close method on the context, or put a property on SeriesDetailsTool
            //that somehow allows a tool to flag that when it is clicked, the component should close.
            //if (result == EventResult.Success)
            //	SeriesDetailsComponent.Close();
        }
        private void RetrieveStudy()
        {
            if (!Enabled || Context.SelectedServers.IsLocalServer || Context.SelectedStudy == null)
            {
                return;
            }

            try
            {
                var client = new DicomRetrieveBridge();
                if (Context.SelectedStudies.Count > 1)
                {
                    var count = ProcessItemsAsync(Context.SelectedStudies, study => client.RetrieveStudy(study.Server, study), false);
                    AlertMultipleStudiesRetrieved(count);
                }
                else if (Context.SelectedStudies.Count == 1)
                {
                    var study = Context.SelectedStudies.First();
                    client.RetrieveStudy(study.Server, study);
                    AlertStudyRetrieved(study);
                }
            }
            catch (EndpointNotFoundException)
            {
                Context.DesktopWindow.ShowMessageBox(SR.MessageRetrieveDicomServerServiceNotRunning, MessageBoxActions.Ok);
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, SR.MessageErrorRetrievingStudies, Context.DesktopWindow);
            }
        }