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 
67 
69  void set_include_media_type_in_query(bool include_media_type_in_query);
70 
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 
84  URL const & get_url() const;
85 
87  std::string const & get_media_type() const;
88 
91 
94  Representation representation, Selector const & selector);
95 
97  void request_bulk_data(Selector const & selector);
98 
100  void request_bulk_data(URL const & url);
101 
104  Selector const & selector,
105  std::string const & media_type="application/octet-stream");
106 
109 
110 private:
111  URL _base_url;
112  std::string _transfer_syntax;
113  std::string _character_set;
114  bool _include_media_type_in_query;
115  bool _include_character_set_in_query;
116 
117  Selector _selector;
118  URL _url;
119  std::string _media_type;
120  Representation _representation;
121  Type _type;
122 
124  static bool _is_selector_valid(Selector const & selector);
125 };
126 
127 }
128 
129 }
130 
131 #endif // _32b5f072_8ebb_4df1_925d_abd5f0535eb6
HTTP request.
Definition: HTTPRequest.h:26
Target (in the DICOM data model) of the request.
Definition: Selector.h:27
WADO-RS request generator and parser.
Definition: WADORSRequest.h:29
std::string const & get_transfer_syntax() const
Return the transfer syntax.
WADORSRequest(URL const &base_url, std::string const &transfer_syntax="", std::string const &character_set="", bool include_media_type_in_query=false, bool include_character_set_in_query=false)
Constructor.
bool operator!=(WADORSRequest const &other) const
Difference operator.
void set_character_set(std::string const &character_set)
Set the transfer syntax.
HTTPRequest get_http_request() const
Generate the associated HTTP request.
void set_include_media_type_in_query(bool include_media_type_in_query)
Set whether to include the media type in the URL query.
std::string const & get_character_set() const
Return the transfer syntax.
bool operator==(WADORSRequest const &other) const
Equality operator.
bool get_include_media_type_in_query() const
Return whether to include the media type in the URL query.
WADORSRequest(HTTPRequest const &request)
Constructor.
void set_base_url(URL const &url)
Set the base URL; the query and fragment must be empty.
void request_pixel_data(Selector const &selector, std::string const &media_type="application/octet-stream")
Prepare a pixel data request.
Selector const & get_selector() const
Return the selector.
void set_transfer_syntax(std::string const &transfer_syntax)
Set the transfer syntax.
Representation const & get_representation() const
Return the representation.
void request_bulk_data(URL const &url)
Prepare a bulk data request.
bool get_include_character_set_in_query() const
Return whether to include the character set in the URL query.
URL const & get_base_url() const
Return the base URL.
void request_bulk_data(Selector const &selector)
Prepare a bulk data request.
std::string const & get_media_type() const
Return the media type.
URL const & get_url() const
Return the URL.
void set_include_character_set_in_query(bool include_charcter_set_in_query)
Set whether to include the character_set in the URL query.
Type get_type() const
Return the query type.
void request_dicom(Representation representation, Selector const &selector)
Prepare a DICOM request.
Representation
Data representation for DICOM requests and responses.
Definition: Utils.h:36
Type
Type of the request or response (use for WADO & QIDO).
Definition: Utils.h:27
Definition: Association.h:25
#define ODIL_API
Definition: odil.h:28
Uniform resource locator.
Definition: URL.h:26