Example #1
0
        public AnonymizationOptionsControl(Lifetime lifetime,
                                           OptionsSettingsSmartContext ctx,
                                           KaVEISettingsStore settingsStore,
                                           IActionExecutor actionExecutor,
                                           DataContexts dataContexts,
                                           IMessageBoxCreator messageBoxCreator)
        {
            _lifetime       = lifetime;
            _ctx            = ctx;
            _settingsStore  = settingsStore;
            _actionExecutor = actionExecutor;
            _dataContexts   = dataContexts;

            InitializeComponent();

            _anonymizationSettings = settingsStore.GetSettings <AnonymizationSettings>();

            var anonymizationContext = new AnonymizationContext(_anonymizationSettings);

            DataContext = anonymizationContext;

            if (_ctx != null)
            {
                BindChangesToAnonymization();
            }

            _messageBoxCreator = messageBoxCreator;
        }
Example #2
0
 public void SetUp()
 {
     _anonymizationSettings = new AnonymizationSettings
     {
         RemoveStartTimes = false,
         RemoveDurations  = false,
         RemoveCodeNames  = false
     };
     _context = new AnonymizationContext(_anonymizationSettings);
 }
        public AnonymizationWindow(ISettingsStore settingsStore)
        {
            _settingsStore = settingsStore;
            InitializeComponent();

            _anonymizationSettings = settingsStore.GetSettings <AnonymizationSettings>();

            var anonymizationContext = new AnonymizationContext(_anonymizationSettings);

            DataContext = anonymizationContext;
        }
 public void SetUp()
 {
     _updatedProperties     = new List <string>();
     _anonymizationSettings = new AnonymizationSettings
     {
         RemoveCodeNames  = false,
         RemoveSessionIDs = false,
         RemoveDurations  = false,
         RemoveStartTimes = false
     };
     _sut = new AnonymizationContext(_anonymizationSettings);
     _sut.PropertyChanged += (sender, args) => { _updatedProperties.Add(args.PropertyName); };
 }
Example #5
0
        public static AnonymizationQueue BuildQueue(AnonymizationSettings settings, IEnumerable <string> dcmFiles)
        {
            var anonQue = new AnonymizationQueue();

            if (settings.DoAnonymizeStudyIDs || settings.DoAnonymizeUIDs)
            {
                var studyAnon = settings.DoAnonymizeStudyIDs ? new StudyIdAnonymizer() : null;
                var uidAnon   = settings.DoAnonymizeUIDs ? new UIDAnonymizer() : null;
                foreach (var file in dcmFiles)
                {
                    var ob = DICOMObject.Read(file);
                    if (uidAnon != null)
                    {
                        uidAnon.AddDICOMObject(ob);
                    }
                    if (studyAnon != null)
                    {
                        studyAnon.AddDICOMObject(ob);
                    }
                }
                if (studyAnon != null)
                {
                    studyAnon.FinalizeDictionary();
                    anonQue.Queue.Add(studyAnon);
                }
                if (uidAnon != null)
                {
                    anonQue.Queue.Add(uidAnon);
                }
            }
            if (settings.DoAnonymizeNames)
            {
                anonQue.Queue.Add(new NameAnonymizer());
            }
            if (settings.DoRemovePrivateTags)
            {
                anonQue.Queue.Add(new PrivateTagAnonymizer());
            }
            if (settings.DoDICOMProfile)
            {
                anonQue.Queue.Add(new ProfileAnonymizer());
            }
            anonQue.Queue.Add(new PatientIdAnonymizer(settings.FirstName, settings.LastName, settings.Id));
            anonQue.Queue.Add(new DateAnonymizer(settings.DateSettings));
            return(anonQue);
        }
        public void SetUp()
        {
            AnonymizationSettings = new AnonymizationSettings();

            var mockSettingsStore = new Mock <ISettingsStore>();

            mockSettingsStore.Setup(store => store.GetSettings <AnonymizationSettings>()).Returns(AnonymizationSettings);

            _uut = new DataExportAnonymizer(mockSettingsStore.Object);

            OriginalEvent = CreateEventWithAllAnonymizablePropertiesSet();
            OriginalEvent.IDESessionUUID = "0xDEADBEEF";
            OriginalEvent.TriggeredAt    = DateTime.Now;
            OriginalEvent.Duration       = TimeSpan.FromSeconds(23);
            OriginalEvent.ActiveDocument = Names.Document("CSharp \\P1\\Class1.cs");
            OriginalEvent.ActiveWindow   = Names.Window("vsWindowTypeDocument Class1.cs");
            OriginalEvent.TriggeredBy    = EventTrigger.Click;
        }
