annotate OrthancServer/QueryRetrieveHandler.h @ 3300:5b7f56cf4a38

note
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 23 Feb 2019 15:58:59 +0100
parents d9eb978a1039
children 872bd3b6ec72
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1787
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
3060
4e43e67f8ecf preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2986
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * your version of the file(s), but you are not obligated to do so. If
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 **/
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #pragma once
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
3096
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
36 #include "../Core/DicomNetworking/DicomFindAnswers.h"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
37 #include "../Core/DicomNetworking/RemoteModalityParameters.h"
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 namespace Orthanc
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 {
3096
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
41 class ServerContext;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
42
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 class QueryRetrieveHandler : public IDynamicObject
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 private:
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 ServerContext& context_;
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
47 std::string localAet_;
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 bool done_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 RemoteModalityParameters modality_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 ResourceType level_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 DicomMap query_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 DicomFindAnswers answers_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 std::string modalityName_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 void Invalidate();
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 public:
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 QueryRetrieveHandler(ServerContext& context);
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 void SetModality(const std::string& symbolicName);
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
62 const RemoteModalityParameters& GetRemoteModality() const
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 {
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 return modality_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 }
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
67 const std::string& GetLocalAet() const
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
68 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
69 return localAet_;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
70 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
71
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 const std::string& GetModalitySymbolicName() const
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 {
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 return modalityName_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 }
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 void SetLevel(ResourceType level);
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 ResourceType GetLevel() const
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 {
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 return level_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 }
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 void SetQuery(const DicomTag& tag,
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 const std::string& value);
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 const DicomMap& GetQuery() const
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 {
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 return query_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 }
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
2986
b1ba0a8311b5 exploring hierarchy of C-FIND answers finished
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2867
diff changeset
92 void CopyStringTag(const DicomMap& from,
b1ba0a8311b5 exploring hierarchy of C-FIND answers finished
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2867
diff changeset
93 const DicomTag& tag);
b1ba0a8311b5 exploring hierarchy of C-FIND answers finished
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2867
diff changeset
94
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 void Run();
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
97 size_t GetAnswersCount();
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
1787
1b1d5470233f refactoring of DicomFindAnswers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1427
diff changeset
99 void GetAnswer(DicomMap& target,
1b1d5470233f refactoring of DicomFindAnswers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1427
diff changeset
100 size_t i);
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 };
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 }