diff OrthancServer/Search/DatabaseLookup.cpp @ 2893:1723cbba55c7 db-changes

testing DicomTagConstraint
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 16 Oct 2018 19:47:09 +0200
parents ce310baccda6
children 039a9d262d64 4e43e67f8ecf
line wrap: on
line diff
--- a/OrthancServer/Search/DatabaseLookup.cpp	Tue Oct 16 18:00:05 2018 +0200
+++ b/OrthancServer/Search/DatabaseLookup.cpp	Tue Oct 16 19:47:09 2018 +0200
@@ -48,8 +48,18 @@
     
     for (size_t i = 0; i < size; i++)
     {
-      assert(tags_.find(tags[i]) == tags_.end());
-      tags_[tags[i]] = TagInfo(DicomTagType_Identifier, level);
+      if (tags_.find(tags[i]) == tags_.end())
+      {
+        tags_[tags[i]] = TagInfo(DicomTagType_Identifier, level);
+      }
+      else
+      {
+        // These patient-level tags are copied in the study level
+        assert(level == ResourceType_Study &&
+               (tags[i] == DICOM_TAG_PATIENT_ID ||
+                tags[i] == DICOM_TAG_PATIENT_NAME ||
+                tags[i] == DICOM_TAG_PATIENT_BIRTH_DATE));
+      }
     }
     
     DicomMap::LoadMainDicomTags(tags, size, level);