diff OrthancServer/DicomInstanceToStore.h @ 2640:c691fcf66071 jobs

ResourceModificationJob
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 28 May 2018 16:30:17 +0200
parents 878b59270859
children a21b244efb37
line wrap: on
line diff
--- a/OrthancServer/DicomInstanceToStore.h	Mon May 28 14:39:22 2018 +0200
+++ b/OrthancServer/DicomInstanceToStore.h	Mon May 28 16:30:17 2018 +0200
@@ -34,9 +34,9 @@
 #pragma once
 
 #include "../Core/DicomParsing/ParsedDicomFile.h"
+#include "../Core/OrthancException.h"
+#include "DicomInstanceOrigin.h"
 #include "ServerIndex.h"
-#include "../Core/OrthancException.h"
-#include "../Core/RestApi/RestApiCall.h"
 
 namespace Orthanc
 {
@@ -139,46 +139,31 @@
       }
     };
 
-
-    SmartContainer<std::string>  buffer_;
+    DicomInstanceOrigin              origin_;
+    SmartContainer<std::string>      buffer_;
     SmartContainer<ParsedDicomFile>  parsed_;
-    SmartContainer<DicomMap>  summary_;
-    SmartContainer<Json::Value>  json_;
-
-    RequestOrigin origin_;
-    std::string remoteIp_;
-    std::string dicomRemoteAet_;
-    std::string dicomCalledAet_;
-    std::string httpUsername_;
-    ServerIndex::MetadataMap metadata_;
+    SmartContainer<DicomMap>         summary_;
+    SmartContainer<Json::Value>      json_;
+    ServerIndex::MetadataMap         metadata_;
 
     void ComputeMissingInformation();
 
   public:
-    DicomInstanceToStore() : origin_(RequestOrigin_Unknown)
+    void SetOrigin(const DicomInstanceOrigin& origin)
     {
+      origin_ = origin;
     }
-
-    void SetDicomProtocolOrigin(const char* remoteIp,
-                                const char* remoteAet,
-                                const char* calledAet);
-
-    void SetRestOrigin(const RestApiCall& call);
-
-    void SetHttpOrigin(const char* remoteIp,
-                       const char* username);
-
-    void SetLuaOrigin();
-
-    void SetPluginsOrigin();
-
-    RequestOrigin GetRequestOrigin() const
+    
+    DicomInstanceOrigin& GetOrigin()
     {
       return origin_;
     }
-
-    const char* GetRemoteAet() const; 
-
+    
+    const DicomInstanceOrigin& GetOrigin() const
+    {
+      return origin_;
+    }
+    
     void SetBuffer(const std::string& dicom)
     {
       buffer_.SetConstReference(dicom);
@@ -221,8 +206,6 @@
     
     const Json::Value& GetJson();
 
-    void GetOriginInformation(Json::Value& result) const;
-
     bool LookupTransferSyntax(std::string& result);
   };
 }