comparison OrthancServer/DatabaseWrapperBase.cpp @ 1715:c3baf74e443f db-changes

simplify
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 16 Oct 2015 18:34:53 +0200
parents 4db9200c7f46
children 2ca7888f8600
comparison
equal deleted inserted replaced
1714:81d718bba599 1715:c3baf74e443f
310 s.Run(); 310 s.Run();
311 } 311 }
312 } 312 }
313 313
314 314
315 static void SetMainDicomTagsInternal(SQLite::Statement& s, 315 void DatabaseWrapperBase::SetMainDicomTag(int64_t id,
316 int64_t id, 316 const DicomTag& tag,
317 const DicomTag& tag, 317 const std::string& value)
318 const std::string& value) 318 {
319 { 319 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO MainDicomTags VALUES(?, ?, ?, ?)");
320 s.BindInt64(0, id); 320 s.BindInt64(0, id);
321 s.BindInt(1, tag.GetGroup()); 321 s.BindInt(1, tag.GetGroup());
322 s.BindInt(2, tag.GetElement()); 322 s.BindInt(2, tag.GetElement());
323 s.BindString(3, value); 323 s.BindString(3, value);
324 s.Run(); 324 s.Run();
325 } 325 }
326 326
327 327
328 void DatabaseWrapperBase::SetMainDicomTag(int64_t id,
329 const DicomTag& tag,
330 const std::string& value)
331 {
332 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO MainDicomTags VALUES(?, ?, ?, ?)");
333 SetMainDicomTagsInternal(s, id, tag, value);
334 }
335
336
337 void DatabaseWrapperBase::SetIdentifierTag(int64_t id, 328 void DatabaseWrapperBase::SetIdentifierTag(int64_t id,
338 const DicomTag& tag, 329 const DicomTag& tag,
339 const std::string& value) 330 const std::string& value)
340 { 331 {
341 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO DicomIdentifiers VALUES(?, ?, ?, ?)"); 332 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO DicomIdentifiers VALUES(?, ?, ?, ?)");
342 SetMainDicomTagsInternal(s, id, tag, value); 333 s.BindInt64(0, id);
334 s.BindInt(1, tag.GetGroup());
335 s.BindInt(2, tag.GetElement());
336 s.BindString(3, value);
337 s.Run();
343 } 338 }
344 339
345 340
346 void DatabaseWrapperBase::GetMainDicomTags(DicomMap& map, 341 void DatabaseWrapperBase::GetMainDicomTags(DicomMap& map,
347 int64_t id) 342 int64_t id)