Example #1
0
        public void DicomInstancesAccessedAuditTest()
        {
            DicomInstancesAccessedAuditHelper helper =
                new DicomInstancesAccessedAuditHelper(
                    new DicomAuditSource("testApp", "Site", AuditSourceTypeCodeEnum.ApplicationServerProcessTierInMultiTierSystem),
                    EventIdentificationContentsEventOutcomeIndicator.Success,
                    EventIdentificationContentsEventActionCode.R);

            helper.AddUser(new AuditPersonActiveParticipant("testUser", "test@test", "Test Name"));

            DicomAttributeCollection collection = new DicomAttributeCollection();

            SetupMR(collection);
            helper.AddPatientParticipantObject(new AuditPatientParticipantObject(collection));
            helper.AddStorageInstance(new StorageInstance(new DicomMessage(new DicomAttributeCollection(), collection)));

            string output = helper.Serialize(true);

            Assert.IsNotEmpty(output);

            Assert.Ignore("Skipping schema validation due to schema bug #9455");
            Exception exception;

            if (!helper.Verify(out exception))
            {
                throw exception;
            }
        }
        public static void RemoveAuthorityGroupAccess(string studyInstanceUid, string accessionNumber, IList <string> assignedGroups)
        {
            Platform.CheckForNullReference(studyInstanceUid, "studyInstanceUid");
            Platform.CheckForNullReference(assignedGroups, "assignedGroups");

            var helper =
                new DicomInstancesAccessedAuditHelper(ServerPlatform.AuditSource,
                                                      EventIdentificationContentsEventOutcomeIndicator.Success,
                                                      EventIdentificationContentsEventActionCode.U,
                                                      EventTypeCode.ObjectSecurityAttributesChanged);

            // TODO: 8/19/2011, Develop a way to get the DisplayName for the user here for the audit log message
            helper.AddUser(new AuditPersonActiveParticipant(
                               Thread.CurrentPrincipal.Identity.Name,
                               null,
                               null));


            var participant = new AuditStudyParticipantObject(studyInstanceUid, accessionNumber);

            string updateDescription = StringUtilities.Combine(
                assignedGroups, ";",
                item => String.Format("Removed Group Access=\"{0}\"", item)
                );

            participant.ParticipantObjectDetailString = updateDescription;
            helper.AddStudyParticipantObject(participant);

            ServerPlatform.LogAuditMessage(helper);
        }
Example #3
0
        private static void AuditLog(Study study, List <UpdateItem> fields)
        {
            Platform.CheckForNullReference(study, "study");
            Platform.CheckForNullReference(fields, "fields");

            var helper =
                new DicomInstancesAccessedAuditHelper(ServerPlatform.AuditSource,
                                                      EventIdentificationContentsEventOutcomeIndicator.Success,
                                                      EventIdentificationContentsEventActionCode.U);

            helper.AddUser(new AuditPersonActiveParticipant(
                               SessionManager.Current.Credentials.UserName,
                               null,
                               SessionManager.Current.Credentials.DisplayName));

            var participant = new AuditStudyParticipantObject(study.StudyInstanceUid, study.AccessionNumber);

            string updateDescription = StringUtilities.Combine(
                fields, ";",
                item => String.Format("Tag=\"{0}\" Value=\"{1}\"", item.DicomTag.Name, item.Value)
                );

            participant.ParticipantObjectDetailString = updateDescription;
            helper.AddStudyParticipantObject(participant);
            ServerPlatform.LogAuditMessage(helper);
        }
Example #4
0
        public void DicomInstancesAccessedAuditTest()
        {
            DicomInstancesAccessedAuditHelper helper =
                new DicomInstancesAccessedAuditHelper(
                    new DicomAuditSource("testApp", "Site", AuditSourceTypeCodeEnum.ApplicationServerProcessTierInMultiTierSystem),
                    EventIdentificationTypeEventOutcomeIndicator.Success,
                    EventIdentificationTypeEventActionCode.R);

            helper.AddUser(new AuditPersonActiveParticipant("testUser", "test@test", "Test Name"));

            DicomAttributeCollection collection = new DicomAttributeCollection();

            SetupMR(collection);
            helper.AddPatientParticipantObject(new AuditPatientParticipantObject(collection));
            helper.AddStorageInstance(new StorageInstance(new DicomMessage(new DicomAttributeCollection(), collection)));

            string output = helper.Serialize(true);

            Assert.IsNotEmpty(output);

            string failure;
            bool   result = helper.Verify(out failure);

            Assert.IsTrue(result, failure);
        }
Example #5
0
        private void GenerateAuditLog()
        {
            var audit = new DicomInstancesAccessedAuditHelper(ServerPlatform.AuditSource, EventIdentificationContentsEventOutcomeIndicator.Success, EventIdentificationContentsEventActionCode.R /* Read*/);

            audit.AddUser(new AuditPersonActiveParticipant(SessionManager.Current.Credentials.UserName, null, SessionManager.Current.Credentials.DisplayName));

            var participant = new AuditStudyParticipantObject(_study.StudyInstanceUid, _study.AccessionNumber);

            participant.ParticipantObjectDetailString = string.Format("Partition: {0}", string.IsNullOrEmpty(_study.ThePartition.Description) ? _study.ThePartition.AeTitle : _study.ThePartition.Description);
            audit.AddStudyParticipantObject(participant);

            ServerAuditHelper.LogAuditMessage(audit);
        }
Example #6
0
		public void DicomInstancesAccessedAuditTest()
		{
			DicomInstancesAccessedAuditHelper helper =
				new DicomInstancesAccessedAuditHelper(
					new DicomAuditSource("testApp", "Site", AuditSourceTypeCodeEnum.ApplicationServerProcessTierInMultiTierSystem),
					EventIdentificationTypeEventOutcomeIndicator.Success,
					EventIdentificationTypeEventActionCode.R);

			helper.AddUser(new AuditPersonActiveParticipant("testUser", "test@test", "Test Name"));

			DicomAttributeCollection collection = new DicomAttributeCollection();
			SetupMR(collection);
			helper.AddPatientParticipantObject(new AuditPatientParticipantObject(collection));
			helper.AddStorageInstance(new StorageInstance(new DicomMessage(new DicomAttributeCollection(), collection)));

			string output = helper.Serialize(true);

			Assert.IsNotEmpty(output);

			string failure;
			bool result = helper.Verify(out failure);

			Assert.IsTrue(result, failure);
		}
Example #7
0
		public void DicomInstancesAccessedAuditTest()
		{
			DicomInstancesAccessedAuditHelper helper =
				new DicomInstancesAccessedAuditHelper(
					new DicomAuditSource("testApp", "Site", AuditSourceTypeCodeEnum.ApplicationServerProcessTierInMultiTierSystem),
					EventIdentificationContentsEventOutcomeIndicator.Success,
					EventIdentificationContentsEventActionCode.R);

			helper.AddUser(new AuditPersonActiveParticipant("testUser", "test@test", "Test Name"));

			DicomAttributeCollection collection = new DicomAttributeCollection();
			SetupMR(collection);
			helper.AddPatientParticipantObject(new AuditPatientParticipantObject(collection));
			helper.AddStorageInstance(new StorageInstance(new DicomMessage(new DicomAttributeCollection(), collection)));

			string output = helper.Serialize(true);

			Assert.IsNotEmpty(output);

			Assert.Ignore("Skipping schema validation due to schema bug #9455");
			Exception exception;
			if (!helper.Verify(out exception))
				throw exception;
		}