Mercurial > hg > orthanc
annotate OrthancServer/Sources/OrthancFindRequestHandler.cpp @ 5692:7c11a71927a9 find-refactoring
improved handling of limits
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 11 Jul 2024 20:20:50 +0200 |
parents | f7adfb22e20e |
children | 0f8b6214308a |
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 |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1162
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:
5639
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:
5639
diff
changeset
|
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5432
diff
changeset
|
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * 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
|
10 * 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
|
11 * 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
|
12 * License, or (at your option) any later version. |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * 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
|
15 * WITHOUT ANY WARRANTY; without even the implied warranty of |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * General Public License for more details. |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * 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
|
20 * 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
|
21 **/ |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
824
a811bdf8b8eb
precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
810
diff
changeset
|
23 |
831
84513f2ee1f3
pch for unit tests and server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
24 #include "PrecompiledHeadersServer.h" |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 #include "OrthancFindRequestHandler.h" |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
4045 | 27 #include "../../OrthancFramework/Sources/DicomFormat/DicomArray.h" |
28 #include "../../OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h" | |
29 #include "../../OrthancFramework/Sources/Logging.h" | |
30 #include "../../OrthancFramework/Sources/Lua/LuaFunctionCall.h" | |
31 #include "../../OrthancFramework/Sources/MetricsRegistry.h" | |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
32 #include "OrthancConfiguration.h" |
3094
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3061
diff
changeset
|
33 #include "Search/DatabaseLookup.h" |
3095
beeeb6096f27
removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3094
diff
changeset
|
34 #include "ServerContext.h" |
1759
e268412adcf1
removal of old implementation of search
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1758
diff
changeset
|
35 #include "ServerToolbox.h" |
608 | 36 |
1486
f967bdf8534e
refactoring to Logging.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1429
diff
changeset
|
37 #include <boost/regex.hpp> |
f967bdf8534e
refactoring to Logging.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1429
diff
changeset
|
38 |
608 | 39 |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1354
diff
changeset
|
40 namespace Orthanc |
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1354
diff
changeset
|
41 { |
608 | 42 static void AddAnswer(DicomFindAnswers& answers, |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
43 ServerContext& context, |
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
44 const std::string& publicId, |
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
45 const std::string& instanceId, |
3012
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
46 const DicomMap& mainDicomTags, |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
47 const Json::Value* dicomAsJson, |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
48 ResourceType level, |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
49 const DicomArray& query, |
1898
e018037d4d0e
Support of optional tags for counting resources in C-Find
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1893
diff
changeset
|
50 const std::list<DicomTag>& sequencesToReturn, |
4020
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
51 const std::string& defaultPrivateCreator, |
4143
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
52 const std::map<uint16_t, std::string>& privateCreators, |
5058
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
4978
diff
changeset
|
53 const std::string& retrieveAet, |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
4978
diff
changeset
|
54 bool allowStorageAccess) |
608 | 55 { |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
56 ExpandedResource resource; |
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
57 std::set<DicomTag> requestedTags; |
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
58 |
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
59 query.GetTags(requestedTags); |
4978
2cfa50d8eb60
Speed-up handling of DicomModalitiesInStudy in C-Find and tools/find queries
Alain Mazy <am@osimis.io>
parents:
4940
diff
changeset
|
60 requestedTags.erase(DICOM_TAG_QUERY_RETRIEVE_LEVEL); // this is not part of the answer |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
61 |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
62 // reuse ExpandResource to get missing tags and computed tags (ModalitiesInStudy ...). This code is therefore shared between C-Find, tools/find, list-resources and QIDO-RS |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
63 context.ExpandResource(resource, publicId, mainDicomTags, instanceId, dicomAsJson, |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
64 level, requestedTags, ExpandResourceFlags_IncludeMainDicomTags, allowStorageAccess); |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
65 |
608 | 66 DicomMap result; |
67 | |
4143
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
68 /** |
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
69 * Add the mandatory "Retrieve AE Title (0008,0054)" tag, which was missing in Orthanc <= 1.7.2. |
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
70 * http://dicom.nema.org/medical/dicom/current/output/html/part04.html#sect_C.4.1.1.3.2 |
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
71 * https://groups.google.com/g/orthanc-users/c/-7zNTKR_PMU/m/kfjwzEVNAgAJ |
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
72 **/ |
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
73 result.SetValue(DICOM_TAG_RETRIEVE_AE_TITLE, retrieveAet, false /* not binary */); |
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
74 |
608 | 75 for (size_t i = 0; i < query.GetSize(); i++) |
76 { | |
1346 | 77 if (query.GetElement(i).GetTag() == DICOM_TAG_QUERY_RETRIEVE_LEVEL) |
78 { | |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
79 // Fix issue 30 on Google Code (QR response missing "Query/Retrieve Level" (008,0052)) |
1346 | 80 result.SetValue(query.GetElement(i).GetTag(), query.GetElement(i).GetValue()); |
81 } | |
82 else if (query.GetElement(i).GetTag() == DICOM_TAG_SPECIFIC_CHARACTER_SET) | |
83 { | |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
84 // Do not include the encoding, this is handled by class ParsedDicomFile |
1346 | 85 } |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
86 else |
608 | 87 { |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
88 const DicomTag& tag = query.GetElement(i).GetTag(); |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
89 const DicomValue* value = resource.GetMainDicomTags().TestAndGetValue(tag); |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
90 |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
91 if (value != NULL && |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
92 !value->IsNull() && |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
93 !value->IsBinary()) |
608 | 94 { |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
95 result.SetValue(tag, value->GetContent(), false); |
608 | 96 } |
722 | 97 else |
98 { | |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
99 result.SetValue(tag, "", false); |
722 | 100 } |
608 | 101 } |
102 } | |
103 | |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
104 if (result.GetSize() == 0 && |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
105 sequencesToReturn.empty()) |
1331
77e129ba64e4
Prevent freeze on C-FIND if no DICOM tag is to be returned
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
106 { |
4287
5a3374b6e707
using CLOG in Orthanc DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
107 CLOG(WARNING, DICOM) << "The C-FIND request does not return any DICOM tag"; |
1331
77e129ba64e4
Prevent freeze on C-FIND if no DICOM tag is to be returned
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
108 } |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
109 else if (sequencesToReturn.empty()) |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
110 { |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
111 answers.Add(result); |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
112 } |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
113 else if (dicomAsJson == NULL) |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
114 { |
4287
5a3374b6e707
using CLOG in Orthanc DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
115 CLOG(WARNING, DICOM) << "C-FIND query requesting a sequence, but reading JSON from disk is disabled"; |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
116 answers.Add(result); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
117 } |
1331
77e129ba64e4
Prevent freeze on C-FIND if no DICOM tag is to be returned
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
118 else |
77e129ba64e4
Prevent freeze on C-FIND if no DICOM tag is to be returned
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
119 { |
4007
884b55ce01f6
Private tags returned by C-FIND SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3712
diff
changeset
|
120 ParsedDicomFile dicom(result, GetDefaultDicomEncoding(), |
4035
cc6ed76bba27
added contextual privateCreators dico to ParsedDicomFile -> this allows you not to have to define a DefaultPrivateCreator. This was tested only in the scope of C-Find requests but should not have impact on other parts since it is not used out of C-Find right now
Alain Mazy <alain@mazy.be>
parents:
4020
diff
changeset
|
121 true /* be permissive, cf. issue #136 */, defaultPrivateCreator, privateCreators); |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
122 |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
123 for (std::list<DicomTag>::const_iterator tag = sequencesToReturn.begin(); |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
124 tag != sequencesToReturn.end(); ++tag) |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
125 { |
3012
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
126 assert(dicomAsJson != NULL); |
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
127 const Json::Value& source = (*dicomAsJson) [tag->Format()]; |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
128 |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
129 if (source.type() == Json::objectValue && |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
130 source.isMember("Type") && |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
131 source.isMember("Value") && |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
132 source["Type"].asString() == "Sequence" && |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
133 source["Value"].type() == Json::arrayValue) |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
134 { |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
135 Json::Value content = Json::arrayValue; |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
136 |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
137 for (Json::Value::ArrayIndex i = 0; i < source["Value"].size(); i++) |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
138 { |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
139 Json::Value item; |
4055
9214e3a7b0a2
moving FromDcmtkTests.cpp from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
140 Toolbox::SimplifyDicomAsJson(item, source["Value"][i], DicomToJsonFormat_Short); |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
141 content.append(item); |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
142 } |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
143 |
4011
914b15dedae3
fix for non private sequence tags in C-Find
Alain Mazy <alain@mazy.be>
parents:
4007
diff
changeset
|
144 if (tag->IsPrivate()) |
914b15dedae3
fix for non private sequence tags in C-Find
Alain Mazy <alain@mazy.be>
parents:
4007
diff
changeset
|
145 { |
4028 | 146 std::map<uint16_t, std::string>::const_iterator found = privateCreators.find(tag->GetGroup()); |
147 | |
148 if (found != privateCreators.end()) | |
4020
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
149 { |
4028 | 150 dicom.Replace(*tag, content, false, DicomReplaceMode_InsertIfAbsent, found->second.c_str()); |
4020
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
151 } |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
152 else |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
153 { |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
154 dicom.Replace(*tag, content, false, DicomReplaceMode_InsertIfAbsent, defaultPrivateCreator); |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
155 } |
4011
914b15dedae3
fix for non private sequence tags in C-Find
Alain Mazy <alain@mazy.be>
parents:
4007
diff
changeset
|
156 } |
914b15dedae3
fix for non private sequence tags in C-Find
Alain Mazy <alain@mazy.be>
parents:
4007
diff
changeset
|
157 else |
914b15dedae3
fix for non private sequence tags in C-Find
Alain Mazy <alain@mazy.be>
parents:
4007
diff
changeset
|
158 { |
914b15dedae3
fix for non private sequence tags in C-Find
Alain Mazy <alain@mazy.be>
parents:
4007
diff
changeset
|
159 dicom.Replace(*tag, content, false, DicomReplaceMode_InsertIfAbsent, "" /* no private creator */); |
914b15dedae3
fix for non private sequence tags in C-Find
Alain Mazy <alain@mazy.be>
parents:
4007
diff
changeset
|
160 } |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
161 } |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
162 } |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
163 |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
164 answers.Add(dicom); |
1331
77e129ba64e4
Prevent freeze on C-FIND if no DICOM tag is to be returned
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
165 } |
608 | 166 } |
167 | |
168 | |
1851
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
169 |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
170 bool OrthancFindRequestHandler::FilterQueryTag(std::string& value /* can be modified */, |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
171 ResourceType level, |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
172 const DicomTag& tag, |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
173 ModalityManufacturer manufacturer) |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
174 { |
2335 | 175 // Whatever the manufacturer, remove the GenericGroupLength tags |
176 // http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.2.html | |
5432
59e3b6f8c5be
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5222
diff
changeset
|
177 // https://orthanc.uclouvain.be/bugs/show_bug.cgi?id=31 |
2434
63194107e61b
fix issue 31 for good: removing group length correctly
amazy
parents:
2382
diff
changeset
|
178 if (tag.GetElement() == 0x0000) |
2317
5b7556568fa4
Incoming C-Find request: removing group-length for all manufacturer -> removed EFilm2 manufacturer that is now useless
amazy
parents:
2256
diff
changeset
|
179 { |
5b7556568fa4
Incoming C-Find request: removing group-length for all manufacturer -> removed EFilm2 manufacturer that is now useless
amazy
parents:
2256
diff
changeset
|
180 return false; |
5b7556568fa4
Incoming C-Find request: removing group-length for all manufacturer -> removed EFilm2 manufacturer that is now useless
amazy
parents:
2256
diff
changeset
|
181 } |
5b7556568fa4
Incoming C-Find request: removing group-length for all manufacturer -> removed EFilm2 manufacturer that is now useless
amazy
parents:
2256
diff
changeset
|
182 |
1853
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
183 switch (manufacturer) |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
184 { |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
185 case ModalityManufacturer_Vitrea: |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
186 // Following Denis Nesterov's mail on 2015-11-30 |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
187 if (tag == DicomTag(0x5653, 0x0010)) // "PrivateCreator = Vital Images SW 3.4" |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
188 { |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
189 return false; |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
190 } |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
191 |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
192 break; |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
193 |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
194 default: |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
195 break; |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
196 } |
b7d3d3b182cf
two patches for manufacturers Efilm and Vitrea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1851
diff
changeset
|
197 |
1851
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
198 return true; |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
199 } |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
200 |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
201 |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
202 bool OrthancFindRequestHandler::ApplyLuaFilter(DicomMap& target, |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
203 const DicomMap& source, |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
204 const std::string& remoteIp, |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
205 const std::string& remoteAet, |
2827
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
206 const std::string& calledAet, |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
207 ModalityManufacturer manufacturer) |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
208 { |
2221
e7beca979562
fix Windows build due to overwriting a macro
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2218
diff
changeset
|
209 static const char* LUA_CALLBACK = "IncomingFindRequestFilter"; |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
210 |
2617
912a767911b0
back to a single Lua context
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2616
diff
changeset
|
211 LuaScripting::Lock lock(context_.GetLuaScripting()); |
912a767911b0
back to a single Lua context
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2616
diff
changeset
|
212 |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
213 if (!lock.GetLua().IsExistingFunction(LUA_CALLBACK)) |
2218
3eefb84ac0bd
dynamically fix outgoing C-Find requests using "OutgoingFindRequestFilter()"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2208
diff
changeset
|
214 { |
3eefb84ac0bd
dynamically fix outgoing C-Find requests using "OutgoingFindRequestFilter()"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2208
diff
changeset
|
215 return false; |
3eefb84ac0bd
dynamically fix outgoing C-Find requests using "OutgoingFindRequestFilter()"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2208
diff
changeset
|
216 } |
3eefb84ac0bd
dynamically fix outgoing C-Find requests using "OutgoingFindRequestFilter()"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2208
diff
changeset
|
217 else |
3eefb84ac0bd
dynamically fix outgoing C-Find requests using "OutgoingFindRequestFilter()"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2208
diff
changeset
|
218 { |
2827
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
219 Json::Value origin; |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
220 FormatOrigin(origin, remoteIp, remoteAet, calledAet, manufacturer); |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
221 |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
222 LuaFunctionCall call(lock.GetLua(), LUA_CALLBACK); |
2218
3eefb84ac0bd
dynamically fix outgoing C-Find requests using "OutgoingFindRequestFilter()"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2208
diff
changeset
|
223 call.PushDicom(source); |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
224 call.PushJson(origin); |
4105
c02a2d9efbc2
move FromDcmtkBridge::ExecuteToDicom() to LuaFunctionCall, to remove dependency of DCMTK on Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4055
diff
changeset
|
225 call.ExecuteToDicom(target); |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
226 |
2218
3eefb84ac0bd
dynamically fix outgoing C-Find requests using "OutgoingFindRequestFilter()"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2208
diff
changeset
|
227 return true; |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
228 } |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
229 } |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
230 |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
231 |
2616
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
232 OrthancFindRequestHandler::OrthancFindRequestHandler(ServerContext& context) : |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
233 context_(context), |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
234 maxResults_(0), |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
235 maxInstances_(0) |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
236 { |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
237 } |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
238 |
2f3007bf0708
event queues in Lua, serialization of sequence of operations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2612
diff
changeset
|
239 |
3021
2cbafb5d5a62
renamed LookupResource::IVisitor as ServerContext::ILookupVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3015
diff
changeset
|
240 class OrthancFindRequestHandler::LookupVisitor : public ServerContext::ILookupVisitor |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
241 { |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
242 private: |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
243 DicomFindAnswers& answers_; |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
244 ServerContext& context_; |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
245 ResourceType level_; |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
246 const DicomMap& query_; |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
247 DicomArray queryAsArray_; |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
248 const std::list<DicomTag>& sequencesToReturn_; |
4020
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
249 std::string defaultPrivateCreator_; // the private creator to use if the group is not defined in the query itself |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
250 const std::map<uint16_t, std::string>& privateCreators_; // the private creators defined in the query itself |
4143
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
251 std::string retrieveAet_; |
5058
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
4978
diff
changeset
|
252 FindStorageAccessMode findStorageAccessMode_; |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
253 |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
254 public: |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
255 LookupVisitor(DicomFindAnswers& answers, |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
256 ServerContext& context, |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
257 ResourceType level, |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
258 const DicomMap& query, |
4020
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
259 const std::list<DicomTag>& sequencesToReturn, |
5058
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
4978
diff
changeset
|
260 const std::map<uint16_t, std::string>& privateCreators, |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
4978
diff
changeset
|
261 FindStorageAccessMode findStorageAccessMode) : |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
262 answers_(answers), |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
263 context_(context), |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
264 level_(level), |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
265 query_(query), |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
266 queryAsArray_(query), |
4020
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
267 sequencesToReturn_(sequencesToReturn), |
5058
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
4978
diff
changeset
|
268 privateCreators_(privateCreators), |
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
4978
diff
changeset
|
269 findStorageAccessMode_(findStorageAccessMode) |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
270 { |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
271 answers_.SetComplete(false); |
4007
884b55ce01f6
Private tags returned by C-FIND SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3712
diff
changeset
|
272 |
884b55ce01f6
Private tags returned by C-FIND SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3712
diff
changeset
|
273 { |
884b55ce01f6
Private tags returned by C-FIND SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3712
diff
changeset
|
274 OrthancConfiguration::ReaderLock lock; |
4011
914b15dedae3
fix for non private sequence tags in C-Find
Alain Mazy <alain@mazy.be>
parents:
4007
diff
changeset
|
275 defaultPrivateCreator_ = lock.GetConfiguration().GetDefaultPrivateCreator(); |
4143
1ec3e1e18f50
Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
276 retrieveAet_ = lock.GetConfiguration().GetOrthancAET(); |
4007
884b55ce01f6
Private tags returned by C-FIND SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3712
diff
changeset
|
277 } |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
278 } |
3012
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
279 |
4204 | 280 virtual bool IsDicomAsJsonNeeded() const ORTHANC_OVERRIDE |
3012
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
281 { |
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
282 // Ask the "DICOM-as-JSON" attachment only if sequences are to |
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
283 // be returned OR if "query_" contains non-main DICOM tags! |
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
284 |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
285 DicomMap withoutSpecialTags; |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
286 withoutSpecialTags.Assign(query_); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
287 |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
288 // Check out "ComputeCounters()" |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
289 withoutSpecialTags.Remove(DICOM_TAG_MODALITIES_IN_STUDY); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
290 withoutSpecialTags.Remove(DICOM_TAG_NUMBER_OF_PATIENT_RELATED_INSTANCES); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
291 withoutSpecialTags.Remove(DICOM_TAG_NUMBER_OF_PATIENT_RELATED_SERIES); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
292 withoutSpecialTags.Remove(DICOM_TAG_NUMBER_OF_PATIENT_RELATED_STUDIES); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
293 withoutSpecialTags.Remove(DICOM_TAG_NUMBER_OF_SERIES_RELATED_INSTANCES); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
294 withoutSpecialTags.Remove(DICOM_TAG_NUMBER_OF_STUDY_RELATED_INSTANCES); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
295 withoutSpecialTags.Remove(DICOM_TAG_NUMBER_OF_STUDY_RELATED_SERIES); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
296 withoutSpecialTags.Remove(DICOM_TAG_SOP_CLASSES_IN_STUDY); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
297 |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
298 // Check out "AddAnswer()" |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
299 withoutSpecialTags.Remove(DICOM_TAG_SPECIFIC_CHARACTER_SET); |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
300 withoutSpecialTags.Remove(DICOM_TAG_QUERY_RETRIEVE_LEVEL); |
3012
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
301 |
3015
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
302 return (!sequencesToReturn_.empty() || |
abe49ca61cd5
On C-FIND, avoid accessing the storage area whenever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3012
diff
changeset
|
303 !withoutSpecialTags.HasOnlyMainDicomTags()); |
3012
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
304 } |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
305 |
4204 | 306 virtual void MarkAsComplete() ORTHANC_OVERRIDE |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
307 { |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
308 answers_.SetComplete(true); |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
309 } |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
310 |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
311 virtual void Visit(const std::string& publicId, |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
312 const std::string& instanceId, |
3012
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
313 const DicomMap& mainDicomTags, |
4204 | 314 const Json::Value* dicomAsJson) ORTHANC_OVERRIDE |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
315 { |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
316 AddAnswer(answers_, context_, publicId, instanceId, mainDicomTags, dicomAsJson, level_, queryAsArray_, sequencesToReturn_, |
5058
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
4978
diff
changeset
|
317 defaultPrivateCreator_, privateCreators_, retrieveAet_, IsStorageAccessAllowedForAnswers(findStorageAccessMode_)); |
3003
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
318 } |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
319 }; |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
320 |
5ae3ff2398e9
refactoring OrthancFindRequestHandler using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3001
diff
changeset
|
321 |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
322 void OrthancFindRequestHandler::Handle(DicomFindAnswers& answers, |
665 | 323 const DicomMap& input, |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
324 const std::list<DicomTag>& sequencesToReturn, |
1573
3309878b3e16
more information about the origin of requests submitted to the DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1486
diff
changeset
|
325 const std::string& remoteIp, |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1759
diff
changeset
|
326 const std::string& remoteAet, |
2256
de1ba22fd28a
simplification wrt. modality manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
327 const std::string& calledAet, |
de1ba22fd28a
simplification wrt. modality manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
328 ModalityManufacturer manufacturer) |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
329 { |
3174
8ea7c4546c3a
primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3163
diff
changeset
|
330 MetricsRegistry::Timer timer(context_.GetMetricsRegistry(), "orthanc_find_scp_duration_ms"); |
8ea7c4546c3a
primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3163
diff
changeset
|
331 |
4482
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
332 |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
333 /** |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
334 * Deal with global configuration |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
335 **/ |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
336 |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
337 bool caseSensitivePN; |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
338 |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
339 { |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
340 OrthancConfiguration::ReaderLock lock; |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
341 caseSensitivePN = lock.GetConfiguration().GetBooleanParameter("CaseSensitivePN", false); |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
342 |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
343 RemoteModalityParameters remote; |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
344 if (!lock.GetConfiguration().LookupDicomModalityUsingAETitle(remote, remoteAet)) |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
345 { |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
346 if (lock.GetConfiguration().GetBooleanParameter("DicomAlwaysAllowFind", false)) |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
347 { |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
348 CLOG(INFO, DICOM) << "C-FIND: Allowing SCU request from unknown modality with AET: " << remoteAet; |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
349 } |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
350 else |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
351 { |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
352 // This should never happen, given the test at bottom of |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
353 // "OrthancApplicationEntityFilter::IsAllowedRequest()" |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
354 throw OrthancException(ErrorCode_InexistentItem, |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
355 "C-FIND: Rejecting SCU request from unknown modality with AET: " + remoteAet); |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
356 } |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
357 } |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
358 } |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
359 |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
360 |
8efeaba1b7f9
new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4476
diff
changeset
|
361 |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
362 /** |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
363 * Possibly apply the user-supplied Lua filter. |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
364 **/ |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
365 |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
366 DicomMap lua; |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
367 const DicomMap* filteredInput = &input; |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
368 |
2827
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
369 if (ApplyLuaFilter(lua, input, remoteIp, remoteAet, calledAet, manufacturer)) |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
370 { |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
371 filteredInput = &lua; |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
372 } |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
373 |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
374 |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
375 /** |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
376 * Retrieve the query level. |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
377 **/ |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
378 |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
379 assert(filteredInput != NULL); |
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
380 const DicomValue* levelTmp = filteredInput->TestAndGetValue(DICOM_TAG_QUERY_RETRIEVE_LEVEL); |
1737
ec66a16aa398
removal of DicomStringValue and DicomNullValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
381 if (levelTmp == NULL || |
ec66a16aa398
removal of DicomStringValue and DicomNullValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
382 levelTmp->IsNull() || |
ec66a16aa398
removal of DicomStringValue and DicomNullValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
383 levelTmp->IsBinary()) |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
384 { |
2955 | 385 throw OrthancException(ErrorCode_BadRequest, |
386 "C-FIND request without the tag 0008,0052 (QueryRetrieveLevel)"); | |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
387 } |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
388 |
1737
ec66a16aa398
removal of DicomStringValue and DicomNullValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
389 ResourceType level = StringToResourceType(levelTmp->GetContent().c_str()); |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
390 |
714
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
391 if (level != ResourceType_Patient && |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
392 level != ResourceType_Study && |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
393 level != ResourceType_Series && |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
394 level != ResourceType_Instance) |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
395 { |
714
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
396 throw OrthancException(ErrorCode_NotImplemented); |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
397 } |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
398 |
665 | 399 |
1888
512b6e76f531
Lua: "IncomingFindRequestFilter()" to apply filters to incoming C-Find requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1859
diff
changeset
|
400 DicomArray query(*filteredInput); |
4287
5a3374b6e707
using CLOG in Orthanc DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
401 CLOG(INFO, DICOM) << "DICOM C-Find request at level: " << EnumerationToString(level); |
714
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
402 |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
403 for (size_t i = 0; i < query.GetSize(); i++) |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
404 { |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
405 if (!query.GetElement(i).GetValue().IsNull()) |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
406 { |
4313
91554aecff9a
removed a friend method for better abi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4287
diff
changeset
|
407 CLOG(INFO, DICOM) << " (" << query.GetElement(i).GetTag().Format() |
91554aecff9a
removed a friend method for better abi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4287
diff
changeset
|
408 << ") " << FromDcmtkBridge::GetTagName(query.GetElement(i)) |
4376
b002f9abe802
review of changeset 4375:208029732d51
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4375
diff
changeset
|
409 << " = " << context_.GetDeidentifiedContent(query.GetElement(i)); |
714
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
410 } |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
411 } |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
412 |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
413 for (std::list<DicomTag>::const_iterator it = sequencesToReturn.begin(); |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
414 it != sequencesToReturn.end(); ++it) |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
415 { |
4287
5a3374b6e707
using CLOG in Orthanc DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
416 CLOG(INFO, DICOM) << " (" << it->Format() |
5a3374b6e707
using CLOG in Orthanc DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
417 << ") " << FromDcmtkBridge::GetTagName(*it, "") |
5a3374b6e707
using CLOG in Orthanc DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
418 << " : sequence tag whose content will be copied"; |
1859
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
419 } |
4e7c318a3f69
C-FIND SCP will return tags with sequence value representation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1856
diff
changeset
|
420 |
4020
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
421 // collect the private creators from the query itself |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
422 std::map<uint16_t, std::string> privateCreators; |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
423 for (size_t i = 0; i < query.GetSize(); i++) |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
424 { |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
425 const DicomElement& element = query.GetElement(i); |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
426 if (element.GetTag().IsPrivate() && element.GetTag().GetElement() == 0x10) |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
427 { |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
428 privateCreators[element.GetTag().GetGroup()] = element.GetValue().GetContent(); |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
429 } |
320cde762fd9
collect private creators from the C-Find query itself; use DefaultPrivateCreator otherwise
Alain Mazy <alain@mazy.be>
parents:
4011
diff
changeset
|
430 } |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
431 |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
432 /** |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1354
diff
changeset
|
433 * Build up the query object. |
608 | 434 **/ |
435 | |
3033
5da6d1063d8f
effectively replacing LookupResource by DatabaseLookup in searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3025
diff
changeset
|
436 DatabaseLookup lookup; |
1759
e268412adcf1
removal of old implementation of search
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1758
diff
changeset
|
437 |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1354
diff
changeset
|
438 for (size_t i = 0; i < query.GetSize(); i++) |
714
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
439 { |
2115
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2088
diff
changeset
|
440 const DicomElement& element = query.GetElement(i); |
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2088
diff
changeset
|
441 const DicomTag tag = element.GetTag(); |
714
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
442 |
5639
b6a6179a2a69
TimezoneOffsetFromUTC is now ignored for C-Find matching
Alain Mazy <am@orthanc.team>
parents:
5485
diff
changeset
|
443 // remove tags that are not used for matching |
2115
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2088
diff
changeset
|
444 if (element.GetValue().IsNull() || |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1354
diff
changeset
|
445 tag == DICOM_TAG_QUERY_RETRIEVE_LEVEL || |
5639
b6a6179a2a69
TimezoneOffsetFromUTC is now ignored for C-Find matching
Alain Mazy <am@orthanc.team>
parents:
5485
diff
changeset
|
446 tag == DICOM_TAG_SPECIFIC_CHARACTER_SET || |
b6a6179a2a69
TimezoneOffsetFromUTC is now ignored for C-Find matching
Alain Mazy <am@orthanc.team>
parents:
5485
diff
changeset
|
447 tag == DICOM_TAG_TIMEZONE_OFFSET_FROM_UTC) // time zone is not directly used for matching. Once we support "Timezone query adjustment", we may use it to adjust date-time filters but for now, just ignore it |
714
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
448 { |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1354
diff
changeset
|
449 continue; |
714
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
450 } |
6a1dbba0cca7
new implementation of C-Find handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
451 |
2115
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2088
diff
changeset
|
452 std::string value = element.GetValue().GetContent(); |
1429
7366a0bdda6a
attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1383
diff
changeset
|
453 if (value.size() == 0) |
7366a0bdda6a
attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1383
diff
changeset
|
454 { |
3163
cf91b6f22278
Fix issue #90 (C-Find shall match missing tags to null/empty string)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3095
diff
changeset
|
455 // An empty string corresponds to an universal constraint, so we ignore it |
1429
7366a0bdda6a
attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1383
diff
changeset
|
456 continue; |
7366a0bdda6a
attempt of fix for Syngo.Via
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1383
diff
changeset
|
457 } |
611
9924aec1d694
filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
610
diff
changeset
|
458 |
2256
de1ba22fd28a
simplification wrt. modality manufacturers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
459 if (FilterQueryTag(value, level, tag, manufacturer)) |
1851
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
460 { |
2006
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1982
diff
changeset
|
461 ValueRepresentation vr = FromDcmtkBridge::LookupValueRepresentation(tag); |
1758 | 462 |
1851
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
463 // DICOM specifies that searches must be case sensitive, except |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
464 // for tags with a PN value representation |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
465 bool sensitive = true; |
2007
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
466 if (vr == ValueRepresentation_PersonName) |
1851
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
467 { |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
468 sensitive = caseSensitivePN; |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
469 } |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
470 |
3033
5da6d1063d8f
effectively replacing LookupResource by DatabaseLookup in searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3025
diff
changeset
|
471 lookup.AddDicomConstraint(tag, value, sensitive, true /* mandatory */); |
1851
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
472 } |
d364926389e0
OrthancFindRequestHandler::FilterQueryTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
473 else |
1758 | 474 { |
4287
5a3374b6e707
using CLOG in Orthanc DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
475 CLOG(INFO, DICOM) << "Because of a patch for the manufacturer of the remote modality, " |
5a3374b6e707
using CLOG in Orthanc DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
476 << "ignoring constraint on tag (" << tag.Format() << ") " |
5a3374b6e707
using CLOG in Orthanc DICOM handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
477 << FromDcmtkBridge::GetTagName(element); |
1759
e268412adcf1
removal of old implementation of search
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1758
diff
changeset
|
478 } |
611
9924aec1d694
filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
610
diff
changeset
|
479 } |
9924aec1d694
filtering on modalities
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
610
diff
changeset
|
480 |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1354
diff
changeset
|
481 |
608 | 482 /** |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1354
diff
changeset
|
483 * Run the query. |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
484 **/ |
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
485 |
2876 | 486 size_t limit = (level == ResourceType_Instance) ? maxInstances_ : maxResults_; |
941
83489fddd8c5
Options to limit the number of results for an incoming C-FIND query
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
487 |
3012
af1530b45290
Optimization: On finds, do not read JSON (disk) if main DICOM tags (DB) are sufficient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3005
diff
changeset
|
488 |
5058
d4e5ca0c9307
Fix the "Never" option of the "StorageAccessOnFind" that was sill accessing files (bug introduced in 1.11.0)
Alain Mazy <am@osimis.io>
parents:
4978
diff
changeset
|
489 LookupVisitor visitor(answers, context_, level, *filteredInput, sequencesToReturn, privateCreators, context_.GetFindStorageAccessMode()); |
3033
5da6d1063d8f
effectively replacing LookupResource by DatabaseLookup in searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3025
diff
changeset
|
490 context_.Apply(visitor, lookup, level, 0 /* "since" is not relevant to C-FIND */, limit); |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
491 } |
2827
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
492 |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
493 |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
494 void OrthancFindRequestHandler::FormatOrigin(Json::Value& origin, |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
495 const std::string& remoteIp, |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
496 const std::string& remoteAet, |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
497 const std::string& calledAet, |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
498 ModalityManufacturer manufacturer) |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
499 { |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
500 origin = Json::objectValue; |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
501 origin["RemoteIp"] = remoteIp; |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
502 origin["RemoteAet"] = remoteAet; |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
503 origin["CalledAet"] = calledAet; |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
504 origin["Manufacturer"] = EnumerationToString(manufacturer); |
d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2617
diff
changeset
|
505 } |
565
c931ac02db82
refactoring of find class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
506 } |