Esempio n. 1
0
        /// <summary>
        /// Opens the given study.
        /// </summary>
        public Viewer OpenStudies(List <OpenStudyInfo> studiesToOpen)
        {
            var request = new OpenStudiesRequest
            {
                ActivateIfAlreadyOpen = _openStudiesBehaviour.ActivateExistingViewer,
                ReportFaultToUser     = _openStudiesBehaviour.ReportFaultToUser,
                StudiesToOpen         = studiesToOpen
            };

            return(_viewerAutomationClient.OpenStudies(request).Viewer);
        }
            public Viewer OpenViewer(IList <StudyRootStudyIdentifier> studyRootStudyIdentifiers)
            {
                try
                {
                    var request = new OpenStudiesRequest
                    {
                        ActivateIfAlreadyOpen = false,                          // we want to control this manually
                        ReportFaultToUser     = true,
                        StudiesToOpen         = studyRootStudyIdentifiers.Select(i => new OpenStudyInfo(i)).ToList()
                    };

                    var result = _viewerAutomation.OpenStudies(request);
                    return(result.Viewer);
                }
                catch (FaultException <StudyNotFoundFault> e) { throw new OpenStudyException(studyRootStudyIdentifiers, e); }
                catch (FaultException <StudyOfflineFault> e) { throw new OpenStudyException(studyRootStudyIdentifiers, e); }
                catch (FaultException <StudyNearlineFault> e) { throw new OpenStudyException(studyRootStudyIdentifiers, e); }
                catch (FaultException <StudyInUseFault> e) { throw new OpenStudyException(studyRootStudyIdentifiers, e); }
                catch (FaultException <OpenStudiesFault> e) { throw new OpenStudyException(studyRootStudyIdentifiers, e); }
            }