comparison OrthancServer/ServerToolbox.cpp @ 1669:a412ad57f0f9 db-changes

refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 01 Oct 2015 11:55:25 +0200
parents de1413733c97
children 0bbcfd9695e5
comparison
equal deleted inserted replaced
1668:de1413733c97 1669:a412ad57f0f9
233 IStorageArea& storageArea, 233 IStorageArea& storageArea,
234 ResourceType level) 234 ResourceType level)
235 { 235 {
236 // WARNING: The database should be locked with a transaction! 236 // WARNING: The database should be locked with a transaction!
237 237
238 const char* plural = NULL;
239
240 switch (level)
241 {
242 case ResourceType_Patient:
243 plural = "patients";
244 break;
245
246 case ResourceType_Study:
247 plural = "studies";
248 break;
249
250 case ResourceType_Series:
251 plural = "series";
252 break;
253
254 case ResourceType_Instance:
255 plural = "instances";
256 break;
257
258 default:
259 throw OrthancException(ErrorCode_InternalError);
260 }
261
262 LOG(WARNING) << "Upgrade: Reconstructing the main DICOM tags of all the " << plural << "...";
263
238 std::list<std::string> resources; 264 std::list<std::string> resources;
239 database.GetAllPublicIds(resources, level); 265 database.GetAllPublicIds(resources, level);
240 266
241 for (std::list<std::string>::const_iterator 267 for (std::list<std::string>::const_iterator
242 it = resources.begin(); it != resources.end(); it++) 268 it = resources.begin(); it != resources.end(); it++)