changeset 1715:c3baf74e443f db-changes

simplify
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 16 Oct 2015 18:34:53 +0200
parents 81d718bba599
children 2ca7888f8600
files OrthancServer/DatabaseWrapperBase.cpp
diffstat 1 files changed, 9 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/DatabaseWrapperBase.cpp	Fri Oct 16 18:19:28 2015 +0200
+++ b/OrthancServer/DatabaseWrapperBase.cpp	Fri Oct 16 18:34:53 2015 +0200
@@ -312,11 +312,11 @@
   }
 
 
-  static void SetMainDicomTagsInternal(SQLite::Statement& s,
-                                       int64_t id,
-                                       const DicomTag& tag,
-                                       const std::string& value)
+  void DatabaseWrapperBase::SetMainDicomTag(int64_t id,
+                                            const DicomTag& tag,
+                                            const std::string& value)
   {
+    SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO MainDicomTags VALUES(?, ?, ?, ?)");
     s.BindInt64(0, id);
     s.BindInt(1, tag.GetGroup());
     s.BindInt(2, tag.GetElement());
@@ -325,21 +325,16 @@
   }
 
 
-  void DatabaseWrapperBase::SetMainDicomTag(int64_t id,
-                                            const DicomTag& tag,
-                                            const std::string& value)
-  {
-    SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO MainDicomTags VALUES(?, ?, ?, ?)");
-    SetMainDicomTagsInternal(s, id, tag, value);
-  }
-
-
   void DatabaseWrapperBase::SetIdentifierTag(int64_t id,
                                              const DicomTag& tag,
                                              const std::string& value)
   {
     SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO DicomIdentifiers VALUES(?, ?, ?, ?)");
-    SetMainDicomTagsInternal(s, id, tag, value);
+    s.BindInt64(0, id);
+    s.BindInt(1, tag.GetGroup());
+    s.BindInt(2, tag.GetElement());
+    s.BindString(3, value);
+    s.Run();
   }