Odil
A C++11 library for the DICOM standard
QIDORSRequest.h
Go to the documentation of this file.
1 /*************************************************************************
2  * odil - Copyright (C) Universite de Strasbourg
3  * Distributed under the terms of the CeCILL-B license, as published by
4  * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5  * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6  * for details.
7  ************************************************************************/
8 
9 #ifndef _1cd2d27d_2d97_405b_b9d5_4104210e543a
10 #define _1cd2d27d_2d97_405b_b9d5_4104210e543a
11 
12 #include <string>
13 #include <tuple>
14 #include <vector>
15 #include <set>
16 
17 #include "odil/DataSet.h"
18 #include "odil/odil.h"
19 #include "odil/Tag.h"
21 #include "odil/webservices/Utils.h"
23 #include "odil/webservices/URL.h"
24 
25 namespace odil
26 {
27 
28 namespace webservices
29 {
30 
32 class ODIL_API QIDORSRequest
33 {
34 public:
36  QIDORSRequest(URL const & base_url);
37 
39  QIDORSRequest(HTTPRequest const & request);
40 
42  bool operator==(QIDORSRequest const & other) const;
43 
45  bool operator!=(QIDORSRequest const & other) const;
46 
48  URL const & get_base_url() const;
49 
51  void set_base_url(URL const & url);
52 
54  std::string const & get_media_type() const;
55 
57  Representation const & get_representation() const;
58 
60  URL const & get_url () const;
61 
63  Selector const & get_selector() const;
64 
66  std::shared_ptr<DataSet const> get_query_data_set() const;
67 
69  std::set<std::vector<Tag>> const & get_includefields() const;
70 
72  bool get_fuzzymatching() const;
73 
75  int get_limit() const;
76 
78  int get_offset() const;
79 
81  HTTPRequest get_http_request() const;
82 
84  void request_datasets(
85  Representation representation, Selector const & selector,
86  std::shared_ptr<DataSet> query, bool fuzzymatching=false,
87  int limit=-1, int offset=0, bool numerical_tags=false);
88 
89 private:
90  URL _base_url;
91  std::string _media_type;
92  Representation _representation;
93  URL _url;
94  Selector _selector;
95  std::shared_ptr<DataSet> _query_data_set;
96 
97  bool _fuzzymatching;
99  int _limit;
104  int _offset;
105 
107  static bool _is_selector_valid (Selector const & selector);
108 
110  static std::string _tag_to_string(Tag const & tag, bool numerical_tag);
111 
113  void _from_url(URL const & url);
114 
116  URL _generate_url(bool numerical_tags=false);
117 
118 };
119 
120 }
121 
122 }
123 
124 
125 #endif // _1cd2d27d_2d97_405b_b9d5_4104210e543a
odil::operator==
bool operator==(Value::DataSets const &left, Value::DataSets const &right)
Equality test.
odil
Definition: Association.h:23
ODIL_API
#define ODIL_API
Definition: odil.h:27
Utils.h
odil.h
odil::operator!=
bool operator!=(Value::DataSets const &left, Value::DataSets const &right)
Difference test.
Tag.h
URL.h
HTTPRequest.h
Selector.h
DataSet.h
odil::webservices::Representation
Representation
Data representation for DICOM requests and responses.
Definition: Utils.h:44