Mercurial > hg > orthanc
annotate OrthancServer/Sources/ServerJobs/Operations/DicomInstanceOperationValue.h @ 5589:b51ee994cd6f find-refactoring
renamed FindResponse::Item as FindResponse::Resource
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 03 May 2024 17:26:06 +0200 |
parents | 48b8dae6dc77 |
children | f7adfb22e20e |
rev | line source |
---|---|
2603 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium |
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
2603 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU General Public License as | |
10 * published by the Free Software Foundation, either version 3 of the | |
11 * License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 **/ | |
21 | |
22 | |
23 #pragma once | |
24 | |
4205 | 25 #include "../../../../OrthancFramework/Sources/Compatibility.h" // For ORTHANC_OVERRIDE |
4310
2ae905070221
renaming pure interface JobOperationValue as IJobOperationValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4305
diff
changeset
|
26 #include "../../../../OrthancFramework/Sources/JobsEngine/Operations/IJobOperationValue.h" |
2603 | 27 |
28 namespace Orthanc | |
29 { | |
3095
beeeb6096f27
removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
30 class ServerContext; |
beeeb6096f27
removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
31 |
4310
2ae905070221
renaming pure interface JobOperationValue as IJobOperationValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4305
diff
changeset
|
32 class DicomInstanceOperationValue : public IJobOperationValue |
2603 | 33 { |
34 private: | |
35 ServerContext& context_; | |
36 std::string id_; | |
37 | |
38 public: | |
39 DicomInstanceOperationValue(ServerContext& context, | |
40 const std::string& id) : | |
41 context_(context), | |
42 id_(id) | |
43 { | |
44 } | |
45 | |
4305 | 46 virtual Type GetType() const ORTHANC_OVERRIDE |
4304 | 47 { |
48 return Type_DicomInstance; | |
49 } | |
50 | |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
51 ServerContext& GetServerContext() const |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
52 { |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
53 return context_; |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
54 } |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
55 |
2603 | 56 const std::string& GetId() const |
57 { | |
58 return id_; | |
59 } | |
60 | |
3095
beeeb6096f27
removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
61 void ReadDicom(std::string& dicom) const; |
2603 | 62 |
4310
2ae905070221
renaming pure interface JobOperationValue as IJobOperationValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4305
diff
changeset
|
63 virtual IJobOperationValue* Clone() const ORTHANC_OVERRIDE |
2603 | 64 { |
65 return new DicomInstanceOperationValue(context_, id_); | |
66 } | |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
67 |
4205 | 68 virtual void Serialize(Json::Value& target) const ORTHANC_OVERRIDE |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
69 { |
2655 | 70 target = Json::objectValue; |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
71 target["Type"] = "DicomInstance"; |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
72 target["ID"] = id_; |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2603
diff
changeset
|
73 } |
2603 | 74 }; |
75 } |