Mercurial > hg > orthanc
annotate OrthancServer/Sources/QueryRetrieveHandler.h @ 5588:1b0fc6685f57 find-refactoring
add index of resources into FindResponse
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 03 May 2024 17:20:27 +0200 |
parents | 48b8dae6dc77 |
children | f7adfb22e20e |
rev | line source |
---|---|
1368 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1368 | 4 * Department, University Hospital of Liege, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium |
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1368 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU General Public License as | |
10 * published by the Free Software Foundation, either version 3 of the | |
11 * License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 **/ | |
21 | |
22 | |
23 #pragma once | |
24 | |
4045 | 25 #include "../../OrthancFramework/Sources/DicomNetworking/DicomFindAnswers.h" |
26 #include "../../OrthancFramework/Sources/DicomNetworking/RemoteModalityParameters.h" | |
1368 | 27 |
28 namespace Orthanc | |
29 { | |
3096 | 30 class ServerContext; |
31 | |
1368 | 32 class QueryRetrieveHandler : public IDynamicObject |
33 { | |
34 private: | |
35 ServerContext& context_; | |
2867 | 36 std::string localAet_; |
1368 | 37 bool done_; |
38 RemoteModalityParameters modality_; | |
39 ResourceType level_; | |
40 DicomMap query_; | |
41 DicomFindAnswers answers_; | |
42 std::string modalityName_; | |
3370
872bd3b6ec72
"/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3096
diff
changeset
|
43 bool findNormalized_; |
4517
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
44 uint32_t timeout_; // New in Orthanc 1.9.1 |
1368 | 45 |
46 void Invalidate(); | |
47 | |
48 public: | |
4205 | 49 explicit QueryRetrieveHandler(ServerContext& context); |
1368 | 50 |
51 void SetModality(const std::string& symbolicName); | |
52 | |
2867 | 53 const RemoteModalityParameters& GetRemoteModality() const |
1368 | 54 { |
55 return modality_; | |
56 } | |
57 | |
4462
da460bef88f8
"/modalities/{...}/query": New string argument "LocalAet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
58 void SetLocalAet(const std::string& localAet); |
da460bef88f8
"/modalities/{...}/query": New string argument "LocalAet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
59 |
2867 | 60 const std::string& GetLocalAet() const |
61 { | |
62 return localAet_; | |
63 } | |
64 | |
1368 | 65 const std::string& GetModalitySymbolicName() const |
66 { | |
67 return modalityName_; | |
68 } | |
69 | |
70 void SetLevel(ResourceType level); | |
71 | |
72 ResourceType GetLevel() const | |
73 { | |
74 return level_; | |
75 } | |
76 | |
77 void SetQuery(const DicomTag& tag, | |
78 const std::string& value); | |
79 | |
80 const DicomMap& GetQuery() const | |
81 { | |
82 return query_; | |
83 } | |
84 | |
2986
b1ba0a8311b5
exploring hierarchy of C-FIND answers finished
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
85 void CopyStringTag(const DicomMap& from, |
b1ba0a8311b5
exploring hierarchy of C-FIND answers finished
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
86 const DicomTag& tag); |
b1ba0a8311b5
exploring hierarchy of C-FIND answers finished
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
87 |
1368 | 88 void Run(); |
89 | |
2867 | 90 size_t GetAnswersCount(); |
1368 | 91 |
1787
1b1d5470233f
refactoring of DicomFindAnswers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1427
diff
changeset
|
92 void GetAnswer(DicomMap& target, |
1b1d5470233f
refactoring of DicomFindAnswers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1427
diff
changeset
|
93 size_t i); |
3370
872bd3b6ec72
"/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3096
diff
changeset
|
94 |
872bd3b6ec72
"/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3096
diff
changeset
|
95 bool IsFindNormalized() const |
872bd3b6ec72
"/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3096
diff
changeset
|
96 { |
872bd3b6ec72
"/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3096
diff
changeset
|
97 return findNormalized_; |
872bd3b6ec72
"/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3096
diff
changeset
|
98 } |
872bd3b6ec72
"/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3096
diff
changeset
|
99 |
872bd3b6ec72
"/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3096
diff
changeset
|
100 void SetFindNormalized(bool normalized); |
4517
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
101 |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
102 void SetTimeout(uint32_t seconds) |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
103 { |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
104 timeout_ = seconds; |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
105 } |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
106 |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
107 uint32_t GetTimeout() const |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
108 { |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
109 return timeout_; |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
110 } |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
111 |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
112 bool HasTimeout() const |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
113 { |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
114 return timeout_ != 0; |
c494ee5d0101
Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4462
diff
changeset
|
115 } |
1368 | 116 }; |
117 } |