Mercurial > hg > orthanc
annotate OrthancServer/DicomProtocol/DicomUserConnection.h @ 2750:4c271054e044 Orthanc-0.7.3
close old branch
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 17 Jul 2018 09:39:43 +0200 |
parents | 2d0a347e8cfc |
children | b5e6d2823115 |
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" |
0 | 37 |
38 #include <stdint.h> | |
39 #include <boost/shared_ptr.hpp> | |
40 #include <boost/noncopyable.hpp> | |
41 | |
62 | 42 namespace Orthanc |
0 | 43 { |
44 class DicomUserConnection : public boost::noncopyable | |
45 { | |
46 private: | |
47 enum FindRootModel | |
48 { | |
49 FindRootModel_Patient, | |
50 FindRootModel_Study, | |
51 FindRootModel_Series, | |
52 FindRootModel_Instance | |
53 }; | |
54 | |
55 struct PImpl; | |
56 boost::shared_ptr<PImpl> pimpl_; | |
57 | |
58 // 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
|
59 std::string preferredTransferSyntax_; |
0 | 60 std::string localAet_; |
61 std::string distantAet_; | |
62 std::string distantHost_; | |
63 uint16_t distantPort_; | |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
64 ModalityManufacturer manufacturer_; |
0 | 65 |
66 void CheckIsOpen() const; | |
67 | |
662
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
68 void SetupPresentationContexts(const std::string& preferredTransferSyntax); |
0 | 69 |
70 void Find(DicomFindAnswers& result, | |
71 FindRootModel model, | |
72 const DicomMap& fields); | |
73 | |
74 void Move(const std::string& targetAet, | |
75 const DicomMap& fields); | |
76 | |
77 public: | |
78 DicomUserConnection(); | |
79 | |
80 ~DicomUserConnection(); | |
81 | |
82 void CopyParameters(const DicomUserConnection& other); | |
83 | |
84 void SetLocalApplicationEntityTitle(const std::string& aet); | |
85 | |
86 const std::string& GetLocalApplicationEntityTitle() const | |
87 { | |
88 return localAet_; | |
89 } | |
90 | |
91 void SetDistantApplicationEntityTitle(const std::string& aet); | |
92 | |
93 const std::string& GetDistantApplicationEntityTitle() const | |
94 { | |
95 return distantAet_; | |
96 } | |
97 | |
98 void SetDistantHost(const std::string& host); | |
99 | |
100 const std::string& GetDistantHost() const | |
101 { | |
102 return distantHost_; | |
103 } | |
104 | |
105 void SetDistantPort(uint16_t port); | |
106 | |
107 uint16_t GetDistantPort() const | |
108 { | |
109 return distantPort_; | |
110 } | |
111 | |
519
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
112 void SetDistantManufacturer(ModalityManufacturer manufacturer); |
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 ModalityManufacturer GetDistantManufacturer() const |
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 return manufacturer_; |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
117 } |
1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
399
diff
changeset
|
118 |
662
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 ResetPreferredTransferSyntax(); |
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 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
|
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 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
|
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 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
|
126 } |
70161eb45b5c
orthanc can act as a C-Store SCU for JPEG transfer syntax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
519
diff
changeset
|
127 |
0 | 128 void Open(); |
129 | |
130 void Close(); | |
131 | |
132 bool IsOpen() const; | |
133 | |
134 bool Echo(); | |
135 | |
136 void Store(const char* buffer, size_t size); | |
137 | |
138 void Store(const std::string& buffer); | |
139 | |
140 void StoreFile(const std::string& path); | |
141 | |
142 void FindPatient(DicomFindAnswers& result, | |
143 const DicomMap& fields); | |
144 | |
145 void FindStudy(DicomFindAnswers& result, | |
146 const DicomMap& fields); | |
147 | |
148 void FindSeries(DicomFindAnswers& result, | |
149 const DicomMap& fields); | |
150 | |
151 void FindInstance(DicomFindAnswers& result, | |
152 const DicomMap& fields); | |
153 | |
154 void MoveSeries(const std::string& targetAet, | |
155 const DicomMap& findResult); | |
156 | |
157 void MoveSeries(const std::string& targetAet, | |
158 const std::string& studyUid, | |
159 const std::string& seriesUid); | |
160 | |
161 void MoveInstance(const std::string& targetAet, | |
162 const DicomMap& findResult); | |
163 | |
164 void MoveInstance(const std::string& targetAet, | |
165 const std::string& studyUid, | |
166 const std::string& seriesUid, | |
167 const std::string& instanceUid); | |
168 | |
169 static void SetConnectionTimeout(uint32_t seconds); | |
170 }; | |
171 } |