comparison OrthancServer/DicomInstanceToStore.h @ 1572:904096e7367e

More information about the origin request in OnStoredInstance() callbacks
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 25 Aug 2015 12:10:12 +0200
parents bba8a47922d1
children 3309878b3e16
comparison
equal deleted inserted replaced
1571:3232f1c995a5 1572:904096e7367e
33 #pragma once 33 #pragma once
34 34
35 #include "ParsedDicomFile.h" 35 #include "ParsedDicomFile.h"
36 #include "ServerIndex.h" 36 #include "ServerIndex.h"
37 #include "../Core/OrthancException.h" 37 #include "../Core/OrthancException.h"
38 #include "../Core/RestApi/RestApiCall.h"
38 39
39 namespace Orthanc 40 namespace Orthanc
40 { 41 {
41 class DicomInstanceToStore 42 class DicomInstanceToStore
42 { 43 {
141 SmartContainer<std::string> buffer_; 142 SmartContainer<std::string> buffer_;
142 SmartContainer<ParsedDicomFile> parsed_; 143 SmartContainer<ParsedDicomFile> parsed_;
143 SmartContainer<DicomMap> summary_; 144 SmartContainer<DicomMap> summary_;
144 SmartContainer<Json::Value> json_; 145 SmartContainer<Json::Value> json_;
145 146
146 std::string remoteAet_; 147 RequestOrigin origin_;
147 std::string calledAet_; 148 std::string dicomRemoteAet_;
149 std::string dicomCalledAet_;
150 std::string httpRemoteIp_;
151 std::string httpUsername_;
148 ServerIndex::MetadataMap metadata_; 152 ServerIndex::MetadataMap metadata_;
149 153
150 void ComputeMissingInformation(); 154 void ComputeMissingInformation();
151 155
152 public: 156 public:
157 DicomInstanceToStore() : origin_(RequestOrigin_Unknown)
158 {
159 }
160
161 void SetDicomProtocolOrigin(const char* remoteAet,
162 const char* calledAet);
163
164 void SetRestOrigin(const RestApiCall& call);
165
166 void SetHttpOrigin(const char* remoteIp,
167 const char* username);
168
169 void SetLuaOrigin();
170
171 void SetPluginsOrigin();
172
173 const char* GetRemoteAet() const;
174
153 void SetBuffer(const std::string& dicom) 175 void SetBuffer(const std::string& dicom)
154 { 176 {
155 buffer_.SetConstReference(dicom); 177 buffer_.SetConstReference(dicom);
156 } 178 }
157 179
166 } 188 }
167 189
168 void SetJson(const Json::Value& json) 190 void SetJson(const Json::Value& json)
169 { 191 {
170 json_.SetConstReference(json); 192 json_.SetConstReference(json);
171 }
172
173 const std::string& GetRemoteAet() const
174 {
175 return remoteAet_;
176 }
177
178 void SetRemoteAet(const std::string& aet)
179 {
180 remoteAet_ = aet;
181 }
182
183 const std::string& GetCalledAet() const
184 {
185 return calledAet_;
186 }
187
188 void SetCalledAet(const std::string& aet)
189 {
190 calledAet_ = aet;
191 } 193 }
192 194
193 void AddMetadata(ResourceType level, 195 void AddMetadata(ResourceType level,
194 MetadataType metadata, 196 MetadataType metadata,
195 const std::string& value); 197 const std::string& value);
209 size_t GetBufferSize(); 211 size_t GetBufferSize();
210 212
211 const DicomMap& GetSummary(); 213 const DicomMap& GetSummary();
212 214
213 const Json::Value& GetJson(); 215 const Json::Value& GetJson();
216
217 void GetOriginInformation(Json::Value& result) const;
214 }; 218 };
215 } 219 }