Mercurial > hg > orthanc
comparison OrthancServer/QueryRetrieveHandler.cpp @ 1787:1b1d5470233f worklists
refactoring of DicomFindAnswers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 18 Nov 2015 15:50:32 +0100 |
parents | d710ea64f0fd |
children | b1291df2f780 |
comparison
equal
deleted
inserted
replaced
1786:164d78911382 | 1787:1b1d5470233f |
---|---|
93 Run(); | 93 Run(); |
94 return answers_.GetSize(); | 94 return answers_.GetSize(); |
95 } | 95 } |
96 | 96 |
97 | 97 |
98 const DicomMap& QueryRetrieveHandler::GetAnswer(size_t i) | 98 void QueryRetrieveHandler::GetAnswer(DicomMap& target, |
99 size_t i) | |
99 { | 100 { |
100 Run(); | 101 Run(); |
101 | 102 answers_.GetAnswer(i).Convert(target); |
102 if (i >= answers_.GetSize()) | |
103 { | |
104 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
105 } | |
106 | |
107 return answers_.GetAnswer(i); | |
108 } | 103 } |
109 | 104 |
110 | 105 |
111 void QueryRetrieveHandler::Retrieve(const std::string& target, | 106 void QueryRetrieveHandler::Retrieve(const std::string& target, |
112 size_t i) | 107 size_t i) |
113 { | 108 { |
114 Run(); | 109 DicomMap map; |
110 GetAnswer(map, i); | |
115 | 111 |
116 if (i >= answers_.GetSize()) | |
117 { | 112 { |
118 throw OrthancException(ErrorCode_ParameterOutOfRange); | 113 ReusableDicomUserConnection::Locker locker(context_.GetReusableDicomUserConnection(), localAet_, modality_); |
114 locker.GetConnection().Move(target, map); | |
119 } | 115 } |
120 | |
121 ReusableDicomUserConnection::Locker locker(context_.GetReusableDicomUserConnection(), localAet_, modality_); | |
122 locker.GetConnection().Move(target, answers_.GetAnswer(i)); | |
123 } | 116 } |
124 | 117 |
125 | 118 |
126 void QueryRetrieveHandler::Retrieve(const std::string& target) | 119 void QueryRetrieveHandler::Retrieve(const std::string& target) |
127 { | 120 { |