comparison OrthancServer/DatabaseWrapper.cpp @ 1246:54bf0f0245f4

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 08 Dec 2014 12:56:30 +0100
parents a0e420c5f2b8
children 32fcc5dc7562
comparison
equal deleted inserted replaced
1245:aea9277dee75 1246:54bf0f0245f4
655 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT * FROM Changes ORDER BY seq DESC LIMIT 1"); 655 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT * FROM Changes ORDER BY seq DESC LIMIT 1");
656 GetChangesInternal(target, done, s, 1); 656 GetChangesInternal(target, done, s, 1);
657 } 657 }
658 658
659 659
660 void DatabaseWrapper::LogExportedResource(ResourceType resourceType, 660 void DatabaseWrapper::LogExportedResource(const ExportedResource& resource)
661 const std::string& publicId,
662 const std::string& remoteModality,
663 const std::string& patientId,
664 const std::string& studyInstanceUid,
665 const std::string& seriesInstanceUid,
666 const std::string& sopInstanceUid,
667 const boost::posix_time::ptime& date)
668 { 661 {
669 SQLite::Statement s(db_, SQLITE_FROM_HERE, 662 SQLite::Statement s(db_, SQLITE_FROM_HERE,
670 "INSERT INTO ExportedResources VALUES(NULL, ?, ?, ?, ?, ?, ?, ?, ?)"); 663 "INSERT INTO ExportedResources VALUES(NULL, ?, ?, ?, ?, ?, ?, ?, ?)");
671 664
672 s.BindInt(0, resourceType); 665 s.BindInt(0, resource.GetResourceType());
673 s.BindString(1, publicId); 666 s.BindString(1, resource.GetPublicId());
674 s.BindString(2, remoteModality); 667 s.BindString(2, resource.GetModality());
675 s.BindString(3, patientId); 668 s.BindString(3, resource.GetPatientId());
676 s.BindString(4, studyInstanceUid); 669 s.BindString(4, resource.GetStudyInstanceUid());
677 s.BindString(5, seriesInstanceUid); 670 s.BindString(5, resource.GetSeriesInstanceUid());
678 s.BindString(6, sopInstanceUid); 671 s.BindString(6, resource.GetSopInstanceUid());
679 s.BindString(7, boost::posix_time::to_iso_string(date)); 672 s.BindString(7, resource.GetDate());
680
681 s.Run(); 673 s.Run();
682 } 674 }
683 675
684 676
685 void DatabaseWrapper::GetExportedResourcesInternal(std::list<ExportedResource>& target, 677 void DatabaseWrapper::GetExportedResourcesInternal(std::list<ExportedResource>& target,