diff OrthancServer/DatabaseWrapper.cpp @ 440:23e5b35e3c5c

statistics for patient/studies/series/instances
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 15 May 2013 17:44:15 +0200
parents 7bbe77cb9e12
children 935e8c7e0b18
line wrap: on
line diff
--- a/OrthancServer/DatabaseWrapper.cpp	Wed May 15 17:10:52 2013 +0200
+++ b/OrthancServer/DatabaseWrapper.cpp	Wed May 15 17:44:15 2013 +0200
@@ -438,6 +438,21 @@
     s.Run();
   }
 
+  void DatabaseWrapper::ListAvailableAttachments(std::list<FileContentType>& result,
+                                                 int64_t id)
+  {
+    result.clear();
+
+    SQLite::Statement s(db_, SQLITE_FROM_HERE, 
+                        "SELECT fileType FROM AttachedFiles WHERE id=?");
+    s.BindInt(0, id);
+
+    while (s.Step())
+    {
+      result.push_back(static_cast<FileContentType>(s.ColumnInt(0)));
+    }
+  }
+
   bool DatabaseWrapper::LookupAttachment(FileInfo& attachment,
                                          int64_t id,
                                          FileContentType contentType)