annotate OrthancServer/Sources/QueryRetrieveHandler.h @ 5640:f7adfb22e20e

updated copyright, as Orthanc Team now replaces Osimis
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 May 2024 21:19:57 +0200
parents 48b8dae6dc77
children
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
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
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * 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
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
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 #pragma once
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
4045
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
26 #include "../../OrthancFramework/Sources/DicomNetworking/DicomFindAnswers.h"
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
27 #include "../../OrthancFramework/Sources/DicomNetworking/RemoteModalityParameters.h"
1368
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 namespace Orthanc
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
3096
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
31 class ServerContext;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
32
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 class QueryRetrieveHandler : public IDynamicObject
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 private:
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 ServerContext& context_;
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
37 std::string localAet_;
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 bool done_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 RemoteModalityParameters modality_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 ResourceType level_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 DicomMap query_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 DicomFindAnswers answers_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 std::string modalityName_;
3370
872bd3b6ec72 "/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3096
diff changeset
44 bool findNormalized_;
4517
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
45 uint32_t timeout_; // New in Orthanc 1.9.1
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 void Invalidate();
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 public:
4205
d962a2996637 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
50 explicit QueryRetrieveHandler(ServerContext& context);
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 void SetModality(const std::string& symbolicName);
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
54 const RemoteModalityParameters& GetRemoteModality() const
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 return modality_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 }
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
4462
da460bef88f8 "/modalities/{...}/query": New string argument "LocalAet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
59 void SetLocalAet(const std::string& localAet);
da460bef88f8 "/modalities/{...}/query": New string argument "LocalAet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
60
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
61 const std::string& GetLocalAet() const
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
62 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
63 return localAet_;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
64 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
65
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 const std::string& GetModalitySymbolicName() const
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 {
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 return modalityName_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 }
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 void SetLevel(ResourceType level);
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 ResourceType GetLevel() const
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 {
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 return level_;
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
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 void SetQuery(const DicomTag& tag,
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 const std::string& value);
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 const DicomMap& GetQuery() const
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 return query_;
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 }
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
2986
b1ba0a8311b5 exploring hierarchy of C-FIND answers finished
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2867
diff changeset
86 void CopyStringTag(const DicomMap& from,
b1ba0a8311b5 exploring hierarchy of C-FIND answers finished
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2867
diff changeset
87 const DicomTag& tag);
b1ba0a8311b5 exploring hierarchy of C-FIND answers finished
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2867
diff changeset
88
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 void Run();
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2843
diff changeset
91 size_t GetAnswersCount();
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
1787
1b1d5470233f refactoring of DicomFindAnswers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1427
diff changeset
93 void GetAnswer(DicomMap& target,
1b1d5470233f refactoring of DicomFindAnswers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1427
diff changeset
94 size_t i);
3370
872bd3b6ec72 "/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3096
diff changeset
95
872bd3b6ec72 "/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3096
diff changeset
96 bool IsFindNormalized() const
872bd3b6ec72 "/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3096
diff changeset
97 {
872bd3b6ec72 "/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3096
diff changeset
98 return findNormalized_;
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
872bd3b6ec72 "/modalities/{id}/query": New argument "Normalize"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3096
diff changeset
101 void SetFindNormalized(bool normalized);
4517
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
102
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
103 void SetTimeout(uint32_t seconds)
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
104 {
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
105 timeout_ = seconds;
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
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
108 uint32_t GetTimeout() const
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
109 {
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
110 return timeout_;
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
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
113 bool HasTimeout() const
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
114 {
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
115 return timeout_ != 0;
c494ee5d0101 Added "Timeout" parameter everywhere in "/modalities/.../"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4462
diff changeset
116 }
1368
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 };
b22ba8c5edbe query retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 }