Mercurial > hg > orthanc
annotate OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.cpp @ 4645:1f90fe0fa13f
todo
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Apr 2021 16:40:36 +0200 |
parents | 8f9090b137f1 |
children | f0038043fb97 7053502fbf97 |
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 |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4310
diff
changeset
|
5 * Copyright (C) 2017-2021 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 | 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 |
4045 | 40 #include "../../../../OrthancFramework/Sources/Logging.h" |
41 #include "../../../../OrthancFramework/Sources/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, |
4310
2ae905070221
renaming pure interface JobOperationValue as IJobOperationValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
84 const IJobOperationValue& input) |
2607
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 { |
4310
2ae905070221
renaming pure interface JobOperationValue as IJobOperationValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
86 if (input.GetType() != IJobOperationValue::Type_DicomInstance) |
2607
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 { |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 throw OrthancException(ErrorCode_BadParameterType); |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 } |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 const DicomInstanceOperationValue& instance = |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 dynamic_cast<const DicomInstanceOperationValue&>(input); |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 LOG(INFO) << "Lua: Modifying instance " << instance.GetId(); |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 |
3712
2a170a8f1faf
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
96 std::unique_ptr<ParsedDicomFile> modified; |
2607
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 { |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 ServerContext::DicomCacheLocker lock(context_, instance.GetId()); |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 modified.reset(lock.GetDicom().Clone(true)); |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 } |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 try |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 { |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 modification_->Apply(*modified); |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 |
4508
8f9090b137f1
Optimization in C-STORE SCP by avoiding an unnecessary DICOM parsing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
107 std::unique_ptr<DicomInstanceToStore> toStore(DicomInstanceToStore::CreateFromParsedDicomFile(*modified)); |
2607
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 assert(origin_ == RequestOrigin_Lua); |
4508
8f9090b137f1
Optimization in C-STORE SCP by avoiding an unnecessary DICOM parsing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
109 toStore->SetOrigin(DicomInstanceOrigin::FromLua()); |
2607
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 // TODO other metadata |
4508
8f9090b137f1
Optimization in C-STORE SCP by avoiding an unnecessary DICOM parsing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
112 toStore->AddMetadata(ResourceType_Instance, MetadataType_ModifiedFrom, instance.GetId()); |
2607
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 std::string modifiedId; |
4508
8f9090b137f1
Optimization in C-STORE SCP by avoiding an unnecessary DICOM parsing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
115 context_.Store(modifiedId, *toStore, StoreInstanceMode_Default); |
2607
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 // 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
|
118 outputs.Append(new DicomInstanceOperationValue(instance.GetServerContext(), modifiedId)); |
2607
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 } |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 catch (OrthancException& e) |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 { |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 LOG(ERROR) << "Lua: Unable to modify instance " << instance.GetId() |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 << ": " << e.What(); |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 } |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 } |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2608
diff
changeset
|
126 |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2608
diff
changeset
|
127 |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2608
diff
changeset
|
128 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
|
129 { |
2655 | 130 target = Json::objectValue; |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2608
diff
changeset
|
131 target["Type"] = "ModifyInstance"; |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2608
diff
changeset
|
132 target["Origin"] = EnumerationToString(origin_); |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2608
diff
changeset
|
133 modification_->Serialize(target["Modification"]); |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2608
diff
changeset
|
134 } |
2655 | 135 |
136 | |
137 ModifyInstanceOperation::ModifyInstanceOperation(ServerContext& context, | |
138 const Json::Value& serialized) : | |
139 context_(context) | |
140 { | |
2656
a6d3e45eeff5
SerializationToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2655
diff
changeset
|
141 if (SerializationToolbox::ReadString(serialized, "Type") != "ModifyInstance" || |
2655 | 142 !serialized.isMember("Modification")) |
143 { | |
144 throw OrthancException(ErrorCode_BadFileFormat); | |
145 } | |
146 | |
2656
a6d3e45eeff5
SerializationToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2655
diff
changeset
|
147 origin_ = StringToRequestOrigin(SerializationToolbox::ReadString(serialized, "Origin")); |
2655 | 148 |
149 modification_.reset(new DicomModification(serialized["Modification"])); | |
150 } | |
2607
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 } |
44e268605478
ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 |