comparison Framework/Plugins/DatabaseConstraint.h @ 551:1a23f1ce3b98

move classes DatabaseConstraint and ISqlLookupFormatter into namespace OrthancDatabases
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 09 Sep 2024 15:19:28 +0200
parents e620f36b8e09
children 7f45f23b10d0
comparison
equal deleted inserted replaced
549:e620f36b8e09 551:1a23f1ce3b98
43 43
44 #include <DicomFormat/DicomMap.h> 44 #include <DicomFormat/DicomMap.h>
45 45
46 #include <deque> 46 #include <deque>
47 47
48 namespace Orthanc 48 namespace OrthancDatabases
49 { 49 {
50 enum ConstraintType 50 enum ConstraintType
51 { 51 {
52 ConstraintType_Equal, 52 ConstraintType_Equal,
53 ConstraintType_SmallerOrEqual, 53 ConstraintType_SmallerOrEqual,
56 ConstraintType_List 56 ConstraintType_List
57 }; 57 };
58 58
59 namespace Plugins 59 namespace Plugins
60 { 60 {
61 OrthancPluginResourceType Convert(ResourceType type); 61 OrthancPluginResourceType Convert(Orthanc::ResourceType type);
62 62
63 ResourceType Convert(OrthancPluginResourceType type); 63 Orthanc::ResourceType Convert(OrthancPluginResourceType type);
64 64
65 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 65 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
66 OrthancPluginConstraintType Convert(ConstraintType constraint); 66 OrthancPluginConstraintType Convert(ConstraintType constraint);
67 #endif 67 #endif
68 68
73 73
74 74
75 class DatabaseConstraint : public boost::noncopyable 75 class DatabaseConstraint : public boost::noncopyable
76 { 76 {
77 private: 77 private:
78 ResourceType level_; 78 Orthanc::ResourceType level_;
79 DicomTag tag_; 79 Orthanc::DicomTag tag_;
80 bool isIdentifier_; 80 bool isIdentifier_;
81 ConstraintType constraintType_; 81 ConstraintType constraintType_;
82 std::vector<std::string> values_; 82 std::vector<std::string> values_;
83 bool caseSensitive_; 83 bool caseSensitive_;
84 bool mandatory_; 84 bool mandatory_;
85 85
86 public: 86 public:
87 DatabaseConstraint(ResourceType level, 87 DatabaseConstraint(Orthanc::ResourceType level,
88 const DicomTag& tag, 88 const Orthanc::DicomTag& tag,
89 bool isIdentifier, 89 bool isIdentifier,
90 ConstraintType type, 90 ConstraintType type,
91 const std::vector<std::string>& values, 91 const std::vector<std::string>& values,
92 bool caseSensitive, 92 bool caseSensitive,
93 bool mandatory); 93 bool mandatory);
94 94
95 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 95 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
96 explicit DatabaseConstraint(const OrthancPluginDatabaseConstraint& constraint); 96 explicit DatabaseConstraint(const OrthancPluginDatabaseConstraint& constraint);
97 #endif 97 #endif
98 98
99 ResourceType GetLevel() const 99 Orthanc::ResourceType GetLevel() const
100 { 100 {
101 return level_; 101 return level_;
102 } 102 }
103 103
104 const DicomTag& GetTag() const 104 const Orthanc::DicomTag& GetTag() const
105 { 105 {
106 return tag_; 106 return tag_;
107 } 107 }
108 108
109 bool IsIdentifier() const 109 bool IsIdentifier() const
133 bool IsMandatory() const 133 bool IsMandatory() const
134 { 134 {
135 return mandatory_; 135 return mandatory_;
136 } 136 }
137 137
138 bool IsMatch(const DicomMap& dicom) const; 138 bool IsMatch(const Orthanc::DicomMap& dicom) const;
139 139
140 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 140 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
141 void EncodeForPlugins(OrthancPluginDatabaseConstraint& constraint, 141 void EncodeForPlugins(OrthancPluginDatabaseConstraint& constraint,
142 std::vector<const char*>& tmpValues) const; 142 std::vector<const char*>& tmpValues) const;
143 #endif 143 #endif