annotate OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp @ 4035:cc6ed76bba27

added contextual privateCreators dico to ParsedDicomFile -> this allows you not to have to define a DefaultPrivateCreator. This was tested only in the scope of C-Find requests but should not have impact on other parts since it is not used out of C-Find right now
author Alain Mazy <alain@mazy.be>
date Wed, 10 Jun 2020 10:28:01 +0200
parents 67f988f42cef
children
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
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
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,
3851
6498739a3c3c refactoring: TimeoutDicomConnectionManager is now only used by Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3850
diff changeset
84 const JobOperationValue& input)
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 if (input.GetType() != JobOperationValue::Type_DicomInstance)
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
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 DicomInstanceToStore toStore;
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 assert(origin_ == RequestOrigin_Lua);
2664
a21b244efb37 serialization of DicomModalityStoreJob, OrthancPeerStoreJob and ResourceModificationJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2656
diff changeset
109 toStore.SetOrigin(DicomInstanceOrigin::FromLua());
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 toStore.SetParsedDicomFile(*modified);
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 // TODO other metadata
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 toStore.AddMetadata(ResourceType_Instance, MetadataType_ModifiedFrom, instance.GetId());
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 std::string modifiedId;
3814
023b2a9f3aa1 new enum: StoreInstanceMode
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3712
diff changeset
116 context_.Store(modifiedId, toStore, StoreInstanceMode_Default);
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 // 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
119 outputs.Append(new DicomInstanceOperationValue(instance.GetServerContext(), modifiedId));
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 catch (OrthancException& e)
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 {
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 LOG(ERROR) << "Lua: Unable to modify instance " << instance.GetId()
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 << ": " << e.What();
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 }
2616
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
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
129 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
130 {
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
131 target = Json::objectValue;
2616
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
132 target["Type"] = "ModifyInstance";
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
133 target["Origin"] = EnumerationToString(origin_);
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
134 modification_->Serialize(target["Modification"]);
2f3007bf0708 event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2608
diff changeset
135 }
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
136
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 ModifyInstanceOperation::ModifyInstanceOperation(ServerContext& context,
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
139 const Json::Value& serialized) :
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
140 context_(context)
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
141 {
2656
a6d3e45eeff5 SerializationToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2655
diff changeset
142 if (SerializationToolbox::ReadString(serialized, "Type") != "ModifyInstance" ||
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
143 !serialized.isMember("Modification"))
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
144 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
145 throw OrthancException(ErrorCode_BadFileFormat);
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
146 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
147
2656
a6d3e45eeff5 SerializationToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2655
diff changeset
148 origin_ = StringToRequestOrigin(SerializationToolbox::ReadString(serialized, "Origin"));
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
149
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
150 modification_.reset(new DicomModification(serialized["Modification"]));
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2654
diff changeset
151 }
2607
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 }
44e268605478 ModifyInstanceOperation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153