Example #1
0
        public static FindOtherPatientIdsOptions GetFindOtherPatientIdOptions(AdvancedSettings settings)
        {
            FindOtherPatientIdsOptions options = null;

            try
            {
                settings.RefreshSettings();
                options = settings.GetAddInCustomData <FindOtherPatientIdsOptions>(Source, OptionsName);
                if (options == null)
                {
                    options = new FindOtherPatientIdsOptions();
                }
            }
            catch (Exception e)
            {
                if (options == null)
                {
                    options = new FindOtherPatientIdsOptions();
                }

                Logger.Global.SystemMessage(LogType.Error, e.Message);
            }

            return(options);
        }
Example #2
0
        // Called when the external store addin is loaded by the PACSFramework
        public override void Load(string serviceDirectory, string displayName)
        {
            try
            {
                // Open 'advanced.config' which contains all settings for CSStorageServerManger.exe addins (including this addin)
                AdvancedSettings settings = AdvancedSettings.Open(serviceDirectory);

                ServiceDirectory = serviceDirectory;
                DisplayName      = displayName;

                if (ServiceLocator.IsRegistered <DicomServer>())
                {
                    _Server     = ServiceLocator.Retrieve <DicomServer>();
                    ServiceName = _Server.Name;
                }
                else
                {
                    _Server = new DicomServer(string.Empty);
                }

                if (!ServiceLocator.IsRegistered <SettingsChangedNotifier>())
                {
                    SettingsChangedNotifier configChangedNotifier = new SettingsChangedNotifier(settings);

                    configChangedNotifier.SettingsChanged += new EventHandler(configChangedNotifier_SettingsChanged);
                    configChangedNotifier.Enabled          = true;
                    ServiceLocator.Register <SettingsChangedNotifier>(configChangedNotifier);
                }
                else
                {
                    ServiceLocator.Retrieve <SettingsChangedNotifier>().SettingsChanged += new EventHandler(configChangedNotifier_SettingsChanged);
                }

                ConfigureUSAF(settings);
            }
            catch (Exception e)
            {
                if (_Options == null)
                {
                    _Options = new FindOtherPatientIdsOptions();
                }

                Logger.Global.SystemMessage(LogType.Error, e.Message);
            }
        }
Example #3
0
        private static void ConfigureUSAF(AdvancedSettings settings)
        {
            //string name = Assembly.GetExecutingAssembly().GetName().Name;

            _Options = GetFindOtherPatientIdOptions(settings);
        }