Mercurial > hg > orthanc
comparison OrthancServer/Sources/ResourceFinder.h @ 5608:3d0aa94b44b3 find-refactoring
reorganization
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 08 May 2024 13:37:23 +0200 |
parents | |
children | 4690a0d2b01e |
comparison
equal
deleted
inserted
replaced
5607:a3732285f8b6 | 5608:3d0aa94b44b3 |
---|---|
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 std::set<DicomTag> requestedTags_; | |
39 DicomToJsonFormat format_; | |
40 bool includeAllMetadata_; // Same as: ExpandResourceFlags_IncludeAllMetadata | |
41 | |
42 SeriesStatus GetSeriesStatus(uint32_t& expectedNumberOfInstances, | |
43 const FindResponse::Resource& resource) const; | |
44 | |
45 void Expand(Json::Value& target, | |
46 const FindResponse::Resource& resource, | |
47 ServerIndex& index) const; | |
48 | |
49 public: | |
50 ResourceFinder(ResourceType level, | |
51 bool expand); | |
52 | |
53 void SetRequestedTags(const std::set<DicomTag>& tags) | |
54 { | |
55 requestedTags_ = tags; | |
56 } | |
57 | |
58 void SetFormat(DicomToJsonFormat format) | |
59 { | |
60 format_ = format; | |
61 } | |
62 | |
63 void SetLimits(uint64_t since, | |
64 uint64_t count) | |
65 { | |
66 request_.SetLimits(since, count); | |
67 } | |
68 | |
69 void SetIncludeAllMetadata(bool include) | |
70 { | |
71 includeAllMetadata_ = include; | |
72 } | |
73 | |
74 void Execute(Json::Value& target, | |
75 ServerContext& context); | |
76 }; | |
77 } |