annotate OrthancServer/Sources/ServerJobs/DicomMoveScuJob.cpp @ 5150:6ff13c95f62f

ThreadedSetOfInstancesJob: reduce cpu consumption of job main thread
author Alain Mazy <am@osimis.io>
date Mon, 30 Jan 2023 11:31:12 +0100
parents afa427f65444
children 0ea402b4d901
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
4870
43e613a7756b upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4831
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
43e613a7756b upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4831
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * modify it under the terms of the GNU General Public License as
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * published by the Free Software Foundation, either version 3 of the
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * License, or (at your option) any later version.
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * General Public License for more details.
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include "DicomMoveScuJob.h"
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
25 #include "../../../OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h"
4045
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
26 #include "../../../OrthancFramework/Sources/SerializationToolbox.h"
3095
beeeb6096f27 removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
27 #include "../ServerContext.h"
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
29 static const char* const LOCAL_AET = "LocalAet";
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
30 static const char* const QUERY = "Query";
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
31 static const char* const QUERY_FORMAT = "QueryFormat"; // New in 1.9.5
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
32 static const char* const REMOTE = "Remote";
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
33 static const char* const TARGET_AET = "TargetAet";
3870
09798f2b985f added a Timeout argument to every DICOM command + 'TargetAet' not mandatory anymore in /retrieve
Alain Mazy <alain@mazy.be>
parents: 3843
diff changeset
34 static const char* const TIMEOUT = "Timeout";
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
35
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 namespace Orthanc
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 class DicomMoveScuJob::Command : public SetOfCommandsJob::ICommand
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 private:
3712
2a170a8f1faf replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
41 DicomMoveScuJob& that_;
2a170a8f1faf replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
42 std::unique_ptr<DicomMap> findAnswer_;
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 public:
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 Command(DicomMoveScuJob& that,
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 const DicomMap& findAnswer) :
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 that_(that),
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 findAnswer_(findAnswer.Clone())
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
3658
2d90dd30858c providing job ID to the IJob::Step() methods
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
52 virtual bool Execute(const std::string& jobId) ORTHANC_OVERRIDE
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 that_.Retrieve(*findAnswer_);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 return true;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
3763
5ff5d5a0fd28 adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3713
diff changeset
58 virtual void Serialize(Json::Value& target) const ORTHANC_OVERRIDE
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 findAnswer_->Serialize(target);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 };
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 class DicomMoveScuJob::Unserializer :
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 public SetOfCommandsJob::ICommandUnserializer
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 private:
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 DicomMoveScuJob& that_;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 public:
4205
d962a2996637 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
72 explicit Unserializer(DicomMoveScuJob& that) :
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 that_(that)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
4205
d962a2996637 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
77 virtual ICommand* Unserialize(const Json::Value& source) const ORTHANC_OVERRIDE
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 DicomMap findAnswer;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 findAnswer.Unserialize(source);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 return new Command(that_, findAnswer);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 };
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 void DicomMoveScuJob::Retrieve(const DicomMap& findAnswer)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 if (connection_.get() == NULL)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 {
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
90 connection_.reset(new DicomControlUserConnection(parameters_));
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 connection_->Move(targetAet_, findAnswer);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 }
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
95
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
96
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
97 static void AddToQuery(DicomFindAnswers& query,
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
98 const DicomMap& item)
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
99 {
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
100 query.Add(item);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
101
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
102 /**
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
103 * Compatibility with Orthanc <= 1.9.4: Remove the
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
104 * "SpecificCharacterSet" (0008,0005) tag that is automatically
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
105 * added if creating a ParsedDicomFile object from a DicomMap.
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
106 **/
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
107 query.GetAnswer(query.GetSize() - 1).Remove(DICOM_TAG_SPECIFIC_CHARACTER_SET);
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
108 }
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
109
5025
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
110 // this method is used to implement the retrieve part of a Q&R
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
111 // it keeps only the main dicom tags from the C-Find answer
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 void DicomMoveScuJob::AddFindAnswer(const DicomMap& answer)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 {
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
114 DicomMap item;
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
115 item.CopyTagIfExists(answer, DICOM_TAG_QUERY_RETRIEVE_LEVEL);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
116 item.CopyTagIfExists(answer, DICOM_TAG_PATIENT_ID);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
117 item.CopyTagIfExists(answer, DICOM_TAG_STUDY_INSTANCE_UID);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
118 item.CopyTagIfExists(answer, DICOM_TAG_SERIES_INSTANCE_UID);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
119 item.CopyTagIfExists(answer, DICOM_TAG_SOP_INSTANCE_UID);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
120 item.CopyTagIfExists(answer, DICOM_TAG_ACCESSION_NUMBER);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
121 AddToQuery(query_, item);
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
122
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 AddCommand(new Command(*this, answer));
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
5025
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
126 // this method is used to implement a C-Move
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
127 // it keeps all tags from the C-Move query
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
128 void DicomMoveScuJob::AddQuery(const DicomMap& query)
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
129 {
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
130 AddToQuery(query_, query);
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
131 AddCommand(new Command(*this, query));
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
132 }
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 void DicomMoveScuJob::AddFindAnswer(QueryRetrieveHandler& query,
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 size_t i)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 DicomMap answer;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 query.GetAnswer(answer, i);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 AddFindAnswer(answer);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 void DicomMoveScuJob::SetLocalAet(const std::string& aet)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 if (IsStarted())
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 throw OrthancException(ErrorCode_BadSequenceOfCalls);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 else
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 {
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
151 parameters_.SetLocalApplicationEntityTitle(aet);
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 void DicomMoveScuJob::SetTargetAet(const std::string& aet)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 if (IsStarted())
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 throw OrthancException(ErrorCode_BadSequenceOfCalls);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 else
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 targetAet_ = aet;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 void DicomMoveScuJob::SetRemoteModality(const RemoteModalityParameters& remote)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 if (IsStarted())
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 throw OrthancException(ErrorCode_BadSequenceOfCalls);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 else
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 {
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
177 parameters_.SetRemoteModality(remote);
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
178 }
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
179 }
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
180
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
181
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
182 void DicomMoveScuJob::SetTimeout(uint32_t seconds)
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
183 {
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
184 if (IsStarted())
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
185 {
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
186 throw OrthancException(ErrorCode_BadSequenceOfCalls);
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
187 }
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
188 else
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
189 {
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
190 parameters_.SetTimeout(seconds);
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 void DicomMoveScuJob::Stop(JobStopReason reason)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 connection_.reset();
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200
4729
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
201 void DicomMoveScuJob::SetQueryFormat(DicomToJsonFormat format)
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
202 {
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
203 if (IsStarted())
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
204 {
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
205 throw OrthancException(ErrorCode_BadSequenceOfCalls);
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
206 }
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
207 else
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
208 {
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
209 queryFormat_ = format;
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
210 }
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
211 }
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
212
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
213
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 void DicomMoveScuJob::GetPublicContent(Json::Value& value)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 SetOfCommandsJob::GetPublicContent(value);
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
217
4729
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
218 value[LOCAL_AET] = parameters_.GetLocalApplicationEntityTitle();
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
219 value["RemoteAet"] = parameters_.GetRemoteModality().GetApplicationEntityTitle();
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
220
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
221 value[QUERY] = Json::objectValue;
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
222 query_.ToJson(value[QUERY], queryFormat_);
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 DicomMoveScuJob::DicomMoveScuJob(ServerContext& context,
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 const Json::Value& serialized) :
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 SetOfCommandsJob(new Unserializer(*this), serialized),
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
229 context_(context),
4206
171af1567473 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4205
diff changeset
230 parameters_(DicomAssociationParameters::UnserializeJob(serialized)),
171af1567473 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4205
diff changeset
231 targetAet_(SerializationToolbox::ReadString(serialized, TARGET_AET)),
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
232 query_(true),
4729
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
233 queryFormat_(DicomToJsonFormat_Short)
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 {
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
235 if (serialized.isMember(QUERY))
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
236 {
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
237 const Json::Value& query = serialized[QUERY];
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
238 if (query.type() == Json::arrayValue)
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
239 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
240 for (Json::Value::ArrayIndex i = 0; i < query.size(); i++)
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
241 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
242 DicomMap item;
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
243 FromDcmtkBridge::FromJson(item, query[i]);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
244 AddToQuery(query_, item);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
245 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
246 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
247 }
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
248
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
249 if (serialized.isMember(QUERY_FORMAT))
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
250 {
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
251 queryFormat_ = StringToDicomToJsonFormat(SerializationToolbox::ReadString(serialized, QUERY_FORMAT));
3303
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
252 }
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 bool DicomMoveScuJob::Serialize(Json::Value& target)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 if (!SetOfCommandsJob::Serialize(target))
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 return false;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 else
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 {
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
264 parameters_.SerializeJob(target);
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 target[TARGET_AET] = targetAet_;
4730
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
266
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
267 // "Short" is for compatibility with Orthanc <= 1.9.4
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
268 target[QUERY] = Json::objectValue;
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
269 query_.ToJson(target[QUERY], DicomToJsonFormat_Short);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
270
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
271 target[QUERY_FORMAT] = EnumerationToString(queryFormat_);
7826ac059c31 Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4729
diff changeset
272
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 return true;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 }