diff OrthancServer/ServerIndex.h @ 1002:b067017a8a5b lua-scripting

anonymization refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 04 Jul 2014 16:31:14 +0200
parents 696dbb4fd390
children a226e0959d8b
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.h	Fri Jul 04 15:31:42 2014 +0200
+++ b/OrthancServer/ServerIndex.h	Fri Jul 04 16:31:14 2014 +0200
@@ -54,6 +54,10 @@
 
   class ServerIndex : public boost::noncopyable
   {
+  public:
+    typedef std::list<FileInfo> Attachments;
+    typedef std::map< std::pair<ResourceType, MetadataType>, std::string>  MetadataMap;
+
   private:
     class Transaction;
     struct UnstableResourcePayload;
@@ -98,9 +102,12 @@
                                /* in  */ int64_t id,
                                /* in  */ ResourceType type);
 
+    StoreStatus Store(const DicomMap& dicomSummary,
+                      const Attachments& attachments,
+                      const std::string& remoteAet,
+                      const MetadataMap* metadata);
+
   public:
-    typedef std::list<FileInfo> Attachments;
-
     ServerIndex(ServerContext& context,
                 const std::string& dbPath);
 
@@ -124,7 +131,18 @@
 
     StoreStatus Store(const DicomMap& dicomSummary,
                       const Attachments& attachments,
-                      const std::string& remoteAet);
+                      const std::string& remoteAet)
+    {
+      return Store(dicomSummary, attachments, remoteAet, NULL);
+    }
+
+    StoreStatus Store(const DicomMap& dicomSummary,
+                      const Attachments& attachments,
+                      const std::string& remoteAet,
+                      const MetadataMap& metadata)
+    {
+      return Store(dicomSummary, attachments, remoteAet, &metadata);
+    }
 
     void ComputeStatistics(Json::Value& target);                        
 
@@ -183,6 +201,9 @@
     void ListAvailableMetadata(std::list<MetadataType>& target,
                                const std::string& publicId);
 
+    bool GetMetadata(Json::Value& target,
+                     const std::string& publicId);
+
     void ListAvailableAttachments(std::list<FileContentType>& target,
                                   const std::string& publicId,
                                   ResourceType expectedType);