diff OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 1555:d6a93e12b1c1

Creation of DICOM files with encapsulated PDF
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Aug 2015 15:18:13 +0200
parents 0586ed8897f1
children b8dc2f855a83
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Thu Aug 20 11:56:42 2015 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Thu Aug 20 15:18:13 2015 +0200
@@ -956,23 +956,7 @@
         b.splice(b.begin(), c);
       }
 
-      switch (type)
-      {
-        case ResourceType_Patient:
-          type = ResourceType_Study;
-          break;
-
-        case ResourceType_Study:
-          type = ResourceType_Series;
-          break;
-
-        case ResourceType_Series:
-          type = ResourceType_Instance;
-          break;
-
-        default:
-          throw OrthancException(ErrorCode_InternalError);
-      }
+      type = GetChildResourceType(type);
 
       a.clear();
       a.splice(a.begin(), b);
@@ -1053,13 +1037,7 @@
       }
       
       current = parent;
-      switch (currentType)
-      {
-        case ResourceType_Instance:  currentType = ResourceType_Series; break;
-        case ResourceType_Series:    currentType = ResourceType_Study; break;
-        case ResourceType_Study:     currentType = ResourceType_Patient; break;
-        default:                     throw OrthancException(ErrorCode_InternalError);
-      }
+      currentType = GetParentResourceType(currentType);
     }
 
     assert(currentType == end);