diff OrthancServer/Sources/ServerContext.cpp @ 4939:e8a2e145c80e more-tags

cleanup
author Alain Mazy <am@osimis.io>
date Tue, 15 Mar 2022 09:09:52 +0100
parents 3f9b9865c8cc
children 304514ce84ee
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerContext.cpp	Mon Mar 14 16:44:00 2022 +0100
+++ b/OrthancServer/Sources/ServerContext.cpp	Tue Mar 15 09:09:52 2022 +0100
@@ -2270,15 +2270,31 @@
 
   bool ServerContext::ExpandResource(Json::Value& target,
                                      const std::string& publicId,
-                                     const std::string& instanceId,    // optional: the id of an instance for the resource
-                                     const Json::Value& dicomAsJson,   // optional: the dicom-as-json for the resource
+                                     const std::string& instanceId,    // optional: the id of an instance for the resource (if already available)
+                                     const Json::Value& dicomAsJson,   // optional: the dicom-as-json for the resource (if already available)
                                      ResourceType level,
                                      DicomToJsonFormat format,
                                      const std::set<DicomTag>& requestedTags)
   {
     ExpandedResource resource;
 
-    if (GetIndex().ExpandResource(resource, publicId, level, format, requestedTags))
+    if (ExpandResource(resource, publicId, instanceId, dicomAsJson, level, requestedTags))
+    {
+      SerializeExpandedResource(target, resource, format, requestedTags);
+      return true;
+    }
+
+    return false;
+  }
+  
+  bool ServerContext::ExpandResource(ExpandedResource& resource,
+                                     const std::string& publicId,
+                                     const std::string& instanceId,    // optional: the id of an instance for the resource (if already available)
+                                     const Json::Value& dicomAsJson,   // optional: the dicom-as-json for the resource (if already available)
+                                     ResourceType level,
+                                     const std::set<DicomTag>& requestedTags)
+  {
+    if (GetIndex().ExpandResource(resource, publicId, level, requestedTags))
     {
       // check the main dicom tags list has not changed since the resource was stored
       if (resource.mainDicomTagsSignature_ != DicomMap::GetMainDicomTagsSignature(resource.type_))
@@ -2325,8 +2341,6 @@
         resource.tags_.Merge(allTags);
       }
 
-      SerializeExpandedResource(target, resource, format, requestedTags);
-
       return true;
     }