fw4spl
container/DicomCodedAttribute.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "fwGdcmIO/container/DicomCodedAttribute.hpp"
8 
9 namespace fwGdcmIO
10 {
11 namespace container
12 {
13 
14 //------------------------------------------------------------------------------
15 
16 DicomCodedAttribute::DicomCodedAttribute(const std::string& codeValue,
17  const std::string& codingSchemeDesignator,
18  const std::string& codeMeaning,
19  const std::string& codingSchemeVersion) :
20  m_codeValue(codeValue),
21  m_codingSchemeDesignator(codingSchemeDesignator),
22  m_codeMeaning(codeMeaning),
23  m_codingSchemeVersion(codingSchemeVersion)
24 {
25 }
26 
27 //------------------------------------------------------------------------------
28 
30 {
31  return m_codeValue.empty() &&
32  m_codingSchemeDesignator.empty() &&
33  m_codeMeaning.empty() &&
34  m_codingSchemeVersion.empty();
35 }
36 
37 //------------------------------------------------------------------------------
38 
40 {
41  return m_codeValue == other.m_codeValue &&
42  m_codingSchemeDesignator == other.m_codingSchemeDesignator &&
43  m_codeMeaning == other.m_codeMeaning &&
44  m_codingSchemeVersion == other.m_codingSchemeVersion;
45 }
46 
47 //------------------------------------------------------------------------------
48 
49 ::gdcm::SegmentHelper::BasicCodedEntry DicomCodedAttribute::toGDCMFormat() const
50 {
51  return ::gdcm::SegmentHelper::BasicCodedEntry(m_codeValue.c_str(),
52  m_codingSchemeDesignator.c_str(),
53  m_codingSchemeVersion.c_str(),
54  m_codeMeaning.c_str());
55 }
56 
57 //------------------------------------------------------------------------------
58 } //namespace container
59 } //namespace fwGdcmIO
FWGDCMIO_API bool isEmpty() const
Returns true if the attribute is empty.
FWGDCMIO_API::gdcm::SegmentHelper::BasicCodedEntry toGDCMFormat() const
Convert entry to GDCM format.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
FWGDCMIO_API DicomCodedAttribute(const std::string &codeValue="", const std::string &codingSchemeDesignator="", const std::string &codeMeaning="", const std::string &codingSchemeVersion="")
Constructor.
This class represents a DICOM basic coded entry. It stores the four mains attributes : Code Value...
FWGDCMIO_API bool operator==(const DicomCodedAttribute &other) const
Comparison operators overloading.