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 
31 
34 {
35 public:
37  QIDORSRequest(URL const & base_url);
38 
40  QIDORSRequest(HTTPRequest const & request);
41 
43  ~QIDORSRequest() = default;
44 
46  bool operator==(QIDORSRequest const & other) const;
47 
49  bool operator!=(QIDORSRequest const & other) const;
50 
52  URL const & get_base_url() const;
53 
55  void set_base_url(URL const & url);
56 
58  std::string const & get_media_type() const;
59 
61  Representation const & get_representation() const;
62 
64  URL const & get_url () const;
65 
67  Selector const & get_selector() const;
68 
70  DataSet const & get_query_data_set() const;
71 
73  std::set< std::vector < odil::Tag> > const & get_includefields() const;
74 
76  bool get_fuzzymatching() const;
77 
79  int get_limit() const;
80 
82  int get_offset() const;
83 
85  HTTPRequest get_http_request() const;
86 
88  void request_datasets(
89  Representation representation, Selector const & selector,
90  DataSet const & query, bool fuzzymatching = false,
91  int limit = -1, int offset = 0, bool numerical_tags = false);
92 
93 
94 private:
95  URL _base_url;
96 
97  // media_type accepted :
98  // -multipart/related; type="application/dicom+xml"
99  // -application/dicom+json (default)
100  std::string _media_type;
101  Representation _representation;
102  URL _url;
103  Selector _selector;
104  DataSet _query_data_set;
105 
106  bool _fuzzymatching;
107  int _limit; // maximum number of results the origin server shall return.
108  int _offset; // number of results the origin server shall skip before the first returned result.
109 
111  static bool _is_selector_valid (Selector const & selector);
112 
114  static std::string _tag_to_string(odil::Tag const & tag, bool numerical_tag);
115 
117  static std::tuple<URL, URL, Selector, DataSet, bool, int /*offset*/, int /*limit*/ >
118  _split_full_url(URL const & url);
119 
121  static URL _generate_url(URL const & base_url, Selector const & selector, DataSet const & query,
122  bool fuzzymatching = false, int limit = -1,
123  int offset = 0, bool numerical_tags = false);
124 
125 };
126 
127 }
128 
129 }
130 
131 
132 #endif // _1cd2d27d_2d97_405b_b9d5_4104210e543a
HTTP request.
Definition: HTTPRequest.h:25
DICOM Data set.
Definition: DataSet.h:29
Definition: Association.h:24
Uniform resource locator.
Definition: URL.h:23
A DICOM element tag.
Definition: Tag.h:24
#define ODIL_API
Definition: odil.h:28
QIDO-RS request generator and parser.
Definition: QIDORSRequest.h:33
Representation
Data representation for DICOM requests and responses.
Definition: Utils.h:35
Target (in the DICOM data model) of the request.
Definition: Selector.h:26