comparison OrthancServer/OrthancMoveRequestHandler.cpp @ 1744:b3de74dec2d5 db-changes

integration mainline->db-changes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 26 Oct 2015 12:30:34 +0100
parents 4941494b5dd8 ec66a16aa398
children 4f01c9d73f02
comparison
equal deleted inserted replaced
1729:54d78925cbb6 1744:b3de74dec2d5
136 if (!input.HasTag(tag)) 136 if (!input.HasTag(tag))
137 { 137 {
138 return false; 138 return false;
139 } 139 }
140 140
141 std::string value = input.GetValue(tag).AsString(); 141 const DicomValue& value = input.GetValue(tag);
142 if (value.IsNull() ||
143 value.IsBinary())
144 {
145 return false;
146 }
147
148 const std::string& content = value.GetContent();
142 149
143 std::list<std::string> ids; 150 std::list<std::string> ids;
144 context_.GetIndex().LookupIdentifierExact(ids, level, tag, value); 151 context_.GetIndex().LookupIdentifierExact(ids, level, tag, content);
145 152
146 if (ids.size() != 1) 153 if (ids.size() != 1)
147 { 154 {
148 return false; 155 return false;
149 } 156 }
168 { 175 {
169 if (!query.GetElement(i).GetValue().IsNull()) 176 if (!query.GetElement(i).GetValue().IsNull())
170 { 177 {
171 LOG(INFO) << " " << query.GetElement(i).GetTag() 178 LOG(INFO) << " " << query.GetElement(i).GetTag()
172 << " " << FromDcmtkBridge::GetName(query.GetElement(i).GetTag()) 179 << " " << FromDcmtkBridge::GetName(query.GetElement(i).GetTag())
173 << " = " << query.GetElement(i).GetValue().AsString(); 180 << " = " << query.GetElement(i).GetValue().GetContent();
174 } 181 }
175 } 182 }
176 } 183 }
177 184
178 185
181 * Retrieve the query level. 188 * Retrieve the query level.
182 **/ 189 **/
183 190
184 const DicomValue* levelTmp = input.TestAndGetValue(DICOM_TAG_QUERY_RETRIEVE_LEVEL); 191 const DicomValue* levelTmp = input.TestAndGetValue(DICOM_TAG_QUERY_RETRIEVE_LEVEL);
185 192
186 if (levelTmp == NULL) 193 if (levelTmp == NULL ||
194 levelTmp->IsNull() ||
195 levelTmp->IsBinary())
187 { 196 {
188 // The query level is not present in the C-Move request, which 197 // The query level is not present in the C-Move request, which
189 // does not follow the DICOM standard. This is for instance the 198 // does not follow the DICOM standard. This is for instance the
190 // behavior of Tudor DICOM. Try and automatically deduce the 199 // behavior of Tudor DICOM. Try and automatically deduce the
191 // query level: Start from the instance level, going up to the 200 // query level: Start from the instance level, going up to the
206 throw OrthancException(ErrorCode_BadRequest); 215 throw OrthancException(ErrorCode_BadRequest);
207 } 216 }
208 } 217 }
209 218
210 assert(levelTmp != NULL); 219 assert(levelTmp != NULL);
211 ResourceType level = StringToResourceType(levelTmp->AsString().c_str()); 220 ResourceType level = StringToResourceType(levelTmp->GetContent().c_str());
212 221
213 222
214 /** 223 /**
215 * Lookup for the resource to be sent. 224 * Lookup for the resource to be sent.
216 **/ 225 **/