diff OrthancServer/Sources/ServerContext.cpp @ 4789:51ec061516c9

Fix handling of option "DeidentifyLogs", notably for tags (0010,0010) and (0010,0020)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 Sep 2021 13:02:33 +0200
parents 2f35e6b765e5
children 434843934307 94616af363ec
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerContext.cpp	Mon Sep 06 22:13:07 2021 +0200
+++ b/OrthancServer/Sources/ServerContext.cpp	Thu Sep 09 13:02:33 2021 +0200
@@ -1987,10 +1987,9 @@
     static const std::string redactedContent = "*** POTENTIAL PHI ***";
 
     const DicomTag& tag = element.GetTag();
-    if (deidentifyLogs_ && (
-          logsDeidentifierRules_.IsCleared(tag) ||
-          logsDeidentifierRules_.IsRemoved(tag) ||
-          logsDeidentifierRules_.IsReplaced(tag)))
+    if (deidentifyLogs_ &&
+        !element.GetValue().GetContent().empty() &&
+        logsDeidentifierRules_.IsAlteredTag(tag))
     {
       return redactedContent;
     }