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 {
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  std::vector<DataSet> const & get_data_sets() const;
77 
79  std::vector<DataSet> & get_data_sets();
80 
88  void request_dicom(std::vector<DataSet> const & data_sets, Selector const & selector,
89  Representation const & representation,
90  std::string const & transfer_syntax=odil::registry::ExplicitVRLittleEndian);
91 
93  HTTPRequest get_http_request() const;
94 
95 private:
96  URL _base_url;
97  std::string _transfer_syntax;
98  Selector _selector;
99  URL _url;
100  std::string _media_type;
101 
102  Representation _representation; // Available request representations : DICOM - DICOM_XML - DICOM_JSON
103  std::vector<DataSet> _data_sets;
104 
106  static bool _is_selector_valid (Selector const & selector);
107 
109  static std::string _media_type_from_transfer_syntax(std::string const & transfer_syntax);
110 
112  static std::pair <URL, Selector> _split_full_url (const URL& url);
113 
115  static void _extract_bulk_data( DataSet & data_set, std::vector<BulkData> & bulk_data);
116 
121  static void _restore_data_set(DataSet & data_set, std::map<std::string, std::string>& uuid_bulk_raw);
122 };
123 
124 }
125 
126 }
127 
128 #endif // _920fb954_a579_47a3_8288_21ea1a01f81d
HTTP request.
Definition: HTTPRequest.h:25
DICOM Data set.
Definition: DataSet.h:29
std::string const ExplicitVRLittleEndian("1.2.840.10008.1.2.1")
Definition: Association.h:24
Uniform resource locator.
Definition: URL.h:23
#define ODIL_API
Definition: odil.h:28
STOW-RS request generator and parser.
Definition: STOWRSRequest.h:32
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