Odil
A C++11 library for the DICOM standard
QIDORSRequest.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 _1cd2d27d_2d97_405b_b9d5_4104210e543a
10#define _1cd2d27d_2d97_405b_b9d5_4104210e543a
11
12#include <string>
13#include <tuple>
14#include <vector>
15#include <set>
16
17#include "odil/DataSet.h"
18#include "odil/odil.h"
19#include "odil/Tag.h"
24
25namespace odil
26{
27
28namespace webservices
29{
30
33{
34public:
36 QIDORSRequest(URL const & base_url);
37
39 QIDORSRequest(HTTPRequest const & request);
40
42 bool operator==(QIDORSRequest const & other) const;
43
45 bool operator!=(QIDORSRequest 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_media_type() const;
55
58
60 URL const & get_url () const;
61
63 Selector const & get_selector() const;
64
66 std::shared_ptr<DataSet const> get_query_data_set() const;
67
69 std::set<std::vector<Tag>> const & get_includefields() const;
70
72 bool get_fuzzymatching() const;
73
75 int get_limit() const;
76
78 int get_offset() const;
79
82
85 Representation representation, Selector const & selector,
86 std::shared_ptr<DataSet> query, bool fuzzymatching=false,
87 int limit=-1, int offset=0, bool numerical_tags=false);
88
89private:
90 URL _base_url;
91 std::string _media_type;
92 Representation _representation;
93 URL _url;
94 Selector _selector;
95 std::shared_ptr<DataSet> _query_data_set;
96
97 bool _fuzzymatching;
99 int _limit;
104 int _offset;
105
107 static bool _is_selector_valid (Selector const & selector);
108
110 static std::string _tag_to_string(Tag const & tag, bool numerical_tag);
111
113 void _from_url(URL const & url);
114
116 URL _generate_url(bool numerical_tags=false);
117
118};
119
120}
121
122}
123
124
125#endif // _1cd2d27d_2d97_405b_b9d5_4104210e543a
A DICOM element tag.
Definition: Tag.h:25
HTTP request.
Definition: HTTPRequest.h:26
QIDO-RS request generator and parser.
Definition: QIDORSRequest.h:33
QIDORSRequest(HTTPRequest const &request)
Constructor.
void set_base_url(URL const &url)
Set the base URL; the query and fragment must be empty.
URL const & get_base_url() const
Return base_url.
std::string const & get_media_type() const
Return the media type.
Selector const & get_selector() const
brief Return the selector.
Representation const & get_representation() const
Return the representation.
bool operator==(QIDORSRequest const &other) const
Equality operator.
QIDORSRequest(URL const &base_url)
Constructor.
bool operator!=(QIDORSRequest const &other) const
Difference operator.
void request_datasets(Representation representation, Selector const &selector, std::shared_ptr< DataSet > query, bool fuzzymatching=false, int limit=-1, int offset=0, bool numerical_tags=false)
Prepare a qido request.
HTTPRequest get_http_request() const
Generate the associated HTTP request.
std::set< std::vector< Tag > > const & get_includefields() const
Return the wanted fields.
URL const & get_url() const
Return the url.
bool get_fuzzymatching() const
Return whether fuzzymatching is wanted or not.
int get_offset() const
Return the wanted offset.
std::shared_ptr< DataSet const > get_query_data_set() const
Return the dataSet containing the wanted attribute values.
int get_limit() const
Return the wanted limit.
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