public bool CanAccessDatabase(out string error) { error = string.Empty; bool ret = false; try { System.Configuration.Configuration configuration = DicomDemoSettingsManager.GetGlobalPacsAddinsConfiguration(Module.ServiceDirectory); IStorageDataAccessAgent storageAgent = GetAgent <IStorageDataAccessAgent>(configuration, new StorageDataAccessConfigurationView(configuration, null, Module.ServiceName)); IAeManagementDataAccessAgent aeManagementAgent = GetAgent <IAeManagementDataAccessAgent>(configuration, new AeManagementDataAccessConfigurationView(configuration, null, Module.ServiceName)); IOptionsDataAccessAgent optionsAgent = GetAgent <IOptionsDataAccessAgent>(configuration, new OptionsDataAccessConfigurationView(configuration, null, Module.ServiceName)); bool bContinue = true; if (aeManagementAgent == null) { error = string.Format("{0} {1}", AssemblyName, "Cannot create IAeManagementDataAccessAgent"); bContinue = false; } if (bContinue) { if (storageAgent == null) { error = string.Format("{0} {1}", AssemblyName, "Cannot create IStorageDataAccessAgent"); bContinue = false; } } if (bContinue) { if (optionsAgent == null) { error = string.Format("{0} {1}", AssemblyName, "Cannot create IOptionsDataAccessAgent"); bContinue = false; } } if (bContinue) { storageAgent.MaxQueryResults = 10; storageAgent.IsPatientsExists("patientIdNotUsed"); aeManagementAgent.GetAeTitle("notUsed"); optionsAgent.GetDefaultOptions(); } } catch (Exception e) { error = string.Format("{0} {1}", AssemblyName, e.Message); } ret = string.IsNullOrEmpty(error); return(ret); }
public bool CanAccessDatabase(out string error) { error = string.Empty; bool ret = false; try { System.Configuration.Configuration configuration = DicomDemoSettingsManager.GetGlobalPacsAddinsConfiguration(LoggingConfigurationSession.ServiceDirectory); IOptionsDataAccessAgent optionsAgent = GetAgent <IOptionsDataAccessAgent>(configuration, new OptionsDataAccessConfigurationView(configuration, null, LoggingConfigurationSession.DisplayName)); ILoggingDataAccessAgent loggingAgent = GetAgent <ILoggingDataAccessAgent>(configuration, new LoggingDataAccessConfigurationView(configuration, null, LoggingConfigurationSession.DisplayName)); bool bContinue = true; if (loggingAgent == null) { error = string.Format("{0} {1}", AssemblyName, "Cannot create IAeManagementDataAccessAgent"); bContinue = false; } if (bContinue) { if (optionsAgent == null) { error = string.Format("{0} {1}", AssemblyName, "Cannot create IOptionsDataAccessAgent"); bContinue = false; } } if (bContinue) { optionsAgent.GetDefaultOptions(); loggingAgent.FindDicomEventLog(1, false); } } catch (Exception e) { error = string.Format("{0} {1}", AssemblyName, e.Message); } ret = string.IsNullOrEmpty(error); return(ret); }
public bool CanAccessDatabase(out string error) { error = string.Empty; bool ret = false; try { System.Configuration.Configuration configuration = DicomDemoSettingsManager.GetGlobalPacsAddinsConfiguration(GatewaySession.ServiceDirectory); IForwardDataAccessAgent forwardAgent = GetAgent <IForwardDataAccessAgent>(configuration, new ForwardDataAccessConfigurationView(configuration, null, GatewaySession.ServiceName)); IOptionsDataAccessAgent optionsAgent = GetAgent <IOptionsDataAccessAgent>(configuration, new OptionsDataAccessConfigurationView(configuration, null, GatewaySession.ServiceName)); bool bContinue = true; if (forwardAgent == null) { error = string.Format("{0} {1}", AssemblyName, "Cannot create IForwardDataAccessAgent"); bContinue = false; } if (bContinue) { if (optionsAgent == null) { error = string.Format("{0} {1}", AssemblyName, "Cannot create IOptionsDataAccessAgent"); bContinue = false; } } if (bContinue) { forwardAgent.IsForwarded("notUsed"); optionsAgent.GetDefaultOptions(); } } catch (Exception e) { error = string.Format("{0} {1}", AssemblyName, e.Message); } ret = string.IsNullOrEmpty(error); return(ret); }