annotate OrthancFramework/Sources/DicomNetworking/RemoteModalityParameters.h @ 4119:bf7b9edf6b81 framework-lgpl

re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2020 19:17:56 +0200
parents e00f3d089991
children fbc49a65340a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1654
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 812
diff changeset
4 * Department, University Hospital of Liege, Belgium
3640
94f4a18a79cc upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
8 * modify it under the terms of the GNU Lesser General Public License
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
10 * the License, or (at your option) any later version.
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
15 * Lesser General Public License for more details.
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
18 * License along with this program. If not, see
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
19 * <http://www.gnu.org/licenses/>.
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #pragma once
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
25 #include "../Enumerations.h"
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
1654
3727a09e7b53 fix some icc warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1427
diff changeset
27 #include <stdint.h>
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #include <string>
807
566a2fb3c1fb update/delete modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 806
diff changeset
29 #include <json/json.h>
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 namespace Orthanc
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
33 class ORTHANC_PUBLIC RemoteModalityParameters
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 private:
2872
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
36 std::string aet_;
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
37 std::string host_;
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
38 uint16_t port_;
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
39 ModalityManufacturer manufacturer_;
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
40 bool allowEcho_;
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
41 bool allowStore_;
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
42 bool allowFind_;
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
43 bool allowMove_;
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
44 bool allowGet_;
3602
085283445db0 AllowNAction in remote modality parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
45 bool allowNAction_;
3613
c1e2b91c2ab4 all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3602
diff changeset
46 bool allowNEventReport_;
3894
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
47 bool allowTranscoding_;
3613
c1e2b91c2ab4 all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3602
diff changeset
48
2872
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
49 void Clear();
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
2871
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
51 void UnserializeArray(const Json::Value& serialized);
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
52
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
53 void UnserializeObject(const Json::Value& serialized);
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
54
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 public:
2872
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
56 RemoteModalityParameters()
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
57 {
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
58 Clear();
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
59 }
806
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
60
2871
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
61 RemoteModalityParameters(const Json::Value& serialized)
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
62 {
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
63 Unserialize(serialized);
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
64 }
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
65
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: 1288
diff changeset
66 RemoteModalityParameters(const std::string& aet,
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: 1288
diff changeset
67 const std::string& host,
1654
3727a09e7b53 fix some icc warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1427
diff changeset
68 uint16_t port,
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: 1288
diff changeset
69 ModalityManufacturer manufacturer);
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: 1288
diff changeset
70
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 const std::string& GetApplicationEntityTitle() const
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 {
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 return aet_;
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 }
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
806
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
76 void SetApplicationEntityTitle(const std::string& aet)
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
77 {
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
78 aet_ = aet;
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
79 }
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
80
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 const std::string& GetHost() const
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 {
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 return host_;
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 }
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
806
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
86 void SetHost(const std::string& host)
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
87 {
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
88 host_ = host;
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
89 }
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
90
2715
73bc0c32547c fix embedding openssl within a DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2655
diff changeset
91 uint16_t GetPortNumber() const
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 {
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 return port_;
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 }
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
2872
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
96 void SetPortNumber(uint16_t port);
806
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
97
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 ModalityManufacturer GetManufacturer() const
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 {
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 return manufacturer_;
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 }
806
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
102
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
103 void SetManufacturer(ModalityManufacturer manufacturer)
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
104 {
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
105 manufacturer_ = manufacturer;
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
106 }
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
107
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
108 void SetManufacturer(const std::string& manufacturer)
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
109 {
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
110 manufacturer_ = StringToModalityManufacturer(manufacturer);
557575fd93e9 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 772
diff changeset
111 }
807
566a2fb3c1fb update/delete modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 806
diff changeset
112
2872
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
113 bool IsRequestAllowed(DicomRequestType type) const;
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
114
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
115 void SetRequestAllowed(DicomRequestType type,
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
116 bool allowed);
9d08edde614b Possibility to restrict the allowed DICOM commands for each modality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
117
2871
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
118 void Unserialize(const Json::Value& modality);
807
566a2fb3c1fb update/delete modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 806
diff changeset
119
2871
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
120 bool IsAdvancedFormatNeeded() const;
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
121
2871
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
122 void Serialize(Json::Value& target,
6eebc2eb3168 refactoring serialization of RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2715
diff changeset
123 bool forceAdvancedFormat) const;
3894
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
124
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
125 bool IsTranscodingAllowed() const
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
126 {
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
127 return allowTranscoding_;
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
128 }
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
129
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
130 void SetTranscodingAllowed(bool allowed)
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
131 {
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
132 allowTranscoding_ = allowed;
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3641
diff changeset
133 }
772
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 };
31cc399c7762 RemoteModalityParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 }