comparison OrthancServer/Sources/Search/DatabaseConstraint.h @ 5834:79a497908b04 attach-custom-data tip

merged find-refactoring -> attach-custom-data
author Alain Mazy <am@orthanc.team>
date Wed, 09 Oct 2024 11:06:20 +0200
parents 79ac3924eff8 dd2af8692cbc
children
comparison
equal deleted inserted replaced
5824:79ac3924eff8 5834:79a497908b04
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
8 *
9 * This program is free software: you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation, either version 3 of the
12 * License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 **/
22
23
24 #pragma once
25
26 #include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h"
27 #include "../ServerEnumerations.h"
28
29 #if ORTHANC_ENABLE_PLUGINS == 1
30 # include "../../Plugins/Include/orthanc/OrthancCDatabasePlugin.h"
31 #endif
32
33 namespace Orthanc
34 {
35 class DatabaseConstraint : public boost::noncopyable
36 {
37 private:
38 ResourceType level_;
39 DicomTag tag_;
40 bool isIdentifier_;
41 ConstraintType constraintType_;
42 std::vector<std::string> values_;
43 bool caseSensitive_;
44 bool mandatory_;
45
46 public:
47 DatabaseConstraint(ResourceType level,
48 const DicomTag& tag,
49 bool isIdentifier,
50 ConstraintType type,
51 const std::vector<std::string>& values,
52 bool caseSensitive,
53 bool mandatory);
54
55 ResourceType GetLevel() const
56 {
57 return level_;
58 }
59
60 const DicomTag& GetTag() const
61 {
62 return tag_;
63 }
64
65 bool IsIdentifier() const
66 {
67 return isIdentifier_;
68 }
69
70 ConstraintType GetConstraintType() const
71 {
72 return constraintType_;
73 }
74
75 size_t GetValuesCount() const
76 {
77 return values_.size();
78 }
79
80 const std::string& GetValue(size_t index) const;
81
82 const std::string& GetSingleValue() const;
83
84 bool IsCaseSensitive() const
85 {
86 return caseSensitive_;
87 }
88
89 bool IsMandatory() const
90 {
91 return mandatory_;
92 }
93
94 bool IsMatch(const DicomMap& dicom) const;
95
96 #if ORTHANC_ENABLE_PLUGINS == 1
97 void EncodeForPlugins(OrthancPluginDatabaseConstraint& constraint,
98 std::vector<const char*>& tmpValues) const;
99 #endif
100 };
101 }