Mercurial > hg > orthanc
comparison OrthancServer/ServerJobs/SplitStudyJob.cpp @ 2847:2da68edacab6
unit testing of SplitStudyJob
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 28 Sep 2018 19:17:04 +0200 |
parents | d386abc18133 |
children | 8b00e4cb4a6b |
comparison
equal
deleted
inserted
replaced
2846:d386abc18133 | 2847:2da68edacab6 |
---|---|
240 | 240 |
241 keepSource_ = keep; | 241 keepSource_ = keep; |
242 } | 242 } |
243 | 243 |
244 | 244 |
245 bool SplitStudyJob::LookupTargetSeriesUid(std::string& uid, | |
246 const std::string& series) const | |
247 { | |
248 SeriesUidMap::const_iterator found = seriesUidMap_.find(series); | |
249 | |
250 if (found == seriesUidMap_.end()) | |
251 { | |
252 return false; | |
253 } | |
254 else | |
255 { | |
256 uid = found->second; | |
257 return true; | |
258 } | |
259 } | |
260 | |
261 | |
245 void SplitStudyJob::Remove(const DicomTag& tag) | 262 void SplitStudyJob::Remove(const DicomTag& tag) |
246 { | 263 { |
247 if (IsStarted()) | 264 if (IsStarted()) |
248 { | 265 { |
249 throw OrthancException(ErrorCode_BadSequenceOfCalls); | 266 throw OrthancException(ErrorCode_BadSequenceOfCalls); |
262 throw OrthancException(ErrorCode_BadSequenceOfCalls); | 279 throw OrthancException(ErrorCode_BadSequenceOfCalls); |
263 } | 280 } |
264 | 281 |
265 CheckAllowedTag(tag); | 282 CheckAllowedTag(tag); |
266 replacements_[tag] = value; | 283 replacements_[tag] = value; |
284 } | |
285 | |
286 | |
287 bool SplitStudyJob::LookupReplacement(std::string& value, | |
288 const DicomTag& tag) const | |
289 { | |
290 Replacements::const_iterator found = replacements_.find(tag); | |
291 | |
292 if (found == replacements_.end()) | |
293 { | |
294 return false; | |
295 } | |
296 else | |
297 { | |
298 value = found->second; | |
299 return true; | |
300 } | |
267 } | 301 } |
268 | 302 |
269 | 303 |
270 void SplitStudyJob::GetPublicContent(Json::Value& value) | 304 void SplitStudyJob::GetPublicContent(Json::Value& value) |
271 { | 305 { |