Ejemplo n.º 1
0
        public static bool VerifyAssociation(IDicomServerContext context, AssociationParameters assocParms, out DicomRejectResult result, out DicomRejectReason reason)
        {
            string calledTitle = (assocParms.CalledAE ?? "").Trim();
            string callingAE   = (assocParms.CallingAE ?? "").Trim();

            result = DicomRejectResult.Permanent;
            reason = DicomRejectReason.NoReasonGiven;

            var extendedConfiguration = LocalDicomServer.GetExtendedConfiguration();

            if (!extendedConfiguration.AllowUnknownCaller && ServerDirectory.GetRemoteServersByAETitle(callingAE).Count == 0)
            {
                reason = DicomRejectReason.CallingAENotRecognized;
            }
            else if (calledTitle != context.AETitle)
            {
                reason = DicomRejectReason.CalledAENotRecognized;
            }
            else
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        public DicomServer()
        {
            _aeTitle = string.Empty;
            _host = string.Empty;
            _port = 104;

            _context = new DicomServerContext();
            _scp = new DicomScp<IDicomServerContext>(_context, AssociationVerifier.VerifyAssociation);
        }
Ejemplo n.º 3
0
        public DicomServer(DicomServerConfiguration serverConfiguration)
        {
            _aeTitle = serverConfiguration.AETitle;
            _host    = serverConfiguration.HostName;
            _port    = serverConfiguration.Port;

            _context = new DicomServerContext(this);
            _scp     = new DicomScp <IDicomServerContext>(_context, AssociationVerifier.VerifyAssociation);
        }
Ejemplo n.º 4
0
		public DicomServer(DicomServerConfiguration serverConfiguration)
		{
			_aeTitle = serverConfiguration.AETitle;
            _host = serverConfiguration.HostName;
			_port = serverConfiguration.Port;

			_context = new DicomServerContext(this);
			_scp = new DicomScp<IDicomServerContext>(_context, AssociationVerifier.VerifyAssociation);
		}
Ejemplo n.º 5
0
        public static bool VerifyAssociation(IDicomServerContext context, AssociationParameters assoParams, 
            out DicomRejectResult result, out DicomRejectReason reason)
        {
            string calledAET = (assoParams.CalledAE ?? "").Trim();
            string callingAET = (assoParams.CallingAE ?? "").Trim();

            result = DicomRejectResult.Permanent;
            reason = DicomRejectReason.NoReasonGiven;

            return true;
        }
		public StorageFilestreamHandler(IDicomServerContext context, DicomReceiveImportContext importContext)
		{
			_context = context;
			_importContext = importContext;

			if (LocalStorageMonitor.IsMaxUsedSpaceExceeded)
			{
				//The input to this method is a VALID DICOM file, and we know we should have stored it if it weren't for
				//the fact that we're out of disk space. So, we insert the work item UID anyway, knowing that it'll cause
				//the work item to fail. In fact, that's why we're doing it.
				_rejectFile = true;
			}

			if (!File.Exists(_context.StorageConfiguration.FileStoreIncomingFolder))
				Directory.CreateDirectory(_context.StorageConfiguration.FileStoreIncomingFolder);
		}
Ejemplo n.º 7
0
        public StorageFilestreamHandler(IDicomServerContext context, DicomReceiveImportContext importContext)
        {
            _context       = context;
            _importContext = importContext;

            if (LocalStorageMonitor.IsMaxUsedSpaceExceeded)
            {
                //The input to this method is a VALID DICOM file, and we know we should have stored it if it weren't for
                //the fact that we're out of disk space. So, we insert the work item UID anyway, knowing that it'll cause
                //the work item to fail. In fact, that's why we're doing it.
                _rejectFile = true;
            }

            if (!File.Exists(_context.StorageConfiguration.FileStoreIncomingFolder))
            {
                Directory.CreateDirectory(_context.StorageConfiguration.FileStoreIncomingFolder);
            }
        }
Ejemplo n.º 8
0
		public static bool VerifyAssociation(IDicomServerContext context, AssociationParameters assocParms, out DicomRejectResult result, out DicomRejectReason reason)
		{
			string calledTitle = (assocParms.CalledAE ?? "").Trim();
			string callingAE = (assocParms.CallingAE ?? "").Trim();

			result = DicomRejectResult.Permanent;
			reason = DicomRejectReason.NoReasonGiven;

		    var extendedConfiguration = LocalDicomServer.GetExtendedConfiguration();
            if (!extendedConfiguration.AllowUnknownCaller && ServerDirectory.GetRemoteServersByAETitle(callingAE).Count == 0)
			{
				reason = DicomRejectReason.CallingAENotRecognized;
			}
			else if (calledTitle != context.AETitle)
			{
				reason = DicomRejectReason.CalledAENotRecognized;
			}
			else
			{
				return true;
			}

			return false;
		}