diff OrthancServer/DicomInstanceOrigin.cpp @ 2726:46061a91c88a jobs

new metadata (RemoteIP, CalledAET, HttpUsername), "?expand" metadata
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 12 Jul 2018 18:01:16 +0200
parents a21b244efb37
children 4e43e67f8ecf
line wrap: on
line diff
--- a/OrthancServer/DicomInstanceOrigin.cpp	Thu Jul 12 16:07:56 2018 +0200
+++ b/OrthancServer/DicomInstanceOrigin.cpp	Thu Jul 12 18:01:16 2018 +0200
@@ -127,40 +127,56 @@
     }
   }
 
-  const std::string& DicomInstanceOrigin::GetRemoteIp() const
+  bool DicomInstanceOrigin::LookupRemoteAet(std::string& result) const
+  {
+    if (origin_ == RequestOrigin_DicomProtocol)
+    {
+      result = dicomRemoteAet_.c_str();
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  }
+
+  bool DicomInstanceOrigin::LookupRemoteIp(std::string& result) const
   {
     if (origin_ == RequestOrigin_DicomProtocol ||
         origin_ == RequestOrigin_RestApi)
     {
-      return remoteIp_;
+      result = remoteIp_;
+      return true;
     }
     else
     {
-      throw OrthancException(ErrorCode_ParameterOutOfRange);
+      return false;
     }
   }
 
-  const std::string& DicomInstanceOrigin::GetCalledAet() const
+  bool DicomInstanceOrigin::LookupCalledAet(std::string& result) const
   {
     if (origin_ == RequestOrigin_DicomProtocol)
     {
-      return dicomCalledAet_;
+      result = dicomCalledAet_;
+      return true;
     }
     else
     {
-      throw OrthancException(ErrorCode_ParameterOutOfRange);
+      return false;
     }
   }
 
-  const std::string& DicomInstanceOrigin::GetHttpUsername() const
+  bool DicomInstanceOrigin::LookupHttpUsername(std::string& result) const
   {
     if (origin_ == RequestOrigin_RestApi)
     {
-      return httpUsername_;
+      result = httpUsername_;
+      return true;
     }
     else
     {
-      throw OrthancException(ErrorCode_ParameterOutOfRange);
+      return false;
     }
   }