annotate OrthancServer/Sources/Database/FindResponse.h @ 5674:74f3aab95886 find-refactoring

simplification
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Jul 2024 14:43:46 +0200
parents ebcbb448bea8
children dc96401dbe88
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_;
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
127 MainDicomTagsAtLevel& GetMainDicomTagsAtLevel(ResourceType level);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
128
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
129 const MainDicomTagsAtLevel& GetMainDicomTagsAtLevel(ResourceType level) const
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
130 {
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
131 return const_cast<Resource&>(*this).GetMainDicomTagsAtLevel(level);
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
132 }
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
133
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
134 ChildrenInformation& GetChildrenInformation(ResourceType level);
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
135
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
136 const ChildrenInformation& GetChildrenInformation(ResourceType level) const
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
137 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
138 return const_cast<Resource&>(*this).GetChildrenInformation(level);
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
139 }
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
140
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 public:
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
142 Resource(ResourceType level,
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
143 int64_t internalId,
5592
1e2631b8b9af GenericFind::Execute() is working for a basic request
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5589
diff changeset
144 const std::string& identifier) :
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
145 level_(level),
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
146 internalId_(internalId),
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
147 identifier_(identifier)
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 {
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
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
151 ResourceType GetLevel() const
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
152 {
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
153 return level_;
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
154 }
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
155
5606
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
156 int64_t GetInternalId() const
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
157 {
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
158 return internalId_;
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
159 }
6e2dad336446 added "IsStable" field in expanded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5600
diff changeset
160
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
161 const std::string& GetIdentifier() const
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
162 {
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
163 return identifier_;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
164 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
166 void SetParentIdentifier(const std::string& id);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
167
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
168 const std::string& GetParentIdentifier() const;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
169
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
170 bool HasParentIdentifier() const;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
171
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
172 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
173 uint16_t group,
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
174 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
175 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
176 {
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
177 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
178 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
180 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
181 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
182 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
183 {
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
184 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
185 }
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
186
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
187 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
188 ResourceType level) const
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 GetMainDicomTagsAtLevel(level).Export(target);
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
191 }
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 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
194 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
195 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
196
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
197 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
198
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
199 const std::map<MetadataType, std::string>& GetMetadata(ResourceType level) const
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
200 {
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
201 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
202 }
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
203
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
204 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
205 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
206 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
207
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
208 void AddChildIdentifier(ResourceType level,
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
209 const std::string& childId)
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
210 {
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
211 GetChildrenInformation(level).AddIdentifier(childId);;
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
212 }
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
213
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
214 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
215 {
5671
b4c97c51f9db added FindResponse::Resource::ChildrenInformation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5666
diff changeset
216 return GetChildrenInformation(level).GetIdentifiers();
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
217 }
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
218
5672
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
219 void AddChildrenMetadataValue(ResourceType level,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
220 MetadataType metadata,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
221 const std::string& value)
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
222 {
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
223 GetChildrenInformation(level).AddMetadataValue(metadata, value);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
224 }
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 void GetChildrenMetadataValues(std::set<std::string>& values,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
227 ResourceType level,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
228 MetadataType metadata) const
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
229 {
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
230 GetChildrenInformation(level).GetMetadataValues(values, metadata);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
231 }
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 void AddChildrenMainDicomTagValue(ResourceType level,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
234 const DicomTag& tag,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
235 const std::string& value)
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
236 {
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
237 GetChildrenInformation(level).AddMainDicomTagValue(tag, value);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
238 }
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 void GetChildrenMainDicomTagValues(std::set<std::string>& values,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
241 ResourceType level,
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
242 const DicomTag& tag) const
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
243 {
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
244 GetChildrenInformation(level).GetMainDicomTagValues(values, tag);
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
245 }
e300f22a46f0 implemented computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5671
diff changeset
246
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
247 void AddLabel(const std::string& label);
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
248
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
249 std::set<std::string>& GetLabels()
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
250 {
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
251 return labels_;
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
252 }
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
253
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
254 const std::set<std::string>& GetLabels() const
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
255 {
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
256 return labels_;
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
257 }
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
258
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
259 void AddAttachment(const FileInfo& attachment);
5574
5a13483d12c5 find-refactoring: attachments
Alain Mazy <am@orthanc.team>
parents: 5568
diff changeset
260
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
261 bool LookupAttachment(FileInfo& target,
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
262 FileContentType type) const;
5594
a906dc19264c created FindResponse::Resource::Format()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5592
diff changeset
263
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
264 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
265 {
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
266 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
267 }
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
268
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
269 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
270
5666
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
271 bool HasOneInstanceIdentifier() const
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
272 {
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
273 return !GetChildrenIdentifiers(ResourceType_Instance).empty();
aa231c18b9d2 adding computed tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
274 }
5596
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
275
81a29ad7fb4b added possibility to retrieve main DICOM tags and metadata at any level
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5595
diff changeset
276 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
277 const FindRequest& request) const;
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 };
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 private:
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
281 typedef std::map<std::string, Resource*> Index;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
282
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
283 std::deque<Resource*> items_;
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
284 Index index_;
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 public:
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 ~FindResponse();
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
289 void Add(Resource* item /* takes ownership */);
5554
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 size_t GetSize() const
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 {
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 return items_.size();
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 }
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
296 const Resource& GetResourceByIndex(size_t index) const;
5586
fc3914c07dd3 refactoring FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5583
diff changeset
297
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
298 Resource& GetResourceByIdentifier(const std::string& id);
5588
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
299
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
300 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
301 {
5609
4690a0d2b01e preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5606
diff changeset
302 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
303 }
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
304
5589
b51ee994cd6f renamed FindResponse::Item as FindResponse::Resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5588
diff changeset
305 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
306 {
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
307 return (index_.find(id) != index_.end());
1b0fc6685f57 add index of resources into FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5587
diff changeset
308 }
5554
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 };
12d8a1a266e9 introduction of FindRequest and FindResponse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 }