gdcmBaseQuery.h
Go to the documentation of this file.
/*=========================================================================
*
* 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
};
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);
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
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