1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef GDCMBASEQUERY_H
#define GDCMBASEQUERY_H
#include "gdcmDataSet.h"
#include "gdcmUIDs.h"
#include "gdcmObject.h"
namespace gdcm
{
class QueryFactory;
class DictEntry;
enum ENQueryType
{
eCreateMMPS = 0,
eSetMMPS
};
/**
* \brief BaseQuery
* \details contains: a baseclass which will produce a dataset for all dimse messages
*
*
*/
class GDCM_EXPORT BaseQuery : public Object
{
//these four classes contain the required, unique, and optional tags from the standard.
//used both to list the tags as well as to validate a dataset, if ever we were to do so.
protected:
DataSet mDataSet;
friend class QueryFactory;
BaseQuery();
std::string mSopInstanceUID;
void SetSearchParameter(const Tag& inTag, const DictEntry& inDictEntry, const std::string& inValue);
bool ValidDataSet( const DataSet & dataSetToValid, const DataSet & dataSetReference ) const ;
public:
~BaseQuery() override;
void SetSearchParameter(const Tag& inTag, const std::string& inValue);
void SetSearchParameter(const std::string& inKeyword, const std::string& inValue);
const std::ostream &WriteHelpFile(std::ostream &os);
//this function allows writing of the query to disk for storing for future use
//virtual in case it needs to be overridden
//returns false if the operation failed
bool WriteQuery(const std::string& inFileName);
/// Set/Get the internal representation of the query as a DataSet
DataSet const & GetQueryDataSet() const;
DataSet & GetQueryDataSet();
void AddQueryDataSet(const DataSet & ds);
virtual bool ValidateQuery( bool inStrict = true ) const = 0;
virtual UIDs::TSName GetAbstractSyntaxUID() const = 0;
std::string GetSOPInstanceUID() const { return mSopInstanceUID ; }
void SetSOPInstanceUID( const std::string & iSopInstanceUID ) { mSopInstanceUID = iSopInstanceUID ; }
void Print(std::ostream &os) const override;
};
} // end namespace gdcm
#endif //GDCMBASEROOTQUERY_H