GDCM 3.2.1

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