diff OrthancServer/DatabaseWrapper.cpp @ 1299:4ce47e8ed0d2

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 06 Feb 2015 15:13:05 +0100
parents 910478b2d4e4
children 919dfb2fb3fe
line wrap: on
line diff
--- a/OrthancServer/DatabaseWrapper.cpp	Fri Feb 06 14:42:30 2015 +0100
+++ b/OrthancServer/DatabaseWrapper.cpp	Fri Feb 06 15:13:05 2015 +0100
@@ -221,34 +221,7 @@
     s.BindInt(0, type);
     s.BindString(1, publicId);
     s.Run();
-    int64_t id = db_.GetLastInsertRowId();
-
-    ChangeType changeType;
-    switch (type)
-    {
-    case ResourceType_Patient: 
-      changeType = ChangeType_NewPatient; 
-      break;
-
-    case ResourceType_Study: 
-      changeType = ChangeType_NewStudy; 
-      break;
-
-    case ResourceType_Series: 
-      changeType = ChangeType_NewSeries; 
-      break;
-
-    case ResourceType_Instance: 
-      changeType = ChangeType_NewInstance; 
-      break;
-
-    default:
-      throw OrthancException(ErrorCode_InternalError);
-    }
-
-    ServerIndexChange change(changeType, type, publicId);
-    LogChange(id, change);
-    return id;
+    return db_.GetLastInsertRowId();
   }
 
   bool DatabaseWrapper::LookupResource(int64_t& id,