Mercurial > hg > orthanc-databases
diff Framework/Plugins/DatabaseConstraint.cpp @ 553:7f45f23b10d0 find-refactoring
integration mainline->find-refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Sep 2024 15:27:52 +0200 |
parents | 9ed9a91bde33 1a23f1ce3b98 |
children | 1a74fc1bea2d |
line wrap: on
line diff
--- a/Framework/Plugins/DatabaseConstraint.cpp Mon Sep 09 15:04:48 2024 +0200 +++ b/Framework/Plugins/DatabaseConstraint.cpp Mon Sep 09 15:27:52 2024 +0200 @@ -36,50 +36,50 @@ #include <cassert> -namespace Orthanc +namespace OrthancDatabases { namespace Plugins { - OrthancPluginResourceType Convert(ResourceType type) + OrthancPluginResourceType Convert(Orthanc::ResourceType type) { switch (type) { - case ResourceType_Patient: + case Orthanc::ResourceType_Patient: return OrthancPluginResourceType_Patient; - case ResourceType_Study: + case Orthanc::ResourceType_Study: return OrthancPluginResourceType_Study; - case ResourceType_Series: + case Orthanc::ResourceType_Series: return OrthancPluginResourceType_Series; - case ResourceType_Instance: + case Orthanc::ResourceType_Instance: return OrthancPluginResourceType_Instance; default: - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } } - ResourceType Convert(OrthancPluginResourceType type) + Orthanc::ResourceType Convert(OrthancPluginResourceType type) { switch (type) { case OrthancPluginResourceType_Patient: - return ResourceType_Patient; + return Orthanc::ResourceType_Patient; case OrthancPluginResourceType_Study: - return ResourceType_Study; + return Orthanc::ResourceType_Study; case OrthancPluginResourceType_Series: - return ResourceType_Series; + return Orthanc::ResourceType_Series; case OrthancPluginResourceType_Instance: - return ResourceType_Instance; + return Orthanc::ResourceType_Instance; default: - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } } @@ -105,7 +105,7 @@ return OrthancPluginConstraintType_List; default: - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } } #endif @@ -132,14 +132,14 @@ return ConstraintType_List; default: - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } } #endif } - DatabaseConstraint::DatabaseConstraint(ResourceType level, - const DicomTag& tag, + DatabaseConstraint::DatabaseConstraint(Orthanc::ResourceType level, + const Orthanc::DicomTag& tag, bool isIdentifier, ConstraintType type, const std::vector<std::string>& values, @@ -156,7 +156,7 @@ if (type != ConstraintType_List && values_.size() != 1) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } } @@ -173,7 +173,7 @@ if (constraintType_ != ConstraintType_List && constraint.valuesCount != 1) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } values_.resize(constraint.valuesCount); @@ -198,23 +198,23 @@ switch (constraint.type()) { case Orthanc::DatabasePluginMessages::CONSTRAINT_EQUAL: - constraintType_ = Orthanc::ConstraintType_Equal; + constraintType_ = ConstraintType_Equal; break; case Orthanc::DatabasePluginMessages::CONSTRAINT_SMALLER_OR_EQUAL: - constraintType_ = Orthanc::ConstraintType_SmallerOrEqual; + constraintType_ = ConstraintType_SmallerOrEqual; break; case Orthanc::DatabasePluginMessages::CONSTRAINT_GREATER_OR_EQUAL: - constraintType_ = Orthanc::ConstraintType_GreaterOrEqual; + constraintType_ = ConstraintType_GreaterOrEqual; break; case Orthanc::DatabasePluginMessages::CONSTRAINT_WILDCARD: - constraintType_ = Orthanc::ConstraintType_Wildcard; + constraintType_ = ConstraintType_Wildcard; break; case Orthanc::DatabasePluginMessages::CONSTRAINT_LIST: - constraintType_ = Orthanc::ConstraintType_List; + constraintType_ = ConstraintType_List; break; default: @@ -224,7 +224,7 @@ if (constraintType_ != ConstraintType_List && constraint.values().size() != 1) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } values_.resize(constraint.values().size()); @@ -241,7 +241,7 @@ { if (index >= values_.size()) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } else { @@ -254,7 +254,7 @@ { if (values_.size() != 1) { - throw OrthancException(ErrorCode_BadSequenceOfCalls); + throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); } else { @@ -305,7 +305,7 @@ { if (constraint == NULL) { - throw OrthancException(ErrorCode_NullPointer); + throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); } else { @@ -318,7 +318,7 @@ { if (index >= constraints_.size()) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } else { @@ -378,7 +378,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } s += "\n";