Example #7
0
        public void SetUp()
        {
            _mockIoUtils = new Mock <IIoUtils>();
            Registry.RegisterComponent(_mockIoUtils.Object);

            _mockPublisherUtils = new Mock <IPublisherUtils>();
            Registry.RegisterComponent(_mockPublisherUtils.Object);

            _mockLogger = new Mock <ILogger>();

            _mockExporter = new Mock <IExporter>();

            _mockLogs = new List <Mock <ILog> > {
                new Mock <ILog>(), new Mock <ILog>(), new Mock <ILog>()
            };

            _mockLogFileManager = new Mock <ILogManager>();
            _mockLogFileManager.Setup(mgr => mgr.Logs).Returns(_mockLogs.Select(m => m.Object));

            _mockSettingStore = new Mock <ISettingsStore>();
            _mockSettingStore.Setup(store => store.GetSettings <UploadSettings>()).Returns(new UploadSettings());
            _exportSettings = new ExportSettings {
                UploadUrl = TestUploadUrl
            };
            _userSettings          = new UserProfileSettings();
            _anonymizationSettings = new AnonymizationSettings();
            _mockSettingStore.Setup(store => store.GetSettings <ExportSettings>()).Returns(_exportSettings);
            _mockSettingStore.Setup(store => store.GetSettings <UserProfileSettings>()).Returns(_userSettings);
            _mockSettingStore.Setup(store => store.GetSettings <AnonymizationSettings>())
            .Returns(_anonymizationSettings);
            _mockSettingStore.Setup(store => store.UpdateSettings(It.IsAny <Action <ExportSettings> >()))
            .Callback <Action <ExportSettings> >(update => update(_exportSettings));

            _testDateUtils = new TestDateUtils();
            _uut           = new UploadWizardContext(
                _mockExporter.Object,
                _mockLogFileManager.Object,
                _mockSettingStore.Object,
                _testDateUtils,
                _mockLogger.Object);

            _errorNotificationHelper   = _uut.ErrorNotificationRequest.NewTestHelper();
            _successNotificationHelper = _uut.SuccessNotificationRequest.NewTestHelper();
        }
        public void Setup()
        {
            _kaveSettings    = new KaVESettings();
            _anonSettings    = new AnonymizationSettings();
            _profileSettings = new UserProfileSettings();
            _exportSettings  = new ExportSettings();
            _profileUtils    = Mock.Of <IUserProfileSettingsUtils>();

            _store = Mock.Of <ISettingsStore>();
            Mock.Get(_store).Setup(ss => ss.GetSettings <KaVESettings>()).Returns(_kaveSettings);
            Mock.Get(_store).Setup(s => s.GetSettings <AnonymizationSettings>()).Returns(_anonSettings);
            Mock.Get(_store).Setup(s => s.GetSettings <UserProfileSettings>()).Returns(_profileSettings);
            Mock.Get(_store).Setup(s => s.GetSettings <ExportSettings>()).Returns(_exportSettings);

            _windows = Mock.Of <ISimpleWindowOpener>();

            // setting valid values that should not be notified
            _anonSettings.RemoveSessionIDs = false;
            _profileSettings.ProfileId     = "x";
            _exportSettings.UploadUrl      = "http://upload.kave.cc/";
        }
 public AnonymizationContext(AnonymizationSettings anonymizationSettings)
 {
     _anonymizationSettings = anonymizationSettings;
 }