fw4spl
container/DicomCodedAttribute.hpp
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 #ifndef __FWGDCMIO_CONTAINER_DICOMCODEDATTRIBUTE_HPP__
8 #define __FWGDCMIO_CONTAINER_DICOMCODEDATTRIBUTE_HPP__
9 
10 #include "fwGdcmIO/config.hpp"
11 
12 #include <gdcmSegmentHelper.h>
13 
14 #include <iostream>
15 #include <string>
16 
17 namespace fwGdcmIO
18 {
19 namespace container
20 {
21 
28 class FWGDCMIO_CLASS_API DicomCodedAttribute
29 {
30 public:
38  FWGDCMIO_API DicomCodedAttribute(const std::string& codeValue = "",
39  const std::string& codingSchemeDesignator = "",
40  const std::string& codeMeaning = "",
41  const std::string& codingSchemeVersion = "");
42 
44  FWGDCMIO_API bool isEmpty() const;
45 
49  FWGDCMIO_API bool operator==(const DicomCodedAttribute& other) const;
52  FWGDCMIO_API friend std::ostream& operator<< (std::ostream& os, const DicomCodedAttribute& attribute)
54  {
55  os << "\\\"" << attribute.m_codeValue << "\\\" ";
56  os << "\\\"" << attribute.m_codingSchemeDesignator << "\\\" ";
57  os << "\\\"" << attribute.m_codeMeaning << "\\\" ";
58  os << "\\\"" << attribute.m_codingSchemeVersion << "\\\" ";
59  return os;
60  }
61 
63  const std::string getCodeValue() const
64  {
65  return m_codeValue;
66  }
67 
69  void setCodeValue(const std::string& codeValue)
70  {
71  m_codeValue = codeValue;
72  }
73 
75  const std::string getCodingSchemeDesignator() const
76  {
77  return m_codingSchemeDesignator;
78  }
79 
81  void setCodingSchemeDesignator(const std::string& codingSchemeDesignator)
82  {
83  m_codingSchemeDesignator = codingSchemeDesignator;
84  }
85 
87  const std::string getCodeMeaning() const
88  {
89  return m_codeMeaning;
90  }
91 
93  void setCodeMeaning(const std::string& codeMeaning)
94  {
95  m_codeMeaning = codeMeaning;
96  }
97 
99  const std::string getCodingSchemeVersion() const
100  {
101  return m_codingSchemeVersion;
102  }
103 
105  void setCodingSchemeVersion(const std::string& codingSchemeVersion)
106  {
107  m_codingSchemeVersion = codingSchemeVersion;
108  }
109 
111  FWGDCMIO_API ::gdcm::SegmentHelper::BasicCodedEntry toGDCMFormat() const;
112 
113 private:
115  std::string m_codeValue;
116 
118  std::string m_codingSchemeDesignator;
119 
121  std::string m_codeMeaning;
122 
124  std::string m_codingSchemeVersion;
125 
126 };
127 
128 } //namespace container
129 } //namespace fwGdcmIO
130 
131 #endif /* __FWGDCMIO_CONTAINER_DICOMCODEDATTRIBUTE_HPP__ */
const std::string getCodingSchemeVersion() const
Get coding scheme version.
const std::string getCodeMeaning() const
Get code meaning.
void setCodeValue(const std::string &codeValue)
Set code value.
const std::string getCodingSchemeDesignator() const
Get coding scheme designator.
void setCodingSchemeDesignator(const std::string &codingSchemeDesignator)
Set coding scheme designator.
void setCodeMeaning(const std::string &codeMeaning)
Set code meaning.
const std::string getCodeValue() const
Get code value.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
This class represents a DICOM basic coded entry. It stores the four mains attributes : Code Value...
void setCodingSchemeVersion(const std::string &codingSchemeVersion)
Set coding scheme version.