Example #1
0
        /// <summary>
        /// Generates a (received) "Query" event in the audit log, according to DICOM Supplement 95.
        /// </summary>
        /// <param name="localAETitle">The local application entity receiving the query.</param>
        /// <param name="remoteAETitle">The application entity that issued the query.</param>
        /// <param name="remoteHostName">The hostname of the application entity that issued the query.</param>
        /// <param name="currentAE">The current DICOM AE performing the operation.</param>
        /// <param name="eventResult">The result of the operation.</param>
        /// <param name="sopClassUid">The SOP Class Uid of the type of DICOM Query being received.</param>
        /// <param name="ds">The dataset containing the DICOM query received.</param>
        public static void LogQueryReceived(string localAETitle, string remoteAETitle, string remoteHostName, EventSource currentAE, EventResult eventResult, string sopClassUid, DicomAttributeCollection ds)
        {
            if (!AuditingEnabled)
                return;

            try
            {
                var auditHelper = new QueryAuditHelper(currentAE, eventResult,
                                                       remoteAETitle ?? localAETitle, remoteHostName ?? LocalHostname, localAETitle, LocalHostname,
                                                       sopClassUid, ds);
                Log(auditHelper);
            }
            catch (Exception ex)
            {
                Platform.Log(LogLevel.Warn, ex, _messageAuditFailed);
            }
        }
Example #2
0
        /// <summary>
        /// Generates an (issued) "Query" event in the audit log, according to DICOM Supplement 95.
        /// </summary>
        /// <param name="localAETitle">The local application entity making the query.</param>
        /// <param name="remoteAETitle">The application entity on which the query is taking place.</param>
        /// <param name="remoteHostName">The hostname of the application entity on which the query is taking place.</param>
        /// <param name="eventSource">The source user or application entity which invoked the operation.</param>
        /// <param name="currentAE">The current DICOM AE performing the operation.</param>
        /// <param name="eventResult">The result of the operation.</param>
        /// <param name="sopClassUid">The SOP Class Uid of the type of DICOM Query being issued</param>
        /// <param name="ds">The dataset containing the DICOM query being issued</param>
        public static void LogQueryIssued(string localAETitle, string remoteAETitle, string remoteHostName, EventSource eventSource, EventSource currentAE, EventResult eventResult, string sopClassUid, DicomAttributeCollection ds)
        {
            if (!AuditingEnabled)
            {
                return;
            }

            try
            {
                var auditHelper = new QueryAuditHelper(eventSource, eventResult,
                                                       localAETitle, LocalHostname, remoteAETitle ?? localAETitle,
                                                       remoteHostName ?? LocalHostname,
                                                       sopClassUid, ds);
                if (eventSource != currentAE)
                {
                    auditHelper.AddOtherParticipant(currentAE);
                }
                Log(auditHelper);
            }
            catch (Exception ex)
            {
                Platform.Log(LogLevel.Warn, ex, _messageAuditFailed);
            }
        }
Example #3
0
        protected void SearchButton_Click(object sender, ImageClickEventArgs e)
        {   
            if(DisplaySearchWarning) {
                StudyListGridView.DataBindOnPreRender = false;
                ConfirmStudySearchMessageBox.Message = SR.NoFiltersSearchWarning;
                   ConfirmStudySearchMessageBox.MessageStyle = "font-weight: bold; color: #205F87;";
                ConfirmStudySearchMessageBox.Show();
            } 
            else
            {
                StudyListGridView.Refresh();    
            }
        	var sb = new StringBuilder();
			if(!String.IsNullOrEmpty(PatientId.Text))
				sb.AppendFormat("PatientId={0};", PatientId.Text);
            if(!String.IsNullOrEmpty(PatientName.Text))
				sb.AppendFormat("PatientsName={0};", PatientName.Text);
            if(!String.IsNullOrEmpty(AccessionNumber.Text))
				sb.AppendFormat("AccessionNumber={0};", AccessionNumber.Text);
            if(!String.IsNullOrEmpty(ToStudyDate.Text)||!String.IsNullOrEmpty(FromStudyDate.Text))
				sb.AppendFormat("StudyDate={0}-{1};", FromStudyDate.Text, ToStudyDate.Text);
            if(!String.IsNullOrEmpty(StudyDescription.Text))
				sb.AppendFormat("StudyDescription={0};", StudyDescription.Text);
			if (ModalityListBox.SelectedIndex < 0)
			{
				bool first = true;
				foreach (ListItem item in ModalityListBox.Items)
				{
					if (!item.Selected) continue;

					if (first)
					{
						sb.AppendFormat("ModalitiesInStudy={0}", item.Value);
						first = false;
					}
					else
					{
						sb.AppendFormat(",{0}", item.Value);
					}
				}
				if (!first)
					sb.Append(';');
			}

        	var helper = new QueryAuditHelper(ServerPlatform.AuditSource, EventIdentificationContentsEventOutcomeIndicator.Success,
				new AuditPersonActiveParticipant(SessionManager.Current.Credentials.UserName,
											 null,
											 SessionManager.Current.Credentials.DisplayName),
				ServerPartition.AeTitle,ServerPlatform.HostId,sb.ToString());
			ServerPlatform.LogAuditMessage(helper);
        }
Example #4
0
		/// <summary>
		/// Helper method for logging audit information.
		/// </summary>
		/// <param name="parms"></param>
		/// <param name="outcome"></param>
		/// <param name="msg">The query message to be audited</param>
		private static void AuditLog(AssociationParameters parms, EventIdentificationContentsEventOutcomeIndicator outcome, DicomMessage msg)
		{
		    try
		    {
                var helper = new QueryAuditHelper(ServerPlatform.AuditSource,
                                              outcome, parms, msg.AffectedSopClassUid, msg.DataSet);
                ServerPlatform.LogAuditMessage(helper);
		    }
		    catch (Exception e)
		    {
		        Platform.Log(LogLevel.Warn, "Unexpected exception logging DICOM Query audit message: {0}", e.Message);
		    }
		}