Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Generates a "Dicom Instances Accessed" update event in the audit log (with ActionCode of Delete), according to DICOM Supplement 95.
        /// </summary>
        /// <remarks>
        /// This method automatically separates different patients into separately logged events, as required by DICOM.
        ///
        /// We chose to impleemnt the DicomInstancesAccessed audit log, as opposed to the DicomStudyDeleted audit message because the whole
        /// study isn't being deleted, just a series.
        /// </remarks>
        /// <param name="aeTitles">The application entities from which the instances were accessed.</param>
        /// <param name="instances">The studies that the series belong that are being deleted.</param>
        /// <param name="eventSource">The source user or application entity which invoked the operation.</param>
        /// <param name="eventResult">The result of the operation.</param>
        public static void LogDeleteSeries(IEnumerable <string> aeTitles, AuditedInstances instances, EventSource eventSource, EventResult eventResult)
        {
            if (!AuditingEnabled)
            {
                return;
            }

            try
            {
                var aeTitlesArray = ToArray(aeTitles);
                foreach (var patient in instances.EnumeratePatients())
                {
                    var auditHelper = new DicomInstancesAccessedAuditHelper(eventSource, eventResult, EventIdentificationContentsEventActionCode.D);
                    auditHelper.AddUser(eventSource);
                    if (aeTitlesArray.Length > 0)
                    {
                        auditHelper.AddUser(new AuditProcessActiveParticipant(aeTitlesArray));
                    }
                    auditHelper.AddPatientParticipantObject(patient);
                    foreach (var study in instances.EnumerateStudies(patient))
                    {
                        auditHelper.AddStudyParticipantObject(study);
                    }
                    Log(auditHelper);
                }
            }
            catch (Exception ex)
            {
                Platform.Log(LogLevel.Warn, ex, _messageAuditFailed);
            }
        }
        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);
        }
Ejemplo n.º 4
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);

        }