Mercurial > hg > orthanc
annotate OrthancServer/DicomProtocol/DicomUserConnection.h @ 2213:95d1d758abb7
FindMatcher::IsMatch
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 10 Dec 2016 10:17:44 +0100 |
parents | fabf7820d1f1 |
children | 21713ce8717b |
rev | line source |
---|---|
0 | 1 /** |
62 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1285
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
0 | 5 * |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
136 | 10 * |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
0 | 22 * |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 | |
33 #pragma once | |
34 | |
35 #include "DicomFindAnswers.h" | |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
36 #include "../ServerEnumerations.h" |
772
31cc399c7762
RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
763
diff
changeset
|
37 #include "RemoteModalityParameters.h" |
0 | 38 |
39 #include <stdint.h> | |
40 #include <boost/shared_ptr.hpp> | |
41 #include <boost/noncopyable.hpp> | |
763
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
42 #include <list> |
0 | 43 |
62 | 44 namespace Orthanc |
0 | 45 { |
46 class DicomUserConnection : public boost::noncopyable | |
47 { | |
48 private: | |
49 struct PImpl; | |
50 boost::shared_ptr<PImpl> pimpl_; | |
51 | |
52 // Connection parameters | |
662
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
53 std::string preferredTransferSyntax_; |
0 | 54 std::string localAet_; |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
55 std::string remoteAet_; |
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
56 std::string remoteHost_; |
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
57 uint16_t remotePort_; |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
58 ModalityManufacturer manufacturer_; |
763
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
59 std::set<std::string> storageSOPClasses_; |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
60 std::list<std::string> reservedStorageSOPClasses_; |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
61 std::set<std::string> defaultStorageSOPClasses_; |
0 | 62 |
63 void CheckIsOpen() const; | |
64 | |
662
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
65 void SetupPresentationContexts(const std::string& preferredTransferSyntax); |
0 | 66 |
1366 | 67 void MoveInternal(const std::string& targetAet, |
1371
f528849ee9f7
DICOM Query/Retrieve available from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1368
diff
changeset
|
68 ResourceType level, |
1366 | 69 const DicomMap& fields); |
0 | 70 |
763
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
71 void ResetStorageSOPClasses(); |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
72 |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
73 void CheckStorageSOPClassesInvariant() const; |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
74 |
0 | 75 public: |
76 DicomUserConnection(); | |
77 | |
78 ~DicomUserConnection(); | |
79 | |
1427
d710ea64f0fd
Custom setting of the local AET during C-Store SCU (both in Lua and in the REST API)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1371
diff
changeset
|
80 void SetRemoteModality(const RemoteModalityParameters& parameters); |
772
31cc399c7762
RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
763
diff
changeset
|
81 |
0 | 82 void SetLocalApplicationEntityTitle(const std::string& aet); |
83 | |
84 const std::string& GetLocalApplicationEntityTitle() const | |
85 { | |
86 return localAet_; | |
87 } | |
88 | |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
89 void SetRemoteApplicationEntityTitle(const std::string& aet); |
0 | 90 |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
91 const std::string& GetRemoteApplicationEntityTitle() const |
0 | 92 { |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
93 return remoteAet_; |
0 | 94 } |
95 | |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
96 void SetRemoteHost(const std::string& host); |
0 | 97 |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
98 const std::string& GetRemoteHost() const |
0 | 99 { |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
100 return remoteHost_; |
0 | 101 } |
102 | |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
103 void SetRemotePort(uint16_t port); |
0 | 104 |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
105 uint16_t GetRemotePort() const |
0 | 106 { |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
107 return remotePort_; |
0 | 108 } |
109 | |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
110 void SetRemoteManufacturer(ModalityManufacturer manufacturer); |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
111 |
1285
5730f374e4e6
Access to called AET and remote AET from Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1186
diff
changeset
|
112 ModalityManufacturer GetRemoteManufacturer() const |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
113 { |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
114 return manufacturer_; |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
115 } |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
116 |
662
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
117 void ResetPreferredTransferSyntax(); |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
118 |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
119 void SetPreferredTransferSyntax(const std::string& preferredTransferSyntax); |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
120 |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
121 const std::string& GetPreferredTransferSyntax() const |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
122 { |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
123 return preferredTransferSyntax_; |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
124 } |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
125 |
763
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
126 void AddStorageSOPClass(const char* sop); |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
127 |
0 | 128 void Open(); |
129 | |
130 void Close(); | |
131 | |
132 bool IsOpen() const; | |
133 | |
134 bool Echo(); | |
135 | |
1907
5011a597b6ce
Support of Move Originator Message ID (0000,1031) in C-Store responses driven by C-Move
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
136 void Store(const char* buffer, |
5011a597b6ce
Support of Move Originator Message ID (0000,1031) in C-Store responses driven by C-Move
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
137 size_t size, |
1997
f9f2aa1cc594
"MoveOriginatorID" can be specified for /modalities/.../store
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1907
diff
changeset
|
138 uint16_t moveOriginatorID); |
0 | 139 |
1907
5011a597b6ce
Support of Move Originator Message ID (0000,1031) in C-Store responses driven by C-Move
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
140 void Store(const std::string& buffer, |
1997
f9f2aa1cc594
"MoveOriginatorID" can be specified for /modalities/.../store
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1907
diff
changeset
|
141 uint16_t moveOriginatorID); |
0 | 142 |
1907
5011a597b6ce
Support of Move Originator Message ID (0000,1031) in C-Store responses driven by C-Move
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
143 void StoreFile(const std::string& path, |
1997
f9f2aa1cc594
"MoveOriginatorID" can be specified for /modalities/.../store
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1907
diff
changeset
|
144 uint16_t moveOriginatorID); |
0 | 145 |
1368 | 146 void Find(DicomFindAnswers& result, |
147 ResourceType level, | |
148 const DicomMap& fields); | |
0 | 149 |
1366 | 150 void Move(const std::string& targetAet, |
1998
9b61701c35f2
New URI "/modalities/.../move" to issue C-Move SCU requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1997
diff
changeset
|
151 ResourceType level, |
9b61701c35f2
New URI "/modalities/.../move" to issue C-Move SCU requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1997
diff
changeset
|
152 const DicomMap& findResult); |
9b61701c35f2
New URI "/modalities/.../move" to issue C-Move SCU requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1997
diff
changeset
|
153 |
9b61701c35f2
New URI "/modalities/.../move" to issue C-Move SCU requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1997
diff
changeset
|
154 void Move(const std::string& targetAet, |
1366 | 155 const DicomMap& findResult); |
156 | |
157 void MovePatient(const std::string& targetAet, | |
158 const std::string& patientId); | |
159 | |
160 void MoveStudy(const std::string& targetAet, | |
161 const std::string& studyUid); | |
0 | 162 |
163 void MoveSeries(const std::string& targetAet, | |
164 const std::string& studyUid, | |
165 const std::string& seriesUid); | |
166 | |
167 void MoveInstance(const std::string& targetAet, | |
168 const std::string& studyUid, | |
169 const std::string& seriesUid, | |
170 const std::string& instanceUid); | |
171 | |
1186
b17b6bd59747
timeouts for HTTP and DICOM
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
772
diff
changeset
|
172 void SetTimeout(uint32_t seconds); |
b17b6bd59747
timeouts for HTTP and DICOM
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
772
diff
changeset
|
173 |
b17b6bd59747
timeouts for HTTP and DICOM
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
772
diff
changeset
|
174 void DisableTimeout(); |
1805
f08978b1f45b
c-find scu for modality worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1427
diff
changeset
|
175 |
f08978b1f45b
c-find scu for modality worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1427
diff
changeset
|
176 void FindWorklist(DicomFindAnswers& result, |
f08978b1f45b
c-find scu for modality worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1427
diff
changeset
|
177 ParsedDicomFile& query); |
2069
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1998
diff
changeset
|
178 |
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1998
diff
changeset
|
179 static void SetDefaultTimeout(uint32_t seconds); |
0 | 180 }; |
181 } |