/// <summary> /// Generates a "DICOM Instances Transferred" received event in the audit log, according to DICOM Supplement 95. /// </summary> /// <remarks> /// This method automatically separates different patients into separately logged events, as required by DICOM. /// </remarks> /// <param name="localAETitle">The local application entity to which the transfer was completed.</param> /// <param name="remoteAETitle">The application entity from which the transfer was completed.</param> /// <param name="remoteHostName">The hostname of the application entity from which the transfer was completed.</param> /// <param name="instances">The studies that were transferred.</param> /// <param name="eventSource">The source user or application entity which invoked the operation.</param> /// <param name="eventResult">The result of the operation.</param> /// <param name="action">The action taken on the studies that were transferred.</param> public static void LogReceivedInstances(string localAETitle, string remoteAETitle, string remoteHostName, AuditedInstances instances, EventSource eventSource, EventResult eventResult, EventReceiptAction action) { if (!AuditingEnabled) { return; } try { foreach (var patient in instances.EnumeratePatients()) { var auditHelper = new DicomInstancesTransferredAuditHelper(eventSource, eventResult, action, remoteAETitle ?? localAETitle, remoteHostName ?? LocalHostname, localAETitle, LocalHostname); foreach (var study in instances.EnumerateStudies(patient)) { auditHelper.AddStudyParticipantObject(study); } Log(auditHelper); } } catch (Exception ex) { Platform.Log(LogLevel.Warn, ex, _messageAuditFailed); } }
public static void InstancesTransferredAuditLogger(DicomScpContext context, ServerAssociationParameters assocParams, List<StorageInstance> instances) { Dictionary<string, AuditPatientParticipantObject> list = new Dictionary<string, AuditPatientParticipantObject>(); foreach (StorageInstance instance in instances) { string key = instance.PatientId + instance.PatientsName; if (!list.ContainsKey(key)) { AuditPatientParticipantObject patient = new AuditPatientParticipantObject(instance.PatientsName, instance.PatientId); list.Add(key, patient); } } foreach (AuditPatientParticipantObject patient in list.Values) { // Audit Log DicomInstancesTransferredAuditHelper helper = new DicomInstancesTransferredAuditHelper(ServerPlatform.AuditSource, EventIdentificationContentsEventOutcomeIndicator.Success, EventIdentificationContentsEventActionCode.E, assocParams); foreach (StorageInstance instance in instances) { if (patient.PatientId.Equals(instance.PatientId) && patient.PatientsName.Equals(instance.PatientsName)) { helper.AddStorageInstance(instance); } } ServerPlatform.LogAuditMessage(helper); } }