Odil
A C++11 library for the DICOM standard
STOWRSRequest.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 _920fb954_a579_47a3_8288_21ea1a01f81d
10 #define _920fb954_a579_47a3_8288_21ea1a01f81d
11 
12 #include <vector>
13 
14 #include <boost/uuid/random_generator.hpp>
15 #include <boost/uuid/uuid.hpp>
16 
17 #include "odil/DataSet.h"
18 #include "odil/odil.h"
19 #include "odil/registry.h"
23 #include "odil/webservices/Utils.h"
24 #include "odil/webservices/URL.h"
25 
26 namespace odil
27 {
28 
29 namespace webservices
30 {
32 class ODIL_API STOWRSRequest
33 {
34 
35 public:
37  STOWRSRequest(URL const & base_url);
38 
40  STOWRSRequest(HTTPRequest const & request);
41 
43  bool operator==(STOWRSRequest const & other) const;
44 
46  bool operator!=(STOWRSRequest const & other) const;
47 
49  ~STOWRSRequest()=default;
50 
52  URL const & get_base_url() const;
53 
55  void set_base_url(URL const & url);
56 
58  std::string const & get_transfer_syntax() const;
59 
61  void set_transfer_syntax(std::string const & transfer_syntax);
62 
64  std::string const & get_media_type() const;
65 
67  Representation const & get_representation() const;
68 
70  URL const & get_url() const;
71 
73  Selector const & get_selector() const;
74 
76  Value::DataSets const & get_data_sets() const;
77 
79  Value::DataSets & get_data_sets();
80 
88  void request_dicom(
89  Value::DataSets const & data_sets, Selector const & selector,
90  Representation const & representation,
91  std::string const & transfer_syntax=registry::ExplicitVRLittleEndian);
92 
94  HTTPRequest get_http_request() const;
95 
96 private:
98  typedef std::map<std::string, Value::Binary::value_type> BulkMap;
99 
100  URL _base_url;
101  std::string _transfer_syntax;
102  Selector _selector;
103  URL _url;
104  std::string _media_type;
105 
106  Representation _representation; // Available request representations : DICOM - DICOM_XML - DICOM_JSON
107  Value::DataSets _data_sets;
108 
110  static bool _is_selector_valid (Selector const & selector);
111 
113  static std::string _media_type_from_transfer_syntax(
114  std::string const & transfer_syntax);
115 
117  static void _extract_bulk_data(
118  std::shared_ptr<DataSet> data_set, std::vector<BulkData> & bulk_data);
119 
124  static void _restore_data_set(
125  std::shared_ptr<DataSet> data_set, BulkMap & bulk_map);
126 };
127 
128 }
129 
130 }
131 
132 #endif // _920fb954_a579_47a3_8288_21ea1a01f81d
odil::operator==
bool operator==(Value::DataSets const &left, Value::DataSets const &right)
Equality test.
odil::webservices::HTTPRequest
HTTP request.
Definition: HTTPRequest.h:34
odil
Definition: Association.h:23
ODIL_API
#define ODIL_API
Definition: odil.h:27
odil::registry::ExplicitVRLittleEndian
const std::string ExplicitVRLittleEndian("1.2.840.10008.1.2.1")
odil::webservices::URL
Uniform resource locator.
Definition: URL.h:34
Utils.h
odil.h
odil::webservices::Selector
Target (in the DICOM data model) of the request.
Definition: Selector.h:35
BulkData.h
odil::operator!=
bool operator!=(Value::DataSets const &left, Value::DataSets const &right)
Difference test.
URL.h
odil::webservices::STOWRSRequest
STOW-RS request generator and parser.
Definition: STOWRSRequest.h:41
odil::Value::DataSets
std::vector< std::shared_ptr< DataSet > > DataSets
Data sets container.
Definition: Value.h:64
registry.h
HTTPRequest.h
Selector.h
DataSet.h
odil::webservices::Representation
Representation
Data representation for DICOM requests and responses.
Definition: Utils.h:44