public void Apply()
        {
            ISelection selection = base.Context.Selection;

            if (selection == null || selection.Items == null)
            {
                return;
            }

            List <RetrieveQueryItem> queryItems = new List <RetrieveQueryItem>();

            foreach (NBIASearchResult result in selection.Items)
            {
                if (!string.IsNullOrEmpty(result.Study.StudyInstanceUid))
                {
                    RetrieveQueryItem queryItem = new RetrieveQueryItem();
                    queryItem.Study.StudyInstanceUid   = result.Study.StudyInstanceUid;
                    queryItem.Patient.PatientBirthDate = result.Patient.PatientBirthDate;
                    queryItem.Patient.PatientId        = result.Patient.PatientId;
                    queryItem.Patient.PatientsName     = result.Patient.PatientsName;
                    queryItem.Patient.PatientsSex      = result.Patient.PatientsSex;
                    Series series = new Series();
                    series.Modality          = result.Series.Modality;
                    series.SeriesInstanceUid = result.Series.SeriesInstanceUid;
                    queryItem.Series.Add(series);

                    queryItems.Add(queryItem);
                }
            }

            RetrieveCoordinator.Coordinator.RetrieveStudies(queryItems);
        }
        public void Apply()
        {
            ISelection selection = base.Context.Selection;
            if (selection == null || selection.Items == null)
                return;

            List<RetrieveQueryItem> queryItems = new List<RetrieveQueryItem>();
            foreach (NBIASearchResult result in selection.Items)
            {
                if (!string.IsNullOrEmpty(result.Study.StudyInstanceUid))
                {
                    RetrieveQueryItem queryItem = new RetrieveQueryItem();
                    queryItem.Study.StudyInstanceUid = result.Study.StudyInstanceUid;
                    queryItem.Patient.PatientBirthDate = result.Patient.PatientBirthDate;
                    queryItem.Patient.PatientId = result.Patient.PatientId;
                    queryItem.Patient.PatientsName = result.Patient.PatientsName;
                    queryItem.Patient.PatientsSex = result.Patient.PatientsSex;
                    Series series = new Series();
                    series.Modality = result.Series.Modality;
                    series.SeriesInstanceUid = result.Series.SeriesInstanceUid;
                    queryItem.Series.Add(series);

                    queryItems.Add(queryItem);
                }
            }

            RetrieveCoordinator.Coordinator.RetrieveStudies(queryItems);
        }
        public void Apply()
        {
            ISelection selection = base.Context.Selection;

            if (selection == null || selection.Item == null)
            {
                return;
            }

            if (!LocalDataStoreActivityMonitor.IsConnected)
            {
                this.Context.DesktopWindow.ShowMessageBox(
                    "Not connected to the local data store. Is workstation service running?", MessageBoxActions.Ok);
                return;
            }

            this.RetrieveAnnotationsFromAimService(selection.Items);

            List <RetrieveQueryItem> queryItems = new List <RetrieveQueryItem>();

            foreach (AIMSearchResult result in selection.Items)
            {
                if (!string.IsNullOrEmpty(result.Study.StudyInstanceUid))
                {
                    RetrieveQueryItem queryItem = new RetrieveQueryItem();
                    queryItem.Study.StudyInstanceUid   = result.Study.StudyInstanceUid;
                    queryItem.Patient.PatientBirthDate = result.Patient.PatientBirthDate;
                    queryItem.Patient.PatientId        = result.Patient.PatientId;
                    queryItem.Patient.PatientsName     = result.Patient.PatientsName;
                    queryItem.Patient.PatientsSex      = result.Patient.PatientsSex;
                    Series series = new Series();
                    series.Modality          = result.Series.Modality;
                    series.SeriesInstanceUid = result.Series.SeriesInstanceUid;
                    queryItem.Series.Add(series);

                    queryItems.Add(queryItem);
                }
            }

            RetrieveCoordinator.Coordinator.RetrieveStudies(queryItems);
        }
        public void Apply()
        {
            ISelection selection = base.Context.Selection;
            if (selection == null || selection.Item == null)
                return;

            if (!LocalDataStoreActivityMonitor.IsConnected)
            {
                this.Context.DesktopWindow.ShowMessageBox(
                    "Not connected to the local data store. Is workstation service running?", MessageBoxActions.Ok);
                return;
            }

            this.RetrieveAnnotationsFromAimService(selection.Items);

            List<RetrieveQueryItem> queryItems = new List<RetrieveQueryItem>();
            foreach (AIMSearchResult result in selection.Items)
            {
                if (!string.IsNullOrEmpty(result.Study.StudyInstanceUid))
                {
                    RetrieveQueryItem queryItem = new RetrieveQueryItem();
                    queryItem.Study.StudyInstanceUid = result.Study.StudyInstanceUid;
                    queryItem.Patient.PatientBirthDate = result.Patient.PatientBirthDate;
                    queryItem.Patient.PatientId = result.Patient.PatientId;
                    queryItem.Patient.PatientsName = result.Patient.PatientsName;
                    queryItem.Patient.PatientsSex = result.Patient.PatientsSex;
                    Series series = new Series();
                    series.Modality = result.Series.Modality;
                    series.SeriesInstanceUid = result.Series.SeriesInstanceUid;
                    queryItem.Series.Add(series);

                    queryItems.Add(queryItem);
                }
            }

            RetrieveCoordinator.Coordinator.RetrieveStudies(queryItems);
        }