Mercurial > hg > orthanc
annotate OrthancServer/Sources/Database/Compatibility/ILookupResources.h @ 5852:ea547160f27e find-refactoring
StatelessDatabaseOperations: reimplementing LookupAttachment()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Oct 2024 15:57:53 +0000 |
parents | 7030fa489669 |
children |
rev | line source |
---|---|
3050
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
5640
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
3050
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * This program is free software: you can redistribute it and/or |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * modify it under the terms of the GNU General Public License as |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * published by the Free Software Foundation, either version 3 of the |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * License, or (at your option) any later version. |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * This program is distributed in the hope that it will be useful, but |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * WITHOUT ANY WARRANTY; without even the implied warranty of |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * General Public License for more details. |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * You should have received a copy of the GNU General Public License |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 **/ |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #pragma once |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
3093
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3085
diff
changeset
|
26 #include "../IDatabaseWrapper.h" |
3050
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 namespace Orthanc |
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 { |
3052
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
30 namespace Compatibility |
3050
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 { |
3052
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
32 /** |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
33 * This is a compatibility class that contains database primitives |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
34 * that were used in Orthanc <= 1.5.1, and that have been removed |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
35 * during the optimization of the database engine. |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
36 **/ |
3085 | 37 class ILookupResources : public boost::noncopyable |
3057 | 38 { |
3052
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
39 public: |
3085 | 40 virtual ~ILookupResources() |
3084 | 41 { |
42 } | |
43 | |
3056
6c5d4281da4a
removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3054
diff
changeset
|
44 virtual void GetAllInternalIds(std::list<int64_t>& target, |
6c5d4281da4a
removal of SQLiteDatabaseWrapper::GetAllInternalIds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3054
diff
changeset
|
45 ResourceType resourceType) = 0; |
3080
1a75595d8e44
started refactoring of ServerIndex::Store()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3077
diff
changeset
|
46 |
3052
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
47 virtual void LookupIdentifier(std::list<int64_t>& result, |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
48 ResourceType level, |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
49 const DicomTag& tag, |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
50 IdentifierConstraintType type, |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
51 const std::string& value) = 0; |
3050
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 |
3052
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
53 virtual void LookupIdentifierRange(std::list<int64_t>& result, |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
54 ResourceType level, |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
55 const DicomTag& tag, |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
56 const std::string& start, |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
57 const std::string& end) = 0; |
3084 | 58 |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
59 static void Apply(IDatabaseWrapper::ITransaction& transaction, |
3085 | 60 ILookupResources& compatibility, |
3084 | 61 std::list<std::string>& resourcesId, |
62 std::list<std::string>* instancesId, | |
5828 | 63 const DatabaseDicomTagConstraints& lookup, |
3084 | 64 ResourceType queryLevel, |
65 size_t limit); | |
3052
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
66 }; |
c7db469bbe8e
new class: Compatibility::DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3050
diff
changeset
|
67 } |
3050
d8a91acb7424
working on a database compatibility layer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 } |