annotate OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp @ 3366:7a4d586caf2d

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 13 May 2019 16:04:45 +0200
parents beeeb6096f27
children 94f4a18a79cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
3060
4e43e67f8ecf preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2664
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
44e268605478 ModifyInstanceOperation
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
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 **/
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
2641
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
34 #include "../../PrecompiledHeadersServer.h"
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "ModifyInstanceOperation.h"
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #include "DicomInstanceOperationValue.h"
3095
beeeb6096f27 removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
38 #include "../../ServerContext.h"
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
2641
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2640
diff changeset
40 #include "../../../Core/Logging.h"
2656
a6d3e45eeff5 SerializationToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2655
diff changeset
41 #include "../../../Core/SerializationToolbox.h"
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 namespace Orthanc
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 ModifyInstanceOperation::ModifyInstanceOperation(ServerContext& context,
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 RequestOrigin origin,
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 DicomModification* modification) :
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 context_(context),
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 origin_(origin),
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 modification_(modification)
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 if (modification == NULL)
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 throw OrthancException(ErrorCode_NullPointer);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 modification_->SetAllowManualIdentifiers(true);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 if (modification_->IsReplaced(DICOM_TAG_PATIENT_ID))
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 modification_->SetLevel(ResourceType_Patient);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 else if (modification_->IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID))
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 modification_->SetLevel(ResourceType_Study);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 else if (modification_->IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID))
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 modification_->SetLevel(ResourceType_Series);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 else
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 modification_->SetLevel(ResourceType_Instance);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 if (origin_ != RequestOrigin_Lua)
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 // TODO If issued from HTTP, "remoteIp" and "username" must be provided
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 throw OrthancException(ErrorCode_NotImplemented);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 void ModifyInstanceOperation::Apply(JobOperationValues& outputs,
2608
25225f0b4f33 simplification wrt. dicom connection manager
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2607
diff changeset
84 const JobOperationValue& input,
25225f0b4f33 simplification wrt. dicom connection manager
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2607
diff changeset
85 IDicomConnectionManager& connectionManager)
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 if (input.GetType() != JobOperationValue::Type_DicomInstance)
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 throw OrthancException(ErrorCode_BadParameterType);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 const DicomInstanceOperationValue& instance =
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 dynamic_cast<const DicomInstanceOperationValue&>(input);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 LOG(INFO) << "Lua: Modifying instance " << instance.GetId();
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 std::auto_ptr<ParsedDicomFile> modified;
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 ServerContext::DicomCacheLocker lock(context_, instance.GetId());
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 modified.reset(lock.GetDicom().Clone(true));
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 try
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 modification_->Apply(*modified);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 DicomInstanceToStore toStore;
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 assert(origin_ == RequestOrigin_Lua);
2664
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2656
diff changeset
110 toStore.SetOrigin(DicomInstanceOrigin::FromLua());
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 toStore.SetParsedDicomFile(*modified);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 // TODO other metadata
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 toStore.AddMetadata(ResourceType_Instance, MetadataType_ModifiedFrom, instance.GetId());
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 std::string modifiedId;
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 context_.Store(modifiedId, toStore);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 // Only chain with other commands if this command succeeds
2616
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
120 outputs.Append(new DicomInstanceOperationValue(instance.GetServerContext(), modifiedId));
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 catch (OrthancException& e)
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 LOG(ERROR) << "Lua: Unable to modify instance " << instance.GetId()
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 << ": " << e.What();
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 }
2616
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
128
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
129
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
130 void ModifyInstanceOperation::Serialize(Json::Value& target) const
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
131 {
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
132 target = Json::objectValue;
2616
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
133 target["Type"] = "ModifyInstance";
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
134 target["Origin"] = EnumerationToString(origin_);
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
135 modification_->Serialize(target["Modification"]);
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
136 }
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
137
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
138
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
139 ModifyInstanceOperation::ModifyInstanceOperation(ServerContext& context,
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
140 const Json::Value& serialized) :
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
141 context_(context)
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
142 {
2656
a6d3e45eeff5 SerializationToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2655
diff changeset
143 if (SerializationToolbox::ReadString(serialized, "Type") != "ModifyInstance" ||
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
144 !serialized.isMember("Modification"))
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
145 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
146 throw OrthancException(ErrorCode_BadFileFormat);
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
147 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
148
2656
a6d3e45eeff5 SerializationToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2655
diff changeset
149 origin_ = StringToRequestOrigin(SerializationToolbox::ReadString(serialized, "Origin"));
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
150
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
151 modification_.reset(new DicomModification(serialized["Modification"]));
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
152 }
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154