diff OrthancServer/ServerIndex.cpp @ 1352:382439943749

ResourceFinder
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 11 May 2015 17:25:53 +0200
parents 77e129ba64e4
children 3dd494f201a1
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.cpp	Thu Apr 30 15:17:40 2015 +0200
+++ b/OrthancServer/ServerIndex.cpp	Mon May 11 17:25:53 2015 +0200
@@ -2055,4 +2055,27 @@
     }
   }
 
+
+  bool ServerIndex::GetMainDicomTags(DicomMap& result,
+                                     const std::string& publicId,
+                                     ResourceType expectedType)
+  {
+    result.Clear();
+
+    boost::mutex::scoped_lock lock(mutex_);
+
+    // Lookup for the requested resource
+    int64_t id;
+    ResourceType type;
+    if (!db_.LookupResource(id, type, publicId) ||
+        type != expectedType)
+    {
+      return false;
+    }
+    else
+    {
+      db_.GetMainDicomTags(result, id);
+      return true;
+    }    
+  }
 }