Mercurial > hg > orthanc
changeset 2120:4b02ec79728a
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 07 Nov 2016 11:19:19 +0100 |
parents | e0517f25919e |
children | 7e8889bc95c6 |
files | OrthancServer/DatabaseWrapper.cpp OrthancServer/Internals/StoreScp.cpp OrthancServer/OrthancFindRequestHandler.cpp OrthancServer/OrthancRestApi/OrthancRestResources.cpp OrthancServer/ServerContext.cpp OrthancServer/ServerIndex.cpp OrthancServer/ServerToolbox.cpp OrthancServer/ServerToolbox.h Plugins/Engine/OrthancPlugins.cpp UnitTestsSources/FromDcmtkTests.cpp |
diffstat | 10 files changed, 38 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancServer/DatabaseWrapper.cpp Sun Nov 06 11:39:04 2016 +0100 +++ b/OrthancServer/DatabaseWrapper.cpp Mon Nov 07 11:19:19 2016 +0100 @@ -373,10 +373,10 @@ // consists in reconstructing the main DICOM tags information // (as more tags got included). db_.BeginTransaction(); - Toolbox::ReconstructMainDicomTags(*this, storageArea, ResourceType_Patient); - Toolbox::ReconstructMainDicomTags(*this, storageArea, ResourceType_Study); - Toolbox::ReconstructMainDicomTags(*this, storageArea, ResourceType_Series); - Toolbox::ReconstructMainDicomTags(*this, storageArea, ResourceType_Instance); + ServerToolbox::ReconstructMainDicomTags(*this, storageArea, ResourceType_Patient); + ServerToolbox::ReconstructMainDicomTags(*this, storageArea, ResourceType_Study); + ServerToolbox::ReconstructMainDicomTags(*this, storageArea, ResourceType_Series); + ServerToolbox::ReconstructMainDicomTags(*this, storageArea, ResourceType_Instance); db_.Execute("UPDATE GlobalProperties SET value=\"6\" WHERE property=" + boost::lexical_cast<std::string>(GlobalProperty_DatabaseSchemaVersion) + ";"); db_.CommitTransaction();
--- a/OrthancServer/Internals/StoreScp.cpp Sun Nov 06 11:39:04 2016 +0100 +++ b/OrthancServer/Internals/StoreScp.cpp Mon Nov 07 11:19:19 2016 +0100 @@ -219,7 +219,7 @@ if (e.GetErrorCode() == ErrorCode_InexistentTag) { - Toolbox::LogMissingRequiredTag(summary); + ServerToolbox::LogMissingRequiredTag(summary); } else {
--- a/OrthancServer/OrthancFindRequestHandler.cpp Sun Nov 06 11:39:04 2016 +0100 +++ b/OrthancServer/OrthancFindRequestHandler.cpp Mon Nov 07 11:19:19 2016 +0100 @@ -401,7 +401,7 @@ for (Json::Value::ArrayIndex i = 0; i < source["Value"].size(); i++) { Json::Value item; - Toolbox::SimplifyTags(item, source["Value"][i], DicomToJsonFormat_Short); + ServerToolbox::SimplifyTags(item, source["Value"][i], DicomToJsonFormat_Short); content.append(item); }
--- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Sun Nov 06 11:39:04 2016 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Mon Nov 07 11:19:19 2016 +0100 @@ -209,7 +209,7 @@ context.ReadJson(full, publicId); Json::Value simplified; - Toolbox::SimplifyTags(simplified, full, DicomToJsonFormat_Human); + ServerToolbox::SimplifyTags(simplified, full, DicomToJsonFormat_Human); call.GetOutput().AnswerJson(simplified); } else @@ -937,7 +937,7 @@ if (simplify) { Json::Value simplified; - Toolbox::SimplifyTags(simplified, sharedTags, DicomToJsonFormat_Human); + ServerToolbox::SimplifyTags(simplified, sharedTags, DicomToJsonFormat_Human); call.GetOutput().AnswerJson(simplified); } else @@ -1004,7 +1004,7 @@ if (simplify) { Json::Value simplified; - Toolbox::SimplifyTags(simplified, result, DicomToJsonFormat_Human); + ServerToolbox::SimplifyTags(simplified, result, DicomToJsonFormat_Human); call.GetOutput().AnswerJson(simplified); } else @@ -1210,7 +1210,7 @@ if (simplify) { Json::Value simplified; - Toolbox::SimplifyTags(simplified, full, DicomToJsonFormat_Human); + ServerToolbox::SimplifyTags(simplified, full, DicomToJsonFormat_Human); result[*it] = simplified; } else @@ -1307,7 +1307,7 @@ if (simplify) { Json::Value simplified; - Toolbox::SimplifyTags(simplified, header, DicomToJsonFormat_Human); + ServerToolbox::SimplifyTags(simplified, header, DicomToJsonFormat_Human); call.GetOutput().AnswerJson(simplified); } else
--- a/OrthancServer/ServerContext.cpp Sun Nov 06 11:39:04 2016 +0100 +++ b/OrthancServer/ServerContext.cpp Mon Nov 07 11:19:19 2016 +0100 @@ -189,7 +189,7 @@ resultPublicId = hasher.HashInstance(); Json::Value simplifiedTags; - Toolbox::SimplifyTags(simplifiedTags, dicom.GetJson(), DicomToJsonFormat_Human); + ServerToolbox::SimplifyTags(simplifiedTags, dicom.GetJson(), DicomToJsonFormat_Human); // Test if the instance must be filtered out bool accepted = true; @@ -298,7 +298,7 @@ { if (e.GetErrorCode() == ErrorCode_InexistentTag) { - Toolbox::LogMissingRequiredTag(dicom.GetSummary()); + ServerToolbox::LogMissingRequiredTag(dicom.GetSummary()); } throw;
--- a/OrthancServer/ServerIndex.cpp Sun Nov 06 11:39:04 2016 +0100 +++ b/OrthancServer/ServerIndex.cpp Mon Nov 07 11:19:19 2016 +0100 @@ -634,7 +634,7 @@ // Create the instance int64_t instance = CreateResource(hasher.HashInstance(), ResourceType_Instance); - Toolbox::SetMainDicomTags(db_, instance, ResourceType_Instance, dicomSummary); + ServerToolbox::StoreMainDicomTags(db_, instance, ResourceType_Instance, dicomSummary); // Detect up to which level the patient/study/series/instance // hierarchy must be created @@ -686,21 +686,21 @@ if (isNewSeries) { series = CreateResource(hasher.HashSeries(), ResourceType_Series); - Toolbox::SetMainDicomTags(db_, series, ResourceType_Series, dicomSummary); + ServerToolbox::StoreMainDicomTags(db_, series, ResourceType_Series, dicomSummary); } // Create the study if needed if (isNewStudy) { study = CreateResource(hasher.HashStudy(), ResourceType_Study); - Toolbox::SetMainDicomTags(db_, study, ResourceType_Study, dicomSummary); + ServerToolbox::StoreMainDicomTags(db_, study, ResourceType_Study, dicomSummary); } // Create the patient if needed if (isNewPatient) { patient = CreateResource(hasher.HashPatient(), ResourceType_Patient); - Toolbox::SetMainDicomTags(db_, patient, ResourceType_Patient, dicomSummary); + ServerToolbox::StoreMainDicomTags(db_, patient, ResourceType_Patient, dicomSummary); } // Create the parent-to-child links @@ -2180,7 +2180,7 @@ assert(db_.GetResourceType(*it) == lookup.GetLevel()); int64_t instance; - if (!Toolbox::FindOneChildInstance(instance, db_, *it, lookup.GetLevel())) + if (!ServerToolbox::FindOneChildInstance(instance, db_, *it, lookup.GetLevel())) { throw OrthancException(ErrorCode_InternalError); }
--- a/OrthancServer/ServerToolbox.cpp Sun Nov 06 11:39:04 2016 +0100 +++ b/OrthancServer/ServerToolbox.cpp Mon Nov 07 11:19:19 2016 +0100 @@ -44,7 +44,7 @@ namespace Orthanc { - namespace Toolbox + namespace ServerToolbox { void SimplifyTags(Json::Value& target, const Json::Value& source, @@ -189,9 +189,9 @@ } - static void SetMainDicomTagsInternal(IDatabaseWrapper& database, - int64_t resource, - const DicomMap& tags) + static void StoreMainDicomTagsInternal(IDatabaseWrapper& database, + int64_t resource, + const DicomMap& tags) { DicomArray flattened(tags); @@ -209,10 +209,10 @@ } - void SetMainDicomTags(IDatabaseWrapper& database, - int64_t resource, - ResourceType level, - const DicomMap& dicomSummary) + void StoreMainDicomTags(IDatabaseWrapper& database, + int64_t resource, + ResourceType level, + const DicomMap& dicomSummary) { // WARNING: The database should be locked with a transaction! @@ -229,7 +229,7 @@ case ResourceType_Study: // Duplicate the patient tags at the study level (new in Orthanc 0.9.5 - db v6) dicomSummary.ExtractPatientInformation(tags); - SetMainDicomTagsInternal(database, resource, tags); + StoreMainDicomTagsInternal(database, resource, tags); dicomSummary.ExtractStudyInformation(tags); break; @@ -246,7 +246,7 @@ throw OrthancException(ErrorCode_InternalError); } - SetMainDicomTagsInternal(database, resource, tags); + StoreMainDicomTagsInternal(database, resource, tags); } @@ -350,7 +350,7 @@ dicom.Convert(dicomSummary); database.ClearMainDicomTags(resource); - Toolbox::SetMainDicomTags(database, resource, level, dicomSummary); + StoreMainDicomTags(database, resource, level, dicomSummary); } catch (OrthancException&) {
--- a/OrthancServer/ServerToolbox.h Sun Nov 06 11:39:04 2016 +0100 +++ b/OrthancServer/ServerToolbox.h Mon Nov 07 11:19:19 2016 +0100 @@ -39,7 +39,7 @@ namespace Orthanc { - namespace Toolbox + namespace ServerToolbox { void SimplifyTags(Json::Value& target, const Json::Value& source, @@ -47,10 +47,10 @@ void LogMissingRequiredTag(const DicomMap& summary); - void SetMainDicomTags(IDatabaseWrapper& database, - int64_t resource, - ResourceType level, - const DicomMap& dicomSummary); + void StoreMainDicomTags(IDatabaseWrapper& database, + int64_t resource, + ResourceType level, + const DicomMap& dicomSummary); bool FindOneChildInstance(int64_t& result, IDatabaseWrapper& database,
--- a/Plugins/Engine/OrthancPlugins.cpp Sun Nov 06 11:39:04 2016 +0100 +++ b/Plugins/Engine/OrthancPlugins.cpp Mon Nov 07 11:19:19 2016 +0100 @@ -1563,7 +1563,7 @@ else { Json::Value simplified; - Toolbox::SimplifyTags(simplified, instance.GetJson(), DicomToJsonFormat_Human); + ServerToolbox::SimplifyTags(simplified, instance.GetJson(), DicomToJsonFormat_Human); s = writer.write(simplified); } @@ -2784,7 +2784,7 @@ } IStorageArea& storage = *reinterpret_cast<IStorageArea*>(p.storageArea); - Toolbox::ReconstructMainDicomTags(*pimpl_->database_, storage, Plugins::Convert(p.level)); + ServerToolbox::ReconstructMainDicomTags(*pimpl_->database_, storage, Plugins::Convert(p.level)); return true; }
--- a/UnitTestsSources/FromDcmtkTests.cpp Sun Nov 06 11:39:04 2016 +0100 +++ b/UnitTestsSources/FromDcmtkTests.cpp Mon Nov 07 11:19:19 2016 +0100 @@ -445,7 +445,7 @@ FromDcmtkBridge::ToJson(b, *element, DicomToJsonFormat_Full, DicomToJsonFlags_Default, 0, Encoding_Ascii); Json::Value c; - Toolbox::SimplifyTags(c, b, DicomToJsonFormat_Human); + ServerToolbox::SimplifyTags(c, b, DicomToJsonFormat_Human); a[1]["PatientName"] = "Hello2"; // To remove the Data URI Scheme encoding ASSERT_EQ(0, c["ReferencedStudySequence"].compare(a)); @@ -525,7 +525,7 @@ f.ToJson(b, DicomToJsonFormat_Full, DicomToJsonFlags_Default, 0); Json::Value c; - Toolbox::SimplifyTags(c, b, DicomToJsonFormat_Human); + ServerToolbox::SimplifyTags(c, b, DicomToJsonFormat_Human); ASSERT_EQ(0, c["ReferencedPatientSequence"].compare(a)); ASSERT_NE(0, c["ReferencedStudySequence"].compare(a)); // Because Data URI Scheme decoding was enabled