annotate OrthancServer/Sources/Database/FindResponse.h @ 5673:ebcbb448bea8 find-refactoring

improved memory
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Jul 2024 14:31:22 +0200
parents e300f22a46f0
children 74f3aab95886
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
5641
3f13db27b399 integration mainline->find-refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
3f13db27b399 integration mainline->find-refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5609
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h"
5574
5a13483d12c5 find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents: 5568
diff changeset
27 #include "../../../OrthancFramework/Sources/Enumerations.h"
5a13483d12c5 find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents: 5568
diff changeset
28 #include "../../../OrthancFramework/Sources/FileStorage/FileInfo.h"
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include "../ServerEnumerations.h"
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include "OrthancIdentifiers.h"
5565
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
31 #include "FindRequest.h"
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include <boost/noncopyable.hpp>
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include <deque>
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include <map>
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 #include <set>
5565
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
37 #include <list>
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 namespace Orthanc
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 class FindResponse : public boost::noncopyable
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
44 private:
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
45 class MainDicomTagsAtLevel : public boost::noncopyable
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
46 {
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
47 private:
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
48 class DicomValue;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
49
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
50 typedef std::map<DicomTag, DicomValue*> MainDicomTags;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
51
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
52 MainDicomTags mainDicomTags_;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
53
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
54 public:
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
55 ~MainDicomTagsAtLevel();
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
56
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
57 void AddStringDicomTag(uint16_t group,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
58 uint16_t element,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
59 const std::string& value);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
60
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
61 // The "Null" value could be used in the future to indicate a
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
62 // value that is not available, typically a new "ExtraMainDicomTag"
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
63 void AddNullDicomTag(uint16_t group,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
64 uint16_t element);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
65
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
66 void Export(DicomMap& target) const;
5565
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
67 };
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
68
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
69 class ChildrenInformation : public boost::noncopyable
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
70 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
71 private:
5673
ebcbb448bea8 improved memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5672
diff changeset
72 typedef std::map<MetadataType, std::set<std::string>* > MetadataValues;
ebcbb448bea8 improved memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5672
diff changeset
73 typedef std::map<DicomTag, std::set<std::string>* > MainDicomTagValues;
5672
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
74
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
75 std::set<std::string> identifiers_;
5672
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
76 MetadataValues metadataValues_;
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
77 MainDicomTagValues mainDicomTagValues_;
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
78
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
79 public:
5673
ebcbb448bea8 improved memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5672
diff changeset
80 ~ChildrenInformation();
ebcbb448bea8 improved memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5672
diff changeset
81
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
82 void AddIdentifier(const std::string& identifier);
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
83
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
84 const std::set<std::string>& GetIdentifiers() const
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
85 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
86 return identifiers_;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
87 }
5672
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
88
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
89 void AddMetadataValue(MetadataType metadata,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
90 const std::string& value);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
91
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
92 void GetMetadataValues(std::set<std::string>& values,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
93 MetadataType metadata) const;
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
94
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
95 void AddMainDicomTagValue(const DicomTag& tag,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
96 const std::string& value);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
97
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
98 void GetMainDicomTagValues(std::set<std::string>& values,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
99 const DicomTag& tag) const;
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
100 };
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
101
5565
def06a42e5ef Updated FindRequest & FindResponse definitions
Alain Mazy <am@orthanc.team>
parents: 5554
diff changeset
102
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
103 public:
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
104 class Resource : public boost::noncopyable
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 private:
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
107 typedef std::map<MetadataType, std::list<std::string>*> ChildrenMetadata;
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
108
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
109 ResourceType level_;
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
110 int64_t internalId_; // Internal ID of the resource in the database
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
111 std::string identifier_;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
112 std::unique_ptr<std::string> parentIdentifier_;
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
113 MainDicomTagsAtLevel mainDicomTagsPatient_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
114 MainDicomTagsAtLevel mainDicomTagsStudy_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
115 MainDicomTagsAtLevel mainDicomTagsSeries_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
116 MainDicomTagsAtLevel mainDicomTagsInstance_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
117 std::map<MetadataType, std::string> metadataPatient_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
118 std::map<MetadataType, std::string> metadataStudy_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
119 std::map<MetadataType, std::string> metadataSeries_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
120 std::map<MetadataType, std::string> metadataInstance_;
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
121 ChildrenInformation childrenStudiesInformation_;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
122 ChildrenInformation childrenSeriesInformation_;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
123 ChildrenInformation childrenInstancesInformation_;
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
124 std::set<std::string> labels_;
5574
5a13483d12c5 find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents: 5568
diff changeset
125 std::map<FileContentType, FileInfo> attachments_;
5672
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
126 ChildrenMetadata childrenMetadata_; // TODO-FIND: REMOVE
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
128 MainDicomTagsAtLevel& GetMainDicomTagsAtLevel(ResourceType level);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
129
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
130 const MainDicomTagsAtLevel& GetMainDicomTagsAtLevel(ResourceType level) const
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
131 {
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
132 return const_cast<Resource&>(*this).GetMainDicomTagsAtLevel(level);
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
133 }
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
134
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
135 ChildrenInformation& GetChildrenInformation(ResourceType level);
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
136
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
137 const ChildrenInformation& GetChildrenInformation(ResourceType level) const
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
138 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
139 return const_cast<Resource&>(*this).GetChildrenInformation(level);
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
140 }
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
141
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 public:
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
143 Resource(ResourceType level,
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
144 int64_t internalId,
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
145 const std::string& identifier) :
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
146 level_(level),
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
147 internalId_(internalId),
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
148 identifier_(identifier)
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
152 ~Resource();
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
153
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
154 ResourceType GetLevel() const
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
155 {
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
156 return level_;
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
157 }
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
158
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
159 int64_t GetInternalId() const
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
160 {
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
161 return internalId_;
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
162 }
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
163
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
164 const std::string& GetIdentifier() const
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
165 {
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
166 return identifier_;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
167 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
169 void SetParentIdentifier(const std::string& id);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
170
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
171 const std::string& GetParentIdentifier() const;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
172
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
173 bool HasParentIdentifier() const;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
174
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
175 void AddStringDicomTag(ResourceType level,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
176 uint16_t group,
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
177 uint16_t element,
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
178 const std::string& value)
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
179 {
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
180 GetMainDicomTagsAtLevel(level).AddStringDicomTag(group, element, value);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
181 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
183 void AddNullDicomTag(ResourceType level,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
184 uint16_t group,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
185 uint16_t element)
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
186 {
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
187 GetMainDicomTagsAtLevel(level).AddNullDicomTag(group, element);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
188 }
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
189
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
190 void GetMainDicomTags(DicomMap& target,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
191 ResourceType level) const
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
192 {
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
193 GetMainDicomTagsAtLevel(level).Export(target);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
194 }
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
195
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
196 void AddMetadata(ResourceType level,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
197 MetadataType metadata,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
198 const std::string& value);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
199
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
200 std::map<MetadataType, std::string>& GetMetadata(ResourceType level);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
201
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
202 const std::map<MetadataType, std::string>& GetMetadata(ResourceType level) const
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
203 {
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
204 return const_cast<Resource&>(*this).GetMetadata(level);
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
205 }
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
206
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
207 bool LookupMetadata(std::string& value,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
208 ResourceType level,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
209 MetadataType metadata) const;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
210
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
211 void AddChildIdentifier(ResourceType level,
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
212 const std::string& childId)
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
213 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
214 GetChildrenInformation(level).AddIdentifier(childId);;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
215 }
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
216
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
217 const std::set<std::string>& GetChildrenIdentifiers(ResourceType level) const
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
218 {
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
219 return GetChildrenInformation(level).GetIdentifiers();
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
220 }
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
221
5672
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
222 void AddChildrenMetadataValue(ResourceType level,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
223 MetadataType metadata,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
224 const std::string& value)
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
225 {
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
226 GetChildrenInformation(level).AddMetadataValue(metadata, value);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
227 }
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
228
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
229 void GetChildrenMetadataValues(std::set<std::string>& values,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
230 ResourceType level,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
231 MetadataType metadata) const
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
232 {
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
233 GetChildrenInformation(level).GetMetadataValues(values, metadata);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
234 }
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
235
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
236 void AddChildrenMainDicomTagValue(ResourceType level,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
237 const DicomTag& tag,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
238 const std::string& value)
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
239 {
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
240 GetChildrenInformation(level).AddMainDicomTagValue(tag, value);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
241 }
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
242
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
243 void GetChildrenMainDicomTagValues(std::set<std::string>& values,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
244 ResourceType level,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
245 const DicomTag& tag) const
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
246 {
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
247 GetChildrenInformation(level).GetMainDicomTagValues(values, tag);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
248 }
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
249
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
250 void AddLabel(const std::string& label);
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
251
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
252 std::set<std::string>& GetLabels()
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
253 {
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
254 return labels_;
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
255 }
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
256
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
257 const std::set<std::string>& GetLabels() const
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
258 {
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
259 return labels_;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
260 }
5568
b0b5546f1b9f find refactor: re-use existing code. /studies?expand is almost fully implemented with new code
Alain Mazy <am@orthanc.team>
parents: 5565
diff changeset
261
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
262 void AddAttachment(const FileInfo& attachment);
5574
5a13483d12c5 find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents: 5568
diff changeset
263
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
264 bool LookupAttachment(FileInfo& target,
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
265 FileContentType type) const;
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
266
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
267 const std::map<FileContentType, FileInfo>& GetAttachments() const
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
268 {
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
269 return attachments_;
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
270 }
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
271
5672
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
272 // TODO-FIND: REMOVE
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
273 void AddChildrenMetadata(MetadataType metadata,
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
274 const std::list<std::string>& values);
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
275
5672
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
276 // TODO-FIND: REMOVE
5595
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
277 bool LookupChildrenMetadata(std::list<std::string>& values,
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
278 MetadataType metadata) const;
a87f2a56257d implemented FindRequest::retrieveChildrenMetadata_
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5594
diff changeset
279
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
280 const std::string& GetOneInstanceIdentifier() const;
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
281
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
282 bool HasOneInstanceIdentifier() const
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
283 {
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
284 return !GetChildrenIdentifiers(ResourceType_Instance).empty();
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
285 }
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
286
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
287 void DebugExport(Json::Value& target,
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
288 const FindRequest& request) const;
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 };
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 private:
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
292 typedef std::map<std::string, Resource*> Index;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
293
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
294 std::deque<Resource*> items_;
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
295 Index index_;
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 public:
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 ~FindResponse();
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
300 void Add(Resource* item /* takes ownership */);
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 size_t GetSize() const
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 return items_.size();
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
307 const Resource& GetResourceByIndex(size_t index) const;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
308
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
309 Resource& GetResourceByIdentifier(const std::string& id);
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
310
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
311 const Resource& GetResourceByIdentifier(const std::string& id) const
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
312 {
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
313 return const_cast<FindResponse&>(*this).GetResourceByIdentifier(id);
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
314 }
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
315
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
316 bool HasResource(const std::string& id) const
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
317 {
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
318 return (index_.find(id) != index_.end());
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
319 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 };
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 }