annotate OrthancServer/Sources/ServerJobs/DicomMoveScuJob.cpp @ 5858:66fd63b8601e find-refactoring tip

StorageAccessOnFind: cont
author Alain Mazy <am@orthanc.team>
date Mon, 04 Nov 2024 22:34:14 +0100
parents f7adfb22e20e
children
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
5640
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
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
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "DicomMoveScuJob.h"
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
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
26 #include "../../../OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h"
4045
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
27 #include "../../../OrthancFramework/Sources/SerializationToolbox.h"
3095
beeeb6096f27 removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
28 #include "../ServerContext.h"
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
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
30 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
31 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
32 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
33 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
34 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
35 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
36
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 namespace Orthanc
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 class DicomMoveScuJob::Command : public SetOfCommandsJob::ICommand
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 private:
3712
2a170a8f1faf replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
42 DicomMoveScuJob& that_;
2a170a8f1faf replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
43 std::unique_ptr<DicomMap> findAnswer_;
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 public:
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 Command(DicomMoveScuJob& that,
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 const DicomMap& findAnswer) :
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 that_(that),
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 findAnswer_(findAnswer.Clone())
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
3658
2d90dd30858c providing job ID to the IJob::Step() methods
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
53 virtual bool Execute(const std::string& jobId) ORTHANC_OVERRIDE
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 that_.Retrieve(*findAnswer_);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 return true;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
3763
5ff5d5a0fd28 adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3713
diff changeset
59 virtual void Serialize(Json::Value& target) const ORTHANC_OVERRIDE
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 findAnswer_->Serialize(target);
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
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 class DicomMoveScuJob::Unserializer :
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 public SetOfCommandsJob::ICommandUnserializer
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 private:
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 DicomMoveScuJob& that_;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 public:
4205
d962a2996637 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
73 explicit Unserializer(DicomMoveScuJob& that) :
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 that_(that)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
4205
d962a2996637 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
78 virtual ICommand* Unserialize(const Json::Value& source) const ORTHANC_OVERRIDE
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 DicomMap findAnswer;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 findAnswer.Unserialize(source);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 return new Command(that_, findAnswer);
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
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 void DicomMoveScuJob::Retrieve(const DicomMap& findAnswer)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 if (connection_.get() == NULL)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 {
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
91 connection_.reset(new DicomControlUserConnection(parameters_));
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 connection_->Move(targetAet_, findAnswer);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 }
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
96
a215182a0c2f "DicomMoveScu" jobs provide the associated C-FIND answer in their "Query" public field
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
97
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
98 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
99 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
100 {
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
101 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
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 /**
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 * 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
105 * "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
106 * 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
107 **/
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
108 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
109 }
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
110
5025
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
111 // 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
112 // it keeps only the main dicom tags from the C-Find answer
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 void DicomMoveScuJob::AddFindAnswer(const DicomMap& answer)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 {
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
115 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
116 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
117 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
118 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
119 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
120 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
121 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
122 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
123
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 AddCommand(new Command(*this, answer));
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
5025
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
127 // 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
128 // 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
129 void DicomMoveScuJob::AddQuery(const DicomMap& query)
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
130 {
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
131 AddToQuery(query_, query);
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
132 AddCommand(new Command(*this, query));
afa427f65444 Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents: 4892
diff changeset
133 }
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 void DicomMoveScuJob::AddFindAnswer(QueryRetrieveHandler& query,
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 size_t i)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 DicomMap answer;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 query.GetAnswer(answer, i);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 AddFindAnswer(answer);
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
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 void DicomMoveScuJob::SetLocalAet(const std::string& aet)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 if (IsStarted())
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 throw OrthancException(ErrorCode_BadSequenceOfCalls);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 else
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 {
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
152 parameters_.SetLocalApplicationEntityTitle(aet);
2867
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
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 void DicomMoveScuJob::SetTargetAet(const std::string& aet)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 if (IsStarted())
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 throw OrthancException(ErrorCode_BadSequenceOfCalls);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 else
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 targetAet_ = aet;
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
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 void DicomMoveScuJob::SetRemoteModality(const RemoteModalityParameters& remote)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 if (IsStarted())
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 throw OrthancException(ErrorCode_BadSequenceOfCalls);
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 else
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 {
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
178 parameters_.SetRemoteModality(remote);
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
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
183 void DicomMoveScuJob::SetTimeout(uint32_t seconds)
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
184 {
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
185 if (IsStarted())
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
186 {
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
187 throw OrthancException(ErrorCode_BadSequenceOfCalls);
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
188 }
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
189 else
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
190 {
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
191 parameters_.SetTimeout(seconds);
2867
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
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 void DicomMoveScuJob::Stop(JobStopReason reason)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 connection_.reset();
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201
4729
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
202 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
203 {
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
204 if (IsStarted())
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
205 {
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
206 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
207 }
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
208 else
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
209 {
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
210 queryFormat_ = format;
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
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
214
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 void DicomMoveScuJob::GetPublicContent(Json::Value& value)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 SetOfCommandsJob::GetPublicContent(value);
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
218
4729
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
219 value[LOCAL_AET] = parameters_.GetLocalApplicationEntityTitle();
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
220 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
221
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 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
223 query_.ToJson(value[QUERY], queryFormat_);
2867
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
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 DicomMoveScuJob::DicomMoveScuJob(ServerContext& context,
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 const Json::Value& serialized) :
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 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
230 context_(context),
4206
171af1567473 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4205
diff changeset
231 parameters_(DicomAssociationParameters::UnserializeJob(serialized)),
171af1567473 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4205
diff changeset
232 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
233 query_(true),
4729
4e2247df6327 Added "Short" and "Full" options in /modalities/id/find-worklist
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
234 queryFormat_(DicomToJsonFormat_Short)
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 {
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
236 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
237 {
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
238 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
239 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
240 {
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 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
242 {
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 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
244 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
245 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
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
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 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
251 {
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
252 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
253 }
2867
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
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 bool DicomMoveScuJob::Serialize(Json::Value& target)
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 if (!SetOfCommandsJob::Serialize(target))
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 {
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 return false;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 else
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 {
3877
4b4f387c6bb8 making DicomMoveScuJob more consistent with DicomModalityStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3875
diff changeset
265 parameters_.SerializeJob(target);
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 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
267
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 // "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
269 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
270 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
271
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 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
273
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 return true;
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 }
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 }