Mercurial > hg > orthanc
annotate OrthancServer/Sources/ResourceFinder.h @ 5615:a10978a5e65c find-refactoring
expansion of single resources using ResourceFinder
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 09 May 2024 12:24:29 +0200 |
parents | 4690a0d2b01e |
children | 8905ffa45fc2 |
rev | line source |
---|---|
5608 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium | |
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | |
7 * | |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU General Public License as | |
10 * published by the Free Software Foundation, either version 3 of the | |
11 * License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 **/ | |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #include "Database/FindRequest.h" | |
26 #include "Database/FindResponse.h" | |
27 | |
28 namespace Orthanc | |
29 { | |
30 class ServerContext; | |
31 class ServerIndex; | |
32 | |
33 class ResourceFinder : public boost::noncopyable | |
34 { | |
35 private: | |
36 FindRequest request_; | |
37 bool expand_; | |
38 DicomToJsonFormat format_; | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
39 bool hasRequestedTags_; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
40 std::set<DicomTag> requestedPatientTags_; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
41 std::set<DicomTag> requestedStudyTags_; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
42 std::set<DicomTag> requestedSeriesTags_; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
43 std::set<DicomTag> requestedInstanceTags_; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
44 std::set<DicomTag> requestedTagsFromFileStorage_; |
5608 | 45 bool includeAllMetadata_; // Same as: ExpandResourceFlags_IncludeAllMetadata |
46 | |
47 SeriesStatus GetSeriesStatus(uint32_t& expectedNumberOfInstances, | |
48 const FindResponse::Resource& resource) const; | |
49 | |
50 void Expand(Json::Value& target, | |
51 const FindResponse::Resource& resource, | |
52 ServerIndex& index) const; | |
53 | |
54 public: | |
55 ResourceFinder(ResourceType level, | |
56 bool expand); | |
57 | |
5615
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
58 void SetOrthancId(ResourceType level, |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
59 const std::string& id) |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
60 { |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
61 request_.SetOrthancId(level, id); |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
62 } |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
63 |
5608 | 64 void SetFormat(DicomToJsonFormat format) |
65 { | |
66 format_ = format; | |
67 } | |
68 | |
69 void SetLimits(uint64_t since, | |
70 uint64_t count) | |
71 { | |
72 request_.SetLimits(since, count); | |
73 } | |
74 | |
75 void SetIncludeAllMetadata(bool include) | |
76 { | |
77 includeAllMetadata_ = include; | |
78 } | |
79 | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
80 void AddRequestedTags(const DicomTag& tag); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
81 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
82 void AddRequestedTags(const std::set<DicomTag>& tags); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
83 |
5608 | 84 void Execute(Json::Value& target, |
85 ServerContext& context); | |
5615
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
86 |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
87 bool ExecuteOneResource(Json::Value& target, |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
88 ServerContext& context); |
5608 | 89 }; |
90 } |