Esempio n. 1
0
        public static ApplicationEntity ToDataContract(this Server server)
        {
            var ae = new ApplicationEntity
                         {
                             Name = server.NameOfServer,
                             AETitle = server.AETitle,
                             Location = server.Location,
                             ScpParameters = new ScpParameters(server.Host, server.Port)
                         };

            if (server.IsStreaming)
                ae.StreamingParameters = new StreamingParameters(server.HeaderServicePort, server.WadoServicePort);

            return ae;
        }
Esempio n. 2
0
        public static ApplicationEntity ToDataContract(this IServerTreeDicomServer server)
        {
            Platform.CheckForNullReference(server, "server");
            var ae = new ApplicationEntity
                         {
                             Name = server.Name, 
                             AETitle = server.AETitle,
                             Location = server.Location,
                             ScpParameters = new ScpParameters(server.HostName, server.Port)
                         };

            if (server.IsStreaming)
                ae.StreamingParameters = new StreamingParameters(server.HeaderServicePort, server.WadoServicePort);
            
            return ae;
        }
Esempio n. 3
0
        public static ServerDirectoryEntry ToDataContract(this Device device)
        {
            bool isStreaming = device.StreamingHeaderPort != null && device.StreamingImagePort != null;
            var server = new ApplicationEntity
                                           {
                                               Name = device.Name,
                                               AETitle = device.AETitle,
                                               ScpParameters = new ScpParameters(device.HostName, device.Port),
                                               Location = device.Location,
                                               Description = device.Description
                                           };

            if (isStreaming)
                server.StreamingParameters = new StreamingParameters(device.StreamingHeaderPort.Value, device.StreamingImagePort.Value);

            Dictionary<string, object> extensionData = null;
            if (device.ExtensionData != null)
                extensionData = Serializer.DeserializeServerExtensionData(device.ExtensionData);

            return new ServerDirectoryEntry(server) {IsPriorsServer = device.IsPriorsServer, Data = extensionData};
        }
Esempio n. 4
0
        private ApplicationEntity CreateServer(string name, bool streaming)
        {
            var ae = new ApplicationEntity
            {
                Name = name,
                AETitle = "ae",
                ScpParameters = new ScpParameters{HostName = "host", Port = 104},
                Description = "Some server",
                Location = "Room 101"
            };

            if (streaming)
                ae.StreamingParameters = new StreamingParameters(50221, 1000);
            return ae;
        }
Esempio n. 5
0
        public static LoadStudyArgs CreateLoadStudyArgs(StudyRootStudyIdentifier identifier)
        {

            // TODO: Need to think about this more. What's the best way to swap different loader?
            // Do we need to support loading studies from multiple servers? 

            string host = WebViewerServices.Default.ArchiveServerHostname;
            int port = WebViewerServices.Default.ArchiveServerPort;

            int headerPort = WebViewerServices.Default.ArchiveServerHeaderPort;
            int wadoPort = WebViewerServices.Default.ArchiveServerWADOPort;

            var serverAe = new ApplicationEntity
                               {
                                   ScpParameters = new ScpParameters(host, port),
                                   StreamingParameters = new StreamingParameters(headerPort, wadoPort),
                                   AETitle = identifier.RetrieveAeTitle
                               };


            // TODO (Marmot) - Need to figure out how this works with the changes for Marmot
            return new LoadStudyArgs(identifier.StudyInstanceUid, ServiceNodeExtensions.ToServiceNode(serverAe));
        }
Esempio n. 6
0
		private StudyItem ConvertToStudyItem(StudyRootStudyIdentifier study)
		{
			string studyLoaderName;
		    ApplicationEntity applicationEntity;

		    ServerPartition partiton = ServerPartitionMonitor.Instance.GetPartition(study.RetrieveAeTitle);
			if (partiton != null)
			{
                studyLoaderName = WebViewerServices.Default.StudyLoaderName;
                string host = WebViewerServices.Default.ArchiveServerHostname;
                int port = WebViewerServices.Default.ArchiveServerPort;
                int headerPort = WebViewerServices.Default.ArchiveServerHeaderPort;
                int wadoPort = WebViewerServices.Default.ArchiveServerWADOPort;

			    applicationEntity = new ApplicationEntity()
			                            {
                                            AETitle = study.RetrieveAeTitle,
			                                ScpParameters = new ScpParameters(host, port),
			                                StreamingParameters = new StreamingParameters(headerPort, wadoPort)
			                            };

			}
            else
			{
			    Device theDevice = FindServer(study.RetrieveAeTitle);

                if (theDevice != null)
			    {
		            // TODO (Marmot) - Need to get this to work with changes in marmot
			        applicationEntity = new ApplicationEntity() { ScpParameters = new ScpParameters(theDevice.IpAddress, theDevice.Port), AETitle = theDevice.AeTitle };
			    }
			    else // (node == null)
			    {
			        Platform.Log(LogLevel.Warn,
			                     String.Format("Unable to find server information '{0}' in order to load study '{1}'",
			                                   study.RetrieveAeTitle, study.StudyInstanceUid));

			        return null;
			    }
			}

		    var item = new StudyItem(study, ServiceNodeExtensions.ToServiceNode(applicationEntity));
			if (String.IsNullOrEmpty(item.InstanceAvailability))
				item.InstanceAvailability = "ONLINE";

			return item;
		}