annotate OrthancServer/OrthancFindRequestHandler.cpp @ 681:3bdb5db8e839 query-retrieve

generalization of query/retrieve
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 24 Jan 2014 17:40:45 +0100
parents 41b3e5ccb291
children 67e6400fca03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2013 Medical Physics Department, CHU of Liege,
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Belgium
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * This program is free software: you can redistribute it and/or
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU General Public License as
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * published by the Free Software Foundation, either version 3 of the
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * License, or (at your option) any later version.
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * In addition, as a special exception, the copyright holders of this
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * program give permission to link the code of its release with the
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * that use the same license as the "OpenSSL" library), and distribute
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * the linked executables. You must obey the GNU General Public License
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * in all respects for all of the code used other than "OpenSSL". If you
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * modify file(s) with this exception, you may extend this exception to
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * your version of the file(s), but you are not obligated to do so. If
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * you do not wish to do so, delete this exception statement from your
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * version. If you delete this exception statement from all source files
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * in the program, then also delete it here.
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 *
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * This program is distributed in the hope that it will be useful, but
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * WITHOUT ANY WARRANTY; without even the implied warranty of
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * General Public License for more details.
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 *
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * You should have received a copy of the GNU General Public License
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 **/
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #include "OrthancFindRequestHandler.h"
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include <glog/logging.h>
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
35 #include <boost/regex.hpp>
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #include "../Core/DicomFormat/DicomArray.h"
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
38 #include "ServerToolbox.h"
618
5ab377df6d8b filtering on aet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 615
diff changeset
39 #include "OrthancInitialization.h"
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 namespace Orthanc
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 {
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
43 static bool IsWildcard(const std::string& constraint)
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
44 {
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
45 return (constraint.find('-') != std::string::npos ||
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
46 constraint.find('*') != std::string::npos ||
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
47 constraint.find('\\') != std::string::npos ||
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
48 constraint.find('?') != std::string::npos);
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
49 }
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
50
610
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
51 static std::string ToLowerCase(const std::string& s)
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
52 {
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
53 std::string result = s;
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
54 Toolbox::ToLowerCase(result);
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
55 return result;
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
56 }
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
57
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
58 static bool ApplyRangeConstraint(const std::string& value,
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
59 const std::string& constraint)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
60 {
610
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
61 size_t separator = constraint.find('-');
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
62 std::string lower = ToLowerCase(constraint.substr(0, separator));
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
63 std::string upper = ToLowerCase(constraint.substr(separator + 1));
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
64 std::string v = ToLowerCase(value);
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
65
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
66 if (lower.size() == 0 && upper.size() == 0)
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
67 {
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
68 return false;
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
69 }
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
70
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
71 if (lower.size() == 0)
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
72 {
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
73 return v <= upper;
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
74 }
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
75
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
76 if (upper.size() == 0)
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
77 {
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
78 return v >= lower;
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
79 }
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
80
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
81 return (v >= lower && v <= upper);
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
82 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
83
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
84
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
85 static bool ApplyListConstraint(const std::string& value,
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
86 const std::string& constraint)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
87 {
610
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
88 std::string v1 = ToLowerCase(value);
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
89
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
90 std::vector<std::string> items;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
91 Toolbox::TokenizeString(items, constraint, '\\');
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
92
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
93 for (size_t i = 0; i < items.size(); i++)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
94 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
95 Toolbox::ToLowerCase(items[i]);
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
96 if (items[i] == v1)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
97 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
98 return true;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
99 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
100 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
101
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
102 return false;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
103 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
104
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
105
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
106 static bool Matches(const std::string& value,
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
107 const std::string& constraint)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
108 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
109 // http://www.itk.org/Wiki/DICOM_QueryRetrieve_Explained
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
110 // http://dicomiseasy.blogspot.be/2012/01/dicom-queryretrieve-part-i.html
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
111
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
112 if (constraint.find('-') != std::string::npos)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
113 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
114 return ApplyRangeConstraint(value, constraint);
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
115 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
116
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
117 if (constraint.find('\\') != std::string::npos)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
118 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
119 return ApplyListConstraint(value, constraint);
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
120 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
121
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
122 if (constraint.find('*') != std::string::npos ||
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
123 constraint.find('?') != std::string::npos)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
124 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
125 // TODO - Cache the constructed regular expression
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
126 boost::regex pattern(Toolbox::WildcardToRegularExpression(constraint),
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
127 boost::regex::icase /* case insensitive search */);
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
128 return boost::regex_match(value, pattern);
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
129 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
130 else
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
131 {
610
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
132 return ToLowerCase(value) == ToLowerCase(constraint);
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
133 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
134 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
135
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
136
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
137 static bool LookupOneInstance(std::string& result,
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
138 ServerIndex& index,
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
139 const std::string& id,
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
140 ResourceType type)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
141 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
142 if (type == ResourceType_Instance)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
143 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
144 result = id;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
145 return true;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
146 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
147
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
148 std::string childId;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
149
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
150 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
151 std::list<std::string> children;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
152 index.GetChildInstances(children, id);
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
153
656
08eca5d86aad fixes to cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 618
diff changeset
154 if (children.empty())
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
155 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
156 return false;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
157 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
158
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
159 childId = children.front();
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
160 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
161
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
162 return LookupOneInstance(result, index, childId, GetChildResourceType(type));
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
163 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
164
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
165
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
166 static bool Matches(const Json::Value& resource,
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
167 const DicomArray& query)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
168 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
169 for (size_t i = 0; i < query.GetSize(); i++)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
170 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
171 if (query.GetElement(i).GetValue().IsNull() ||
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
172 query.GetElement(i).GetTag() == DICOM_TAG_QUERY_RETRIEVE_LEVEL ||
611
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
173 query.GetElement(i).GetTag() == DICOM_TAG_SPECIFIC_CHARACTER_SET ||
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
174 query.GetElement(i).GetTag() == DICOM_TAG_MODALITIES_IN_STUDY)
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
175 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
176 continue;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
177 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
178
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
179 std::string tag = query.GetElement(i).GetTag().Format();
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
180 std::string value;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
181 if (resource.isMember(tag))
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
182 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
183 value = resource.get(tag, Json::arrayValue).get("Value", "").asString();
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
184 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
185
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
186 if (!Matches(value, query.GetElement(i).GetValue().AsString()))
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
187 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
188 return false;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
189 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
190 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
191
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
192 return true;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
193 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
194
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
195
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
196 static void AddAnswer(DicomFindAnswers& answers,
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
197 const Json::Value& resource,
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
198 const DicomArray& query)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
199 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
200 DicomMap result;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
201
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
202 for (size_t i = 0; i < query.GetSize(); i++)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
203 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
204 if (query.GetElement(i).GetTag() != DICOM_TAG_QUERY_RETRIEVE_LEVEL &&
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
205 query.GetElement(i).GetTag() != DICOM_TAG_SPECIFIC_CHARACTER_SET)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
206 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
207 std::string tag = query.GetElement(i).GetTag().Format();
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
208 std::string value;
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
209 if (resource.isMember(tag))
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
210 {
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
211 value = resource.get(tag, Json::arrayValue).get("Value", "").asString();
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
212 result.SetValue(query.GetElement(i).GetTag(), value);
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
213 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
214 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
215 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
216
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
217 answers.Add(result);
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
218 }
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
219
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
220
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
221 static bool ApplyModalitiesInStudyFilter(std::list<std::string>& filteredStudies,
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
222 const std::list<std::string>& studies,
612
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
223 const DicomMap& input,
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
224 ServerIndex& index)
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
225 {
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
226 filteredStudies.clear();
612
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
227
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
228 const DicomValue& v = input.GetValue(DICOM_TAG_MODALITIES_IN_STUDY);
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
229 if (v.IsNull())
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
230 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
231 return false;
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
232 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
233
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
234 // Move the allowed modalities into a "std::set"
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
235 std::vector<std::string> tmp;
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
236 Toolbox::TokenizeString(tmp, v.AsString(), '\\');
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
237
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
238 std::set<std::string> modalities;
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
239 for (size_t i = 0; i < tmp.size(); i++)
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
240 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
241 modalities.insert(tmp[i]);
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
242 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
243
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
244 // Loop over the studies
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
245 for (std::list<std::string>::const_iterator
656
08eca5d86aad fixes to cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 618
diff changeset
246 it = studies.begin(); it != studies.end(); ++it)
612
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
247 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
248 try
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
249 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
250 // We are considering a single study. Check whether one of
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
251 // its child series matches one of the modalities.
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
252 Json::Value study;
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
253 if (index.LookupResource(study, *it, ResourceType_Study))
612
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
254 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
255 // Loop over the series of the considered study.
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
256 for (Json::Value::ArrayIndex j = 0; j < study["Series"].size(); j++) // (*)
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
257 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
258 Json::Value series;
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
259 if (index.LookupResource(series, study["Series"][j].asString(), ResourceType_Series))
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
260 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
261 // Get the modality of this series
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
262 if (series["MainDicomTags"].isMember("Modality"))
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
263 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
264 std::string modality = series["MainDicomTags"]["Modality"].asString();
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
265 if (modalities.find(modality) != modalities.end())
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
266 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
267 // This series of the considered study matches one
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
268 // of the required modalities. Take the study into
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
269 // consideration for future filtering.
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
270 filteredStudies.push_back(*it);
612
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
271
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
272 // We have finished considering this study. Break the study loop at (*).
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
273 break;
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
274 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
275 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
276 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
277 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
278 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
279 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
280 catch (OrthancException&)
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
281 {
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
282 // This resource has probably been deleted during the find request
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
283 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
284 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
285
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
286 return true;
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
287 }
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
288
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
289
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
290 static bool LookupCandidateResourcesInternal(/* out */ std::list<std::string>& resources,
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
291 /* in */ ServerIndex& index,
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
292 /* in */ ResourceType level,
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
293 /* in */ const DicomMap& query,
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
294 /* in */ DicomTag tag)
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
295 {
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
296 if (query.HasTag(tag))
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
297 {
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
298 const DicomValue& value = query.GetValue(tag);
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
299 if (!value.IsNull())
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
300 {
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
301 std::string str = query.GetValue(tag).AsString();
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
302 if (!IsWildcard(str))
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
303 {
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
304 index.LookupTagValue(resources, tag, str/*, level*/);
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
305 return true;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
306 }
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
307 }
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
308 }
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
309
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
310 return false;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
311 }
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
312
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
313
681
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
314 static bool LookupCandidateResourcesInternal(/* inout */ std::set<std::string>& resources,
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
315 /* in */ bool alreadyFiltered,
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
316 /* in */ ServerIndex& index,
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
317 /* in */ ResourceType level,
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
318 /* in */ const DicomMap& query,
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
319 /* in */ DicomTag tag)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
320 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
321 assert(alreadyFiltered || resources.size() == 0);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
322
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
323 if (!query.HasTag(tag))
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
324 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
325 return alreadyFiltered;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
326 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
327
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
328 const DicomValue& value = query.GetValue(tag);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
329 if (value.IsNull())
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
330 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
331 return alreadyFiltered;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
332 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
333
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
334 std::string str = query.GetValue(tag).AsString();
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
335 if (IsWildcard(str))
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
336 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
337 return alreadyFiltered;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
338 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
339
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
340 std::list<std::string> matches;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
341 index.LookupTagValue(matches, tag, str/*, level*/);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
342
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
343 if (alreadyFiltered)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
344 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
345 std::set<std::string> previous = resources;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
346
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
347 for (std::list<std::string>::const_iterator
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
348 it = matches.begin(); it != matches.end(); it++)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
349 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
350 if (previous.find(*it) != previous.end())
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
351 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
352 resources.insert(*it);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
353 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
354 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
355 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
356 else
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
357 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
358 for (std::list<std::string>::const_iterator
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
359 it = matches.begin(); it != matches.end(); it++)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
360 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
361 resources.insert(*it);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
362 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
363 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
364
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
365 return true;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
366 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
367
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
368
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
369 static bool LookupCandidateResourcesAtOneLevel(/* out */ std::set<std::string>& resources,
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
370 /* in */ ServerIndex& index,
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
371 /* in */ ResourceType level,
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
372 /* in */ const DicomMap& fullQuery,
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
373 /* in */ ModalityManufacturer manufacturer)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
374 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
375 DicomMap tmp;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
376 fullQuery.ExtractMainDicomTagsForLevel(tmp, level);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
377 DicomArray query(tmp);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
378
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
379 if (query.GetSize() == 0)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
380 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
381 return false;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
382 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
383
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
384 for (size_t i = 0; i < query.GetSize(); i++)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
385 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
386 const DicomTag tag = query.GetElement(i).GetTag();
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
387 const DicomValue& value = query.GetElement(i).GetValue();
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
388 if (!value.IsNull())
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
389 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
390 // TODO TODO TODO
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
391 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
392 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
393
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
394 printf(">>>>>>>>>>\n");
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
395 query.Print(stdout);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
396 printf("<<<<<<<<<<\n\n");
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
397 return true;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
398 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
399
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
400
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
401 static void LookupCandidateResources(/* out */ std::list<std::string>& resources,
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
402 /* in */ ServerIndex& index,
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
403 /* in */ ResourceType level,
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
404 /* in */ const DicomMap& query,
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
405 /* in */ ModalityManufacturer manufacturer)
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
406 {
681
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
407 #if 1
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
408 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
409 std::set<std::string> s;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
410 LookupCandidateResourcesAtOneLevel(s, index, ResourceType_Patient, query, manufacturer);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
411 LookupCandidateResourcesAtOneLevel(s, index, ResourceType_Study, query, manufacturer);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
412 LookupCandidateResourcesAtOneLevel(s, index, ResourceType_Series, query, manufacturer);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
413 LookupCandidateResourcesAtOneLevel(s, index, ResourceType_Instance, query, manufacturer);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
414 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
415
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
416 std::set<std::string> filtered;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
417 bool isFiltered = false;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
418
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
419 // Filter by indexed tags, from most specific to least specific
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
420 //isFiltered = LookupCandidateResourcesInternal(filtered, isFiltered, index, level, query, DICOM_TAG_SOP_INSTANCE_UID);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
421 isFiltered = LookupCandidateResourcesInternal(filtered, isFiltered, index, level, query, DICOM_TAG_SERIES_INSTANCE_UID);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
422 //isFiltered = LookupCandidateResourcesInternal(filtered, isFiltered, index, level, query, DICOM_TAG_STUDY_INSTANCE_UID);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
423 //isFiltered = LookupCandidateResourcesInternal(filtered, isFiltered, index, level, query, DICOM_TAG_PATIENT_ID);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
424
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
425 resources.clear();
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
426
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
427 if (isFiltered)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
428 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
429 for (std::set<std::string>::const_iterator
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
430 it = filtered.begin(); it != filtered.end(); it++)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
431 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
432 resources.push_back(*it);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
433 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
434 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
435 else
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
436 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
437 // No indexed tag matches the query. Return all the resources at this query level.
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
438 Json::Value allResources;
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
439 index.GetAllUuids(allResources, level);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
440 assert(allResources.type() == Json::arrayValue);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
441
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
442 for (Json::Value::ArrayIndex i = 0; i < allResources.size(); i++)
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
443 {
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
444 resources.push_back(allResources[i].asString());
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
445 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
446 }
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
447
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
448 #else
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
449
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
450 // TODO : Speed up using full querying against the MainDicomTags.
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
451
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
452 resources.clear();
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
453
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
454 bool done = false;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
455
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
456 switch (level)
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
457 {
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
458 case ResourceType_Patient:
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
459 done = LookupCandidateResourcesInternal(resources, index, level, query, DICOM_TAG_PATIENT_ID);
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
460 break;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
461
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
462 case ResourceType_Study:
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
463 done = LookupCandidateResourcesInternal(resources, index, level, query, DICOM_TAG_STUDY_INSTANCE_UID);
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
464 break;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
465
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
466 case ResourceType_Series:
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
467 done = LookupCandidateResourcesInternal(resources, index, level, query, DICOM_TAG_SERIES_INSTANCE_UID);
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
468 break;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
469
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
470 case ResourceType_Instance:
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
471 if (manufacturer == ModalityManufacturer_MedInria)
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
472 {
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
473 std::list<std::string> series;
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
474
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
475 if (LookupCandidateResourcesInternal(series, index, ResourceType_Series, query, DICOM_TAG_SERIES_INSTANCE_UID) &&
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
476 series.size() == 1)
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
477 {
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
478 index.GetChildInstances(resources, series.front());
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
479 done = true;
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
480 }
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
481 }
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
482 else
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
483 {
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
484 done = LookupCandidateResourcesInternal(resources, index, level, query, DICOM_TAG_SOP_INSTANCE_UID);
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
485 }
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
486
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
487 break;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
488
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
489 default:
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
490 break;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
491 }
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
492
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
493 if (!done)
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
494 {
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
495 Json::Value allResources;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
496 index.GetAllUuids(allResources, level);
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
497 assert(allResources.type() == Json::arrayValue);
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
498
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
499 for (Json::Value::ArrayIndex i = 0; i < allResources.size(); i++)
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
500 {
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
501 resources.push_back(allResources[i].asString());
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
502 }
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
503 }
681
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
504 #endif
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
505 }
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
506
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
507
618
5ab377df6d8b filtering on aet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 615
diff changeset
508 void OrthancFindRequestHandler::Handle(DicomFindAnswers& answers,
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
509 const DicomMap& input,
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
510 const std::string& callingAETitle)
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 {
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 /**
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
513 * Retrieve the manufacturer of this modality.
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
514 **/
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
515
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
516 ModalityManufacturer manufacturer;
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
517
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
518 {
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
519 std::string symbolicName, address;
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
520 int port;
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
521
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
522 if (!LookupDicomModalityUsingAETitle(callingAETitle, symbolicName, address, port, manufacturer))
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
523 {
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
524 throw OrthancException("Unknown modality");
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
525 }
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
526 }
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
527
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
528
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
529 /**
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 * Retrieve the query level.
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 **/
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 const DicomValue* levelTmp = input.TestAndGetValue(DICOM_TAG_QUERY_RETRIEVE_LEVEL);
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 if (levelTmp == NULL)
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535 {
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536 throw OrthancException(ErrorCode_BadRequest);
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 }
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539 ResourceType level = StringToResourceType(levelTmp->AsString().c_str());
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
541 switch (manufacturer)
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542 {
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
543 case ModalityManufacturer_MedInria:
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
544 // MedInria makes FIND requests at the instance level before starting MOVE
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
545 break;
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
546
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
547 default:
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
548 if (level != ResourceType_Patient &&
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
549 level != ResourceType_Study &&
681
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
550 level != ResourceType_Series &&
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
551 level != ResourceType_Instance)
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
552 {
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
553 throw OrthancException(ErrorCode_NotImplemented);
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
554 }
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555 }
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558 /**
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
559 * Retrieve the candidate resources for this query level. Whenever
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
560 * possible, we avoid returning ALL the resources for this query
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
561 * level, as it would imply reading the JSON file on the harddisk
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
562 * for each of them.
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
563 **/
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
564
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
565 std::list<std::string> resources;
665
41b3e5ccb291 fix for medInria
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 656
diff changeset
566 LookupCandidateResources(resources, context_.GetIndex(), level, input, manufacturer);
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
567
611
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
568
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
569 /**
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
570 * Apply filtering on modalities for studies, if asked (this is an
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
571 * extension to standard DICOM)
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
572 * http://www.medicalconnections.co.uk/kb/Filtering_on_and_Retrieving_the_Modality_in_a_C_FIND
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
573 **/
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
574
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
575 if (level == ResourceType_Study &&
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
576 input.HasTag(DICOM_TAG_MODALITIES_IN_STUDY))
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
577 {
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
578 std::list<std::string> filtered;
612
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
579 if (ApplyModalitiesInStudyFilter(filtered, resources, input, context_.GetIndex()))
611
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
580 {
612
fdd5f7f9c4d7 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 611
diff changeset
581 resources = filtered;
611
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
582 }
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
583 }
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
584
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
585
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
586 /**
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
587 * Loop over all the resources for this query level.
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
588 **/
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 DicomArray query(input);
681
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
591 query.Print(stdout);
3bdb5db8e839 generalization of query/retrieve
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 665
diff changeset
592
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
593 for (std::list<std::string>::const_iterator
656
08eca5d86aad fixes to cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 618
diff changeset
594 resource = resources.begin(); resource != resources.end(); ++resource)
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595 {
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
596 try
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597 {
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
598 std::string instance;
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
599 if (LookupOneInstance(instance, context_.GetIndex(), *resource, level))
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600 {
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
601 Json::Value info;
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
602 context_.ReadJson(info, instance);
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
603
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
604 if (Matches(info, query))
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
605 {
615
ec0b7a51d7bd speed up find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 612
diff changeset
606 AddAnswer(answers, info, query);
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
607 }
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608 }
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609 }
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
610 catch (OrthancException&)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
611 {
611
9924aec1d694 filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
612 // This resource has probably been deleted during the find request
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 565
diff changeset
613 }
565
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614 }
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615 }
c931ac02db82 refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616 }