void license_LicenseChanged(object sender, EventArgs e) { if (!AddInsSession.IsLicenseValid()) { DicomServer server = ServiceLocator.Retrieve <DicomServer>(); Logger.Global.SystemMessage(LogType.Information, "Worklist license is valid.", server.AETitle); } }
public DicomCommandStatusType OnNSet ( DicomClient Client, byte presentationID, int messageID, string affectedClass, string instance, DicomDataSet Request, DicomDataSet Response ) { ClientSession clientSession; NSetClientSessionProxy sessionProxy; DicomCommand mppsCommand; if (!AddInsSession.IsLicenseValid()) { Logger.Global.SystemMessage(LogType.Information, "Worklist license not valid. Worklist set cannot be performed", Client.AETitle); return(DicomCommandStatusType.ProcessingFailure); } clientSession = new ClientSession(Client); sessionProxy = new NSetClientSessionProxy(clientSession, presentationID, messageID, affectedClass, instance); if (null == DicomCommandFactory.GetInitializationService(typeof(MppsNSetCommand))) { DicomCommandFactory.RegisterCommandInitializationService(typeof(MppsNSetCommand), new MppsSetCommandInitializationService( )); } mppsCommand = DicomCommandFactory.GetInstance( ).CreateNSetCommand(sessionProxy, Request); _clientSession = clientSession; _sessionProxy = sessionProxy; clientSession.NSetResponse += new EventHandler <NSetResponseEventArgs>(clientSession_NSetResponse); clientSession.ProcessNSetRequest(presentationID, messageID, affectedClass, instance, mppsCommand).WaitOne( ); Response = _response; return(_status); }
public override void Load(string serviceDirectory, string displayName) { List <string> unlockedSerivces; DicomService service; InitializeLicense(); base.Load(serviceDirectory, displayName); unlockedSerivces = new List <string> ( ); ServiceDirectory = serviceDirectory; DisplayName = displayName; RegisterDataAccessAgents(displayName); unlockedSerivces.Add(displayName); using (ServiceAdministrator serviceAdmin = new ServiceAdministrator(serviceDirectory)) { //Add the key #if LEADTOOLS_V175_OR_LATER serviceAdmin.Initialize(unlockedSerivces); #else serviceAdmin.Unlock(string.Empty, unlockedSerivces); #endif if (serviceAdmin.Services.ContainsKey(displayName)) { service = serviceAdmin.Services [displayName]; ServerAE = service.Settings.AETitle; ServerAddress = service.Settings.IpAddress; ServerPort = service.Settings.Port; } } if (!AddInsSession.IsLicenseValid()) { DicomServer server = ServiceLocator.Retrieve <DicomServer>(); Logger.Global.SystemMessage(LogType.Information, "Worklist license not valid. Worklist search cannot be performed", server.AETitle); } }
public DicomCommandStatusType OnFind ( DicomClient Client, byte PresentationId, int MessageId, string AffectedClass, DicomCommandPriorityType Priority, DicomDataSet Request ) { ClientSession clientSession; CFindClientSessionProxy sessionProxy; DicomCommand mwlCommand; if (!AddInsSession.IsLicenseValid()) { Logger.Global.SystemMessage(LogType.Information, "Worklist license not valid. Worklist search cannot be performed", Client.AETitle); return(DicomCommandStatusType.ProcessingFailure); } clientSession = new ClientSession(Client); sessionProxy = new CFindClientSessionProxy(clientSession, PresentationId, MessageId, AffectedClass); if (null == DicomCommandFactory.GetInitializationService(typeof(MWLCFindCommand))) { DicomCommandFactory.RegisterCommandInitializationService(typeof(MWLCFindCommand), new MWLCommandInitializationService( )); } mwlCommand = DicomCommandFactory.GetInstance( ).CreateCFindCommand(sessionProxy, Request); _clientSession = clientSession; _sessionProxy = sessionProxy; clientSession.CFindResponse += new EventHandler <Leadtools.Dicom.Scp.CFindResponseEventArgs> (clientSession_CFindResponse); clientSession.ProcessCFindRequest(PresentationId, MessageId, AffectedClass, Priority, mwlCommand).WaitOne( ); return(_status); }
public DicomCommandStatusType OnNCreate ( DicomClient Client, byte presentationID, int messageID, string affectedClass, string instance, DicomDataSet Request, DicomDataSet Response ) { try { ClientSession clientSession; MppsNCreateCommand mppsCommand; if (!AddInsSession.IsLicenseValid()) { Logger.Global.SystemMessage(LogType.Information, "Worklist license not valid. Worklist creation cannot be performed", Client.AETitle); return(DicomCommandStatusType.ProcessingFailure); } clientSession = new ClientSession(Client); _sessionProxy = new NCreateClientSessionProxy(clientSession, presentationID, messageID, affectedClass, instance); if (null == DicomCommandFactory.GetInitializationService(typeof(MppsNCreateCommand))) { DicomCommandFactory.RegisterCommandInitializationService(typeof(MppsNCreateCommand), new MppsCreateCommandInitializationService( )); } mppsCommand = DicomCommandFactory.GetInstance( ).CreateTypedCommand <MppsNCreateCommand> (_sessionProxy, Request); clientSession.NCreateResponse += new EventHandler <NCreateResponseEventArgs>(clientSession_NCreateResponse); mppsCommand.PPSConfiguration.ValidateRelationalAttributesAccordingToIHE = true; _response = Response; clientSession.ProcessNCreateRequest(presentationID, messageID, affectedClass, instance, mppsCommand).WaitOne( ); return(_status); } catch (Exception exception) { Logger.Global.Log(Client.Server.AETitle, Client.Server.HostAddress, Client.Server.Port, Client.AETitle, Client.PeerAddress, Client.PeerPort, DicomCommandType.NCreate, DateTime.Now, LogType.Error, MessageDirection.Input, "NCreate Failed: " + exception.Message, Request, null); throw; } }