Mercurial > hg > orthanc
annotate OrthancServer/DicomProtocol/DicomUserConnection.h @ 1163:3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 17 Sep 2014 17:23:08 +0200 |
parents | 31cc399c7762 |
children | b17b6bd59747 |
rev | line source |
---|---|
0 | 1 /** |
62 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
689 | 3 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, |
0 | 4 * Belgium |
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 enum FindRootModel | |
50 { | |
51 FindRootModel_Patient, | |
52 FindRootModel_Study, | |
53 FindRootModel_Series, | |
54 FindRootModel_Instance | |
55 }; | |
56 | |
57 struct PImpl; | |
58 boost::shared_ptr<PImpl> pimpl_; | |
59 | |
60 // 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
|
61 std::string preferredTransferSyntax_; |
0 | 62 std::string localAet_; |
63 std::string distantAet_; | |
64 std::string distantHost_; | |
65 uint16_t distantPort_; | |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
66 ModalityManufacturer manufacturer_; |
763
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
67 std::set<std::string> storageSOPClasses_; |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
68 std::list<std::string> reservedStorageSOPClasses_; |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
69 std::set<std::string> defaultStorageSOPClasses_; |
0 | 70 |
71 void CheckIsOpen() const; | |
72 | |
662
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
73 void SetupPresentationContexts(const std::string& preferredTransferSyntax); |
0 | 74 |
75 void Find(DicomFindAnswers& result, | |
76 FindRootModel model, | |
77 const DicomMap& fields); | |
78 | |
79 void Move(const std::string& targetAet, | |
80 const DicomMap& fields); | |
81 | |
763
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
82 void ResetStorageSOPClasses(); |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
83 |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
84 void CheckStorageSOPClassesInvariant() const; |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
85 |
0 | 86 public: |
87 DicomUserConnection(); | |
88 | |
89 ~DicomUserConnection(); | |
90 | |
772
31cc399c7762
RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
763
diff
changeset
|
91 void Connect(const RemoteModalityParameters& parameters); |
31cc399c7762
RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
763
diff
changeset
|
92 |
0 | 93 void SetLocalApplicationEntityTitle(const std::string& aet); |
94 | |
95 const std::string& GetLocalApplicationEntityTitle() const | |
96 { | |
97 return localAet_; | |
98 } | |
99 | |
100 void SetDistantApplicationEntityTitle(const std::string& aet); | |
101 | |
102 const std::string& GetDistantApplicationEntityTitle() const | |
103 { | |
104 return distantAet_; | |
105 } | |
106 | |
107 void SetDistantHost(const std::string& host); | |
108 | |
109 const std::string& GetDistantHost() const | |
110 { | |
111 return distantHost_; | |
112 } | |
113 | |
114 void SetDistantPort(uint16_t port); | |
115 | |
116 uint16_t GetDistantPort() const | |
117 { | |
118 return distantPort_; | |
119 } | |
120 | |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
121 void SetDistantManufacturer(ModalityManufacturer manufacturer); |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
122 |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
123 ModalityManufacturer GetDistantManufacturer() const |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
124 { |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
125 return manufacturer_; |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
126 } |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
127 |
662
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
128 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
|
129 |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
130 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
|
131 |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
132 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
|
133 { |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
134 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
|
135 } |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
136 |
763
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
137 void AddStorageSOPClass(const char* sop); |
b5e6d2823115
dynamic negotiation of storage sop classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
138 |
0 | 139 void Open(); |
140 | |
141 void Close(); | |
142 | |
143 bool IsOpen() const; | |
144 | |
145 bool Echo(); | |
146 | |
147 void Store(const char* buffer, size_t size); | |
148 | |
149 void Store(const std::string& buffer); | |
150 | |
151 void StoreFile(const std::string& path); | |
152 | |
153 void FindPatient(DicomFindAnswers& result, | |
154 const DicomMap& fields); | |
155 | |
156 void FindStudy(DicomFindAnswers& result, | |
157 const DicomMap& fields); | |
158 | |
159 void FindSeries(DicomFindAnswers& result, | |
160 const DicomMap& fields); | |
161 | |
162 void FindInstance(DicomFindAnswers& result, | |
163 const DicomMap& fields); | |
164 | |
165 void MoveSeries(const std::string& targetAet, | |
166 const DicomMap& findResult); | |
167 | |
168 void MoveSeries(const std::string& targetAet, | |
169 const std::string& studyUid, | |
170 const std::string& seriesUid); | |
171 | |
172 void MoveInstance(const std::string& targetAet, | |
173 const DicomMap& findResult); | |
174 | |
175 void MoveInstance(const std::string& targetAet, | |
176 const std::string& studyUid, | |
177 const std::string& seriesUid, | |
178 const std::string& instanceUid); | |
179 | |
180 static void SetConnectionTimeout(uint32_t seconds); | |
181 }; | |
182 } |