diff Core/DicomFormat/DicomMap.cpp @ 1749:99f4a05f39fa db-changes

various types of constraints
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 27 Oct 2015 10:54:51 +0100
parents ec66a16aa398
children 39c37a994b2f
line wrap: on
line diff
--- a/Core/DicomFormat/DicomMap.cpp	Mon Oct 26 17:33:55 2015 +0100
+++ b/Core/DicomFormat/DicomMap.cpp	Tue Oct 27 10:54:51 2015 +0100
@@ -100,6 +100,36 @@
   };
 
 
+  void DicomMap::LoadMainDicomTags(const DicomTag*& tags,
+                                   size_t& size,
+                                   ResourceType level)
+  {
+    switch (level)
+    {
+      case ResourceType_Patient:
+        tags = patientTags;
+        size = sizeof(patientTags) / sizeof(DicomTag);
+        break;
+
+      case ResourceType_Study:
+        tags = studyTags;
+        size = sizeof(studyTags) / sizeof(DicomTag);
+        break;
+
+      case ResourceType_Series:
+        tags = seriesTags;
+        size = sizeof(seriesTags) / sizeof(DicomTag);
+        break;
+
+      case ResourceType_Instance:
+        tags = instanceTags;
+        size = sizeof(instanceTags) / sizeof(DicomTag);
+        break;
+
+      default:
+        throw OrthancException(ErrorCode_ParameterOutOfRange);
+    }
+  }
 
 
   void DicomMap::SetValue(uint16_t group,