annotate OrthancServer/ServerJobs/DicomModalityStoreJob.cpp @ 3944:aae045f802f4 transcoding

preparing simplified interface for IDicomTranscoder
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 May 2020 10:17:06 +0200
parents 8f7ad4989fec
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
3640
94f4a18a79cc upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * your version of the file(s), but you are not obligated to do so. If
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 **/
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include "../PrecompiledHeadersServer.h"
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "DicomModalityStoreJob.h"
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
3712
2a170a8f1faf replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
37 #include "../../Core/Compatibility.h"
3862
594263db316a DicomModalityStoreJob now uses DicomStoreUserConnection
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3843
diff changeset
38 #include "../../Core/DicomNetworking/DicomAssociation.h"
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 #include "../../Core/Logging.h"
2664
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
40 #include "../../Core/SerializationToolbox.h"
3095
beeeb6096f27 removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
41 #include "../ServerContext.h"
3737
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3735
diff changeset
42 #include "../StorageCommitmentReports.h"
3095
beeeb6096f27 removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
43
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 namespace Orthanc
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 void DicomModalityStoreJob::OpenConnection()
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 if (connection_.get() == NULL)
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
51 connection_.reset(new DicomStoreUserConnection(parameters_));
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 bool DicomModalityStoreJob::HandleInstance(const std::string& instance)
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 {
2640
c691fcf66071 ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2624
diff changeset
58 assert(IsStarted());
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 OpenConnection();
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 LOG(INFO) << "Sending instance " << instance << " to modality \""
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
62 << parameters_.GetRemoteModality().GetApplicationEntityTitle() << "\"";
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 std::string dicom;
2624
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
65
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
66 try
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
67 {
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
68 context_.ReadDicom(dicom, instance);
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
69 }
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
70 catch (OrthancException& e)
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
71 {
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
72 LOG(WARNING) << "An instance was removed after the job was issued: " << instance;
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
73 return false;
714dcddeb65f asynchronous c-movoe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2603
diff changeset
74 }
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
75
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
76 std::string sopClassUid, sopInstanceUid;
3894
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
77 context_.StoreWithTranscoding(sopClassUid, sopInstanceUid, *connection_, dicom,
8f7ad4989fec transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
78 HasMoveOriginator(), moveOriginatorAet_, moveOriginatorId_);
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
79
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
80 if (storageCommitment_)
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
81 {
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
82 sopClassUids_.push_back(sopClassUid);
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
83 sopInstanceUids_.push_back(sopInstanceUid);
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
84
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
85 if (sopClassUids_.size() != sopInstanceUids_.size() ||
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
86 sopClassUids_.size() > GetInstancesCount())
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
87 {
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
88 throw OrthancException(ErrorCode_InternalError);
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
89 }
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
90
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
91 if (sopClassUids_.size() == GetInstancesCount())
3737
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3735
diff changeset
92 {
3862
594263db316a DicomModalityStoreJob now uses DicomStoreUserConnection
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3843
diff changeset
93 assert(IsStarted());
594263db316a DicomModalityStoreJob now uses DicomStoreUserConnection
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3843
diff changeset
94 connection_.reset(NULL);
594263db316a DicomModalityStoreJob now uses DicomStoreUserConnection
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3843
diff changeset
95
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
96 const std::string& remoteAet = parameters_.GetRemoteModality().GetApplicationEntityTitle();
3737
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3735
diff changeset
97
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3735
diff changeset
98 LOG(INFO) << "Sending storage commitment request to modality: " << remoteAet;
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3735
diff changeset
99
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3735
diff changeset
100 // Create a "pending" storage commitment report BEFORE the
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3735
diff changeset
101 // actual SCU call in order to avoid race conditions
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3735
diff changeset
102 context_.GetStorageCommitmentReports().Store(
f29843323daf accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3735
diff changeset
103 transactionUid_, new StorageCommitmentReports::Report(remoteAet));
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
104
3735
77183afbf55e simplification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3734
diff changeset
105 std::vector<std::string> a(sopClassUids_.begin(), sopClassUids_.end());
77183afbf55e simplification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3734
diff changeset
106 std::vector<std::string> b(sopInstanceUids_.begin(), sopInstanceUids_.end());
3862
594263db316a DicomModalityStoreJob now uses DicomStoreUserConnection
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3843
diff changeset
107
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
108 DicomAssociation::RequestStorageCommitment(parameters_, transactionUid_, a, b);
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
109 }
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 //boost::this_thread::sleep(boost::posix_time::milliseconds(500));
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 return true;
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117
2842
ff0ed5ea9e4e trailing step in SetOfInstancesJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2812
diff changeset
118 bool DicomModalityStoreJob::HandleTrailingStep()
ff0ed5ea9e4e trailing step in SetOfInstancesJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2812
diff changeset
119 {
ff0ed5ea9e4e trailing step in SetOfInstancesJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2812
diff changeset
120 throw OrthancException(ErrorCode_InternalError);
ff0ed5ea9e4e trailing step in SetOfInstancesJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2812
diff changeset
121 }
ff0ed5ea9e4e trailing step in SetOfInstancesJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2812
diff changeset
122
ff0ed5ea9e4e trailing step in SetOfInstancesJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2812
diff changeset
123
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 DicomModalityStoreJob::DicomModalityStoreJob(ServerContext& context) :
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 context_(context),
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
126 moveOriginatorId_(0), // By default, not a C-MOVE
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
127 storageCommitment_(false) // By default, no storage commitment
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 {
3735
77183afbf55e simplification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3734
diff changeset
129 ResetStorageCommitment();
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 void DicomModalityStoreJob::SetLocalAet(const std::string& aet)
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 if (IsStarted())
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 throw OrthancException(ErrorCode_BadSequenceOfCalls);
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 else
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 {
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
141 parameters_.SetLocalApplicationEntityTitle(aet);
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 void DicomModalityStoreJob::SetRemoteModality(const RemoteModalityParameters& remote)
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 if (IsStarted())
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 throw OrthancException(ErrorCode_BadSequenceOfCalls);
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 else
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 {
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
154 parameters_.SetRemoteModality(remote);
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
159 void DicomModalityStoreJob::SetTimeout(uint32_t seconds)
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
160 {
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
161 if (IsStarted())
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
162 {
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
163 throw OrthancException(ErrorCode_BadSequenceOfCalls);
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
164 }
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
165 else
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
166 {
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
167 parameters_.SetTimeout(seconds);
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
168 }
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
169 }
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
170
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
171
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 const std::string& DicomModalityStoreJob::GetMoveOriginatorAet() const
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 if (HasMoveOriginator())
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 return moveOriginatorAet_;
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 else
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 throw OrthancException(ErrorCode_BadSequenceOfCalls);
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 uint16_t DicomModalityStoreJob::GetMoveOriginatorId() const
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 if (HasMoveOriginator())
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 return moveOriginatorId_;
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 else
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 throw OrthancException(ErrorCode_BadSequenceOfCalls);
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 void DicomModalityStoreJob::SetMoveOriginator(const std::string& aet,
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 int id)
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 if (IsStarted())
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 throw OrthancException(ErrorCode_BadSequenceOfCalls);
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 else if (id < 0 ||
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 id >= 65536)
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 throw OrthancException(ErrorCode_ParameterOutOfRange);
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 else
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 moveOriginatorId_ = static_cast<uint16_t>(id);
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 moveOriginatorAet_ = aet;
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216
2812
ea7aea6f6a95 improved naming of methods in IJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2811
diff changeset
217 void DicomModalityStoreJob::Stop(JobStopReason reason) // For pausing jobs
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 connection_.reset(NULL);
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 }
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
223 void DicomModalityStoreJob::ResetStorageCommitment()
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
224 {
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
225 if (storageCommitment_)
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
226 {
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
227 transactionUid_ = Toolbox::GenerateDicomPrivateUniqueIdentifier();
3735
77183afbf55e simplification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3734
diff changeset
228 sopClassUids_.clear();
77183afbf55e simplification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3734
diff changeset
229 sopInstanceUids_.clear();
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
230 }
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
231 }
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
232
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
233
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
234 void DicomModalityStoreJob::Reset()
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
235 {
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
236 SetOfInstancesJob::Reset();
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
237
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
238 /**
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
239 * "After the N-EVENT-REPORT has been sent, the Transaction UID is
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
240 * no longer active and shall not be reused for other
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
241 * transactions." => Need to reset the transaction UID here
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
242 * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part04/sect_J.3.3.html
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
243 **/
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
244 ResetStorageCommitment();
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
245 }
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
246
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
247
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
248 void DicomModalityStoreJob::EnableStorageCommitment(bool enabled)
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
249 {
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
250 storageCommitment_ = enabled;
3735
77183afbf55e simplification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3734
diff changeset
251 ResetStorageCommitment();
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
252 }
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
253
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
254
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 void DicomModalityStoreJob::GetPublicContent(Json::Value& value)
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 {
2640
c691fcf66071 ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2624
diff changeset
257 SetOfInstancesJob::GetPublicContent(value);
c691fcf66071 ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2624
diff changeset
258
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
259 value["LocalAet"] = parameters_.GetLocalApplicationEntityTitle();
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
260 value["RemoteAet"] = parameters_.GetRemoteModality().GetApplicationEntityTitle();
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 if (HasMoveOriginator())
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 {
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 value["MoveOriginatorAET"] = GetMoveOriginatorAet();
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 value["MoveOriginatorID"] = GetMoveOriginatorId();
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 }
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
267
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
268 if (storageCommitment_)
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
269 {
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
270 value["StorageCommitmentTransactionUID"] = transactionUid_;
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
271 }
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 }
2664
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
273
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
274
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
275 static const char* MOVE_ORIGINATOR_AET = "MoveOriginatorAet";
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
276 static const char* MOVE_ORIGINATOR_ID = "MoveOriginatorId";
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
277 static const char* STORAGE_COMMITMENT = "StorageCommitment";
2664
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
278
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
279
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
280 DicomModalityStoreJob::DicomModalityStoreJob(ServerContext& context,
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
281 const Json::Value& serialized) :
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
282 SetOfInstancesJob(serialized),
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
283 context_(context)
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
284 {
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
285 moveOriginatorAet_ = SerializationToolbox::ReadString(serialized, MOVE_ORIGINATOR_AET);
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
286 moveOriginatorId_ = static_cast<uint16_t>
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
287 (SerializationToolbox::ReadUnsignedInteger(serialized, MOVE_ORIGINATOR_ID));
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
288 EnableStorageCommitment(SerializationToolbox::ReadBoolean(serialized, STORAGE_COMMITMENT));
3870
09798f2b985f added a Timeout argument to every DICOM command + 'TargetAet' not mandatory anymore in /retrieve
Alain Mazy <alain@mazy.be>
parents: 3862
diff changeset
289
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
290 parameters_ = DicomAssociationParameters::UnserializeJob(serialized);
2664
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
291 }
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
292
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
293
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
294 bool DicomModalityStoreJob::Serialize(Json::Value& target)
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
295 {
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
296 if (!SetOfInstancesJob::Serialize(target))
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
297 {
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
298 return false;
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
299 }
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
300 else
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
301 {
3875
ea1d32861cfc moving timeout from DicomAssocation to DicomAssociationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3874
diff changeset
302 parameters_.SerializeJob(target);
2664
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
303 target[MOVE_ORIGINATOR_AET] = moveOriginatorAet_;
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
304 target[MOVE_ORIGINATOR_ID] = moveOriginatorId_;
3734
4fc24b69446a triggering storage commitment scu from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
305 target[STORAGE_COMMITMENT] = storageCommitment_;
2664
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
306 return true;
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
307 }
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
308 }
2603
988936118354 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 }