Odil
A C++11 library for the DICOM standard
Loading...
Searching...
No Matches
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"
25
26namespace odil
27{
28
29namespace webservices
30{
33{
34
35public:
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
68
70 URL const & get_url() const;
71
73 Selector const & get_selector() const;
74
77
80
89 Value::DataSets const & data_sets, Selector const & selector,
90 Representation const & representation,
91 std::string const & transfer_syntax=registry::ExplicitVRLittleEndian);
92
95
96private:
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
std::vector< std::shared_ptr< DataSet > > DataSets
Data sets container.
Definition Value.h:60
HTTP request.
Definition HTTPRequest.h:26
STOW-RS request generator and parser.
Definition STOWRSRequest.h:33
~STOWRSRequest()=default
Destructor.
bool operator==(STOWRSRequest const &other) const
Equality operator.
URL const & get_base_url() const
Return base_url.
URL const & get_url() const
Return the url.
HTTPRequest get_http_request() const
Generate the associated HTTP request.
bool operator!=(STOWRSRequest const &other) const
Difference operator.
Value::DataSets const & get_data_sets() const
Get the response items.
void request_dicom(Value::DataSets const &data_sets, Selector const &selector, Representation const &representation, std::string const &transfer_syntax=registry::ExplicitVRLittleEndian)
Prepare a dicom request.
Value::DataSets & get_data_sets()
Modify the response items.
std::string const & get_media_type() const
Return the media type.
Selector const & get_selector() const
Return the selector.
void set_transfer_syntax(std::string const &transfer_syntax)
Set the transfer syntax.
STOWRSRequest(URL const &base_url)
Constructor which takes an URL as argument.
Representation const & get_representation() const
Return the representation.
std::string const & get_transfer_syntax() const
Return the transfer syntax.
void set_base_url(URL const &url)
Set the base url.
STOWRSRequest(HTTPRequest const &request)
Constructor which takes an HTTPRequest as argument.
Target (in the DICOM data model) of the request.
Definition Selector.h:27
Representation
Data representation for DICOM requests and responses.
Definition Utils.h:36
Definition Association.h:25
#define ODIL_API
Definition odil.h:28
Uniform resource locator.
Definition URL.h:26