Odil
A C++11 library for the DICOM standard
WADORSRequest.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 _32b5f072_8ebb_4df1_925d_abd5f0535eb6
10 #define _32b5f072_8ebb_4df1_925d_abd5f0535eb6
11 
12 #include <string>
13 #include <vector>
14 
15 #include "odil/odil.h"
18 #include "odil/webservices/URL.h"
19 #include "odil/webservices/Utils.h"
20 
21 namespace odil
22 {
23 
24 namespace webservices
25 {
26 
29 {
30 public:
33  URL const & base_url, std::string const & transfer_syntax="",
34  std::string const & character_set="",
35  bool include_media_type_in_query=false,
36  bool include_character_set_in_query=false);
37 
39  WADORSRequest(HTTPRequest const & request);
40 
42  bool operator==(WADORSRequest const & other) const;
43 
45  bool operator!=(WADORSRequest 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_transfer_syntax() const;
55 
57  void set_transfer_syntax(std::string const & transfer_syntax);
58 
60  std::string const & get_character_set() const;
61 
63  void set_character_set(std::string const & character_set);
64 
66  bool get_include_media_type_in_query() const;
67 
69  void set_include_media_type_in_query(bool include_media_type_in_query);
70 
72  bool get_include_character_set_in_query() const;
73 
75  void set_include_character_set_in_query(bool include_charcter_set_in_query);
76 
78  Type get_type() const;
79 
81  Selector const & get_selector() const;
82 
83 
85  URL const & get_url() const;
86 
88  std::string const & get_media_type() const;
89 
91  Representation const & get_representation() const;
92 
94  void request_dicom(
95  Representation representation, Selector const & selector);
96 
98  void request_bulk_data(Selector const & selector);
99 
101  void request_bulk_data(URL const & url);
102 
104  void request_pixel_data(
105  Selector const & selector,
106  std::string const & media_type="application/octet-stream");
107 
109  HTTPRequest get_http_request() const;
110 
111 private:
112  URL _base_url;
113  std::string _transfer_syntax;
114  std::string _character_set;
115  bool _include_media_type_in_query;
116  bool _include_character_set_in_query;
117 
118  Selector _selector;
119  URL _url;
120  std::string _media_type;
121  Representation _representation;
122  Type _type;
123 
125  static std::pair<URL, Selector> _split_full_url(URL const & url);
126 
128  static bool _is_selector_valid(Selector const & selector);
129 };
130 
131 }
132 
133 }
134 
135 #endif // _32b5f072_8ebb_4df1_925d_abd5f0535eb6
HTTP request.
Definition: HTTPRequest.h:25
Definition: Association.h:24
WADO-RS request generator and parser.
Definition: WADORSRequest.h:28
Uniform resource locator.
Definition: URL.h:23
#define ODIL_API
Definition: odil.h:28
Type
Type of the request or response (use for WADO & QIDO).
Definition: Utils.h:26
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