Mercurial > hg > orthanc
comparison OrthancServer/Sources/Search/DatabaseMetadataConstraint.h @ 5828:7030fa489669 find-refactoring
tools/find: QueryMetadata
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Mon, 07 Oct 2024 15:19:26 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
5827:976872a99d39 | 5828:7030fa489669 |
---|---|
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 #include "IDatabaseConstraint.h" | |
29 | |
30 namespace Orthanc | |
31 { | |
32 class DatabaseMetadataConstraint : public IDatabaseConstraint | |
33 { | |
34 private: | |
35 MetadataType metadata_; | |
36 ConstraintType constraintType_; | |
37 std::vector<std::string> values_; | |
38 bool caseSensitive_; | |
39 | |
40 public: | |
41 DatabaseMetadataConstraint(MetadataType metadata, | |
42 ConstraintType type, | |
43 const std::string& value, | |
44 bool caseSensitive); | |
45 | |
46 DatabaseMetadataConstraint(MetadataType metadata, | |
47 ConstraintType type, | |
48 const std::vector<std::string>& values, | |
49 bool caseSensitive); | |
50 | |
51 const MetadataType& GetMetadata() const | |
52 { | |
53 return metadata_; | |
54 } | |
55 | |
56 virtual ConstraintType GetConstraintType() const ORTHANC_OVERRIDE | |
57 { | |
58 return constraintType_; | |
59 } | |
60 | |
61 virtual size_t GetValuesCount() const ORTHANC_OVERRIDE | |
62 { | |
63 return values_.size(); | |
64 } | |
65 | |
66 virtual const std::string& GetValue(size_t index) const ORTHANC_OVERRIDE; | |
67 | |
68 virtual const std::string& GetSingleValue() const ORTHANC_OVERRIDE; | |
69 | |
70 virtual bool IsCaseSensitive() const ORTHANC_OVERRIDE | |
71 { | |
72 return caseSensitive_; | |
73 } | |
74 | |
75 virtual bool IsMandatory() const ORTHANC_OVERRIDE | |
76 { | |
77 return true; | |
78 } | |
79 | |
80 }; | |
81 } |