private static StudyItemList Query(QueryParameters queryParams, List <KeyValuePair <string, Exception> > failedServerInfo, List <IServerTreeNode> servers) { StudyItemList aggregateStudyItemList = new StudyItemList(); foreach (IServerTreeNode serverNode in servers) { try { StudyItemList serverStudyItemList; if (serverNode.IsLocalDataStore) { serverStudyItemList = ImageViewerComponent.FindStudy(queryParams, null, "DICOM_LOCAL"); } else if (serverNode.IsServer) { Server server = (Server)serverNode; ApplicationEntity ae = new ApplicationEntity( server.Host, server.AETitle, server.Name, server.Port, server.IsStreaming, server.HeaderServicePort, server.WadoServicePort); serverStudyItemList = ImageViewerComponent.FindStudy(queryParams, ae, "DICOM_REMOTE"); } else { throw new Exception("Server is not queryable"); } aggregateStudyItemList.AddRange(serverStudyItemList); } catch (Exception e) { // keep track of the failed server names and exceptions failedServerInfo.Add(new KeyValuePair <string, Exception>(serverNode.Name, e)); } } return(aggregateStudyItemList); }
public override StudyItemList Query(QueryParameters queryParams, IApplicationEntity targetServer) { var studyItems = new StudyItemList(); var tmp = targetServer as MediaFileSet; try { if (tmp != null) { studyItems.AddRange(tmp.Studies.Select(study => new StudyItem(study, tmp))); } } catch (Exception e) { Platform.Log(LogLevel.Warn, e.Message); } return(studyItems); }
private static StudyItemList Query(QueryParameters queryParams, List<KeyValuePair<string, Exception>> failedServerInfo, List<IServerTreeNode> servers) { var aggregateStudyItemList = new StudyItemList(); foreach (var serverNode in servers) { try { StudyItemList serverStudyItemList; if (serverNode.IsLocalDataStore) { serverStudyItemList = ImageViewerComponent.FindStudy(queryParams, null, "DICOM_LOCAL"); } else if (serverNode.IsServer) { var server = (Server)serverNode; var ae = new ApplicationEntity( server.Host, server.AETitle, server.Name, server.Port, server.IsStreaming, server.HeaderServicePort, server.WadoServicePort); serverStudyItemList = ImageViewerComponent.FindStudy(queryParams, ae, "DICOM_REMOTE"); } else { throw new Exception("Server is not queryable"); } aggregateStudyItemList.AddRange(serverStudyItemList); } catch (Exception e) { failedServerInfo.Add(new KeyValuePair<string, Exception>(serverNode.Name, e)); } } return aggregateStudyItemList; }