DCMTK: CodeSequenceMacro Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
CodeSequenceMacro Class Reference

Class representing a Code Sequence Macro. More...

Inheritance diagram for CodeSequenceMacro:

## Public Member Functions
| CodeSequenceMacro (OFshared_ptr< DcmItem > item, OFshared_ptr< IODRules > rules, IODComponent *parent=NULL)
| Constructor.
| CodeSequenceMacro (IODComponent *parent=NULL)
| Constructor.
| CodeSequenceMacro (const CodeSequenceMacro &rhs)
| Copy Constructor, performs deep copy.
| CodeSequenceMacro (OFshared_ptr< DcmItem > item, OFshared_ptr< IODRules > rules, IODComponent *parent, const OFString &codeValue, const OFString &codingSchemeDesignator, const OFString &codeMeaning, const OFString &codingSchemeVersion="")
| Convenience constructor to set initial values.
| CodeSequenceMacro (const OFString &codeValue, const OFString &codingSchemeDesignator, const OFString &codeMeaning, const OFString &codingSchemeVersion="", IODComponent *parent=NULL)
| Convenience constructor to set initial values.
virtual void | resetRules ()
| Resets rules to their original values.
virtual OFString | getName () const
| Get name of macro.
virtual | ~CodeSequenceMacro ()
| Virtual Destructor.
virtual OFCondition | check (const OFBool quiet=OFFalse)
| Check whether this component's data satisfies the underlying rules.
virtual OFCondition | getCodeValue (OFString &value, const signed long pos=0, const OFBool autoTag=OFTrue)
| Get Code Value, URL Code Value or Long Code Value.
virtual OFCondition | getURNCodeValue (OFString &value, const signed long pos=0)
| Get URN Code Value.
virtual OFCondition | getLongCodeValue (OFString &value, const signed long pos=0)
| Get Long Code Value.
virtual OFCondition | getCodingSchemeDesignator (OFString &value, const signed long pos=0)
| Get Coding Scheme Designator.
virtual OFCondition | getCodingSchemeVersion (OFString &value, const signed long pos=0)
| Get Coding Scheme Version.
virtual OFCondition | getCodeMeaning (OFString &value, const signed long pos=0)
| Get Code Meaning.
virtual OFBool | empty ()
| Returns whether code is empty, i.e.
virtual OFCondition | setCodeValue (const OFString &value, const OFBool checkValue=OFTrue, const OFBool autoTag=OFTrue)
| Set Code Value.
virtual OFCondition | setURNCodeValue (const OFString &value, const OFBool checkValue=OFTrue)
| Set URN Code Value.
virtual OFCondition | setLongCodeValue (const OFString &value, const OFBool checkValue=OFTrue)
| Set Long Code Value.
virtual OFCondition | setCodingSchemeDesignator (const OFString &value, const OFBool checkValue=OFTrue)
| Set Coding Scheme Designator.
virtual OFCondition | setCodingSchemeVersion (const OFString &value, const OFBool checkValue=OFTrue)
| Set Coding Scheme Version.
virtual OFCondition | setCodeMeaning (const OFString &value, const OFBool checkValue=OFTrue)
| Set Code Meaning.
virtual OFCondition | set (const OFString &value, const OFString &scheme, const OFString &meaning, const OFString &schemeVersion="", const OFBool checkValue=OFTrue, const OFBool autoTag=OFTrue)
| Set all values in this class conveniently.
virtual OFString | toString ()
| Returns string representation reflecting the coded value.
Public Member Functions inherited from IODComponent
| IODComponent (OFshared_ptr< DcmItem > item, OFshared_ptr< IODRules > rules, IODComponent *parent=NULL)
| Constructor.
| IODComponent (IODComponent *parent=NULL)
| Constructor, creates rules and item from scratch.
IODComponent & | operator= (const IODComponent &rhs)
| Assignment operator, copies contained item and rule set from rhs to "this" attribute set.
| IODComponent (const IODComponent &rhs)
| Copy constructor, copies reference to contained item and rule set to "this" attribute set.
virtual | ~IODComponent ()
| Virtual Destructor.
void | clearData ()
| Clear all attributes from the data that are handled by this module.
virtual void | inventMissing ()
| Set missing values by inventing "default values".
OFshared_ptr< IODRules > | getRules ()
| Get rules handled by this module.
virtual void | makeOptional ()
| Make component optional by turning all attributes requirement types of it to type 3.
DcmItem & | getData ()
| Get the data handled by this module.
virtual OFCondition | read (DcmItem &source, const OFBool clearOldData=OFTrue)
| Read attributes from given item into this class.
virtual OFCondition | write (DcmItem &destination)
| Write attributes from this class into given item.
virtual int | compare (const IODComponent &rhs) const
| Comparison operator for IOD Components.
virtual bool | getValueCheckOnWrite () const
| Get whether attribute value errors will be handled as errors on writing.
virtual void | setValueCheckOnWrite (const OFBool checkValue)
| Set whether attribute values should be checked on writing, i.e.

## Protected Member Functions
void | deleteUnusedCodeValues (const DcmTagKey &keepTag)
| Deletes all out of the the following list of tags: Code Value, Long Code Value and URN Code Value.

## Additional Inherited Members
Static Public Member Functions inherited from IODComponent
static OFCondition | read (DcmItem &source, IODRules &rules, DcmItem &destination, const OFString &componentName)
| Static helper function that reads attributes from given item into destination item, as determined by the provided rules and component name.
static OFCondition | write (DcmItem &source, IODRules &rules, DcmItem &destination, const OFString &componentName, const OFBool checkValue)
| Static helper function that writes attributes from given item into destination item, as determined by the provided rules and component name.
Protected Attributes inherited from IODComponent
OFshared_ptr< DcmItem > | m_Item
| Shared pointer to the data handled by this class.
OFshared_ptr< IODRules > | m_Rules
| Rules describing the attributes governed by this class.
IODComponent * | m_Parent
| The parent component (may be NULL) of this class.
OFBool | m_CheckValueOnWrite
| Denotes whether attribute values should be checked on writing, i.e.

## Detailed Description

Class representing a Code Sequence Macro.

## Constructor & Destructor Documentation

## ◆ CodeSequenceMacro() [1/5]

CodeSequenceMacro::CodeSequenceMacro | ( | OFshared_ptr< DcmItem > | item,
|  | OFshared_ptr< IODRules > | rules,
|  | IODComponent * | parent = NULL )

Constructor.

Parameters

  item | The item to be used for data storage. If NULL, the class creates an empty data container.
  rules | The rule set for this class. If NULL, the class creates one from scratch and adds its values.
  parent | The parent of the IOD component (NULL if none or unknown)

References IODComponent::IODComponent().

Referenced by CodeSequenceMacro(), CodeWithModifiers::addModifier(), and CodeWithModifiers::getModifier().

## ◆ CodeSequenceMacro() [2/5]

CodeSequenceMacro::CodeSequenceMacro | ( | IODComponent * | parent = NULL | ) |

Constructor.

Parameters

  parent | The parent of the IOD component (NULL if none or unknown)

References IODComponent::IODComponent().

## ◆ CodeSequenceMacro() [3/5]

CodeSequenceMacro::CodeSequenceMacro | ( | const CodeSequenceMacro & | rhs | ) |

Copy Constructor, performs deep copy.

Parameters

  rhs | The parent of the IOD component (NULL if none or unknown)

References CodeSequenceMacro().

## ◆ CodeSequenceMacro() [4/5]

CodeSequenceMacro::CodeSequenceMacro | ( | OFshared_ptr< DcmItem > | item,
|  | OFshared_ptr< IODRules > | rules,
|  | IODComponent * | parent,
|  | const OFString & | codeValue,
|  | const OFString & | codingSchemeDesignator,
|  | const OFString & | codeMeaning,
|  | const OFString & | codingSchemeVersion = "" )

Convenience constructor to set initial values.

Parameters

  item | The item to be used for data storage. If NULL, the class creates an empty data container.
  rules | The rule set for this class. If NULL, the class creates one from scratch and adds its values.
  parent | The parent of the IOD component (NULL if none or unknown)
  codeValue | The code value
  codingSchemeDesignator | The coding scheme designator
  codeMeaning | The code meaning
  codingSchemeVersion | The coding scheme version (might be empty if coding scheme is unique)

References IODComponent::IODComponent().

## ◆ CodeSequenceMacro() [5/5]

CodeSequenceMacro::CodeSequenceMacro | ( | const OFString & | codeValue,
|  | const OFString & | codingSchemeDesignator,
|  | const OFString & | codeMeaning,
|  | const OFString & | codingSchemeVersion = "",
|  | IODComponent * | parent = NULL )

Convenience constructor to set initial values.

Parameters

  codeValue | The code value
  codingSchemeDesignator | The coding scheme designator
  codeMeaning | The code meaning
  codingSchemeVersion | The coding scheme version (might be empty if coding scheme is unique)
  parent | The parent of the IOD component (NULL if none or unknown)

References IODComponent::IODComponent().

## Member Function Documentation

## ◆ check()

virtual OFCondition CodeSequenceMacro::check | ( | const OFBool | quiet = OFFalse | ) |
| virtual

Check whether this component's data satisfies the underlying rules.

In this case, it is only checked that Designator, Value and Meaning of the code are set.

Parameters

  quiet | If OFTrue, not error / warning messages will be produced. Only the returned error code will indicate error or OK. Per default, logging output is produced (OFFalse).

Returns
  EC_Normal if rules are satisfied, error otherwise

Reimplemented from IODComponent.

Reimplemented in CodeWithModifiers.

## ◆ deleteUnusedCodeValues()

void CodeSequenceMacro::deleteUnusedCodeValues | ( | const DcmTagKey & | keepTag | ) |
| protected

Deletes all out of the the following list of tags: Code Value, Long Code Value and URN Code Value.

Parameters

  keepTag | The tag to be keep

## ◆ empty()

virtual OFBool CodeSequenceMacro::empty | ( |  | ) |
| virtual

Returns whether code is empty, i.e.

no component of the Code Sequence Macro is set. This can be used in order to find out whether someone actually wanted to fill in a valid code as opposed of leaving it unset.

Returns
  OFTrue if no component of this class is set, OFFalse otherwise.

## ◆ getCodeMeaning()

virtual OFCondition CodeSequenceMacro::getCodeMeaning | ( | OFString & | value,
|  | const signed long | pos = 0 )
| virtual

Get Code Meaning.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getCodeValue()

virtual OFCondition CodeSequenceMacro::getCodeValue | ( | OFString & | value,
|  | const signed long | pos = 0,
|  | const OFBool | autoTag = OFTrue )
| virtual

Get Code Value, URL Code Value or Long Code Value.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components
  autoTag | If OFTrue, this method will consider tags Code Value (0008,0100) URN Code Code Value (0008,0120) and Long Code Value (0008,0119) and in this order and will return once it finds that tag, even if the related value is empty. If OFFalse, getCodeValue() only returns the value found in Code Value (0008,0100).

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getCodingSchemeDesignator()

virtual OFCondition CodeSequenceMacro::getCodingSchemeDesignator | ( | OFString & | value,
|  | const signed long | pos = 0 )
| virtual

Get Coding Scheme Designator.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getCodingSchemeVersion()

virtual OFCondition CodeSequenceMacro::getCodingSchemeVersion | ( | OFString & | value,
|  | const signed long | pos = 0 )
| virtual

Get Coding Scheme Version.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getLongCodeValue()

virtual OFCondition CodeSequenceMacro::getLongCodeValue | ( | OFString & | value,
|  | const signed long | pos = 0 )
| virtual

Get Long Code Value.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getName()

virtual OFString CodeSequenceMacro::getName | ( |  | ) | const
| virtual

Get name of macro.

Returns
  Name of the component ("CodeSequenceMacro")

Implements IODComponent.

Reimplemented in CodeWithModifiers.

## ◆ getURNCodeValue()

virtual OFCondition CodeSequenceMacro::getURNCodeValue | ( | OFString & | value,
|  | const signed long | pos = 0 )
| virtual

Get URN Code Value.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ set()

virtual OFCondition CodeSequenceMacro::set | ( | const OFString & | value,
|  | const OFString & | scheme,
|  | const OFString & | meaning,
|  | const OFString & | schemeVersion = "",
|  | const OFBool | checkValue = OFTrue,
|  | const OFBool | autoTag = OFTrue )
| virtual

Set all values in this class conveniently.

Parameters

  value | Code Value to set
  scheme | Coding Scheme Designator to set
  meaning | Code Meaning to set
  schemeVersion | The Coding Scheme Designator version to set (optional)
  checkValue | If OFTrue, VM and VR of values is checked
  autoTag | If OFTrue, it is determined automatically if tag Code Value, URN Code Value or Long Code Value is used. If OFFalse, the classic Code Value is used. Default is OFTrue.

Returns
  EC_Normal if setting was successful, error otherwise

## ◆ setCodeMeaning()

virtual OFCondition CodeSequenceMacro::setCodeMeaning | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set Code Meaning.

Parameters

  value | The value to set
  checkValue | If OFTrue, VM and VR of value are checked

Returns
  EC_Normal if setting was successful, error otherwise

## ◆ setCodeValue()

virtual OFCondition CodeSequenceMacro::setCodeValue | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue,
|  | const OFBool | autoTag = OFTrue )
| virtual

Set Code Value.

Parameters

  value | The value to set
  checkValue | If OFTrue, VM and VR of value are checked
  autoTag | If OFTrue, it is determined automatically if tag Code Value, URN Code Value or Long Code Value is used. If OFFalse, the classic Code Value is used. Default is OFTrue.

Returns
  EC_Normal if setting was successful, error otherwise

## ◆ setCodingSchemeDesignator()

virtual OFCondition CodeSequenceMacro::setCodingSchemeDesignator | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set Coding Scheme Designator.

Parameters

  value | The value to set
  checkValue | If OFTrue, VM and VR of value are checked

Returns
  EC_Normal if setting was successful, error otherwise

## ◆ setCodingSchemeVersion()

virtual OFCondition CodeSequenceMacro::setCodingSchemeVersion | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set Coding Scheme Version.

Parameters

  value | The value to set
  checkValue | If OFTrue, VM and VR of value are checked

Returns
  EC_Normal if setting was successful, error otherwise

## ◆ setLongCodeValue()

virtual OFCondition CodeSequenceMacro::setLongCodeValue | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set Long Code Value.

Parameters

  value | The value to set
  checkValue | If OFTrue, VM and VR of value are checked

Returns
  EC_Normal if setting was successful, error otherwise

## ◆ setURNCodeValue()

virtual OFCondition CodeSequenceMacro::setURNCodeValue | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set URN Code Value.

Parameters

  value | The value to set
  checkValue | If OFTrue, VM and VR of value are checked

Returns
  EC_Normal if setting was successful, error otherwise

## ◆ toString()

virtual OFString CodeSequenceMacro::toString | ( |  | ) |
| virtual

Returns string representation reflecting the coded value.

Mostly useful for debugging purposes.

Returns
  String representing the coded value

The documentation for this class was generated from the following file:

- dcmiod/include/dcmtk/dcmiod/iodmacro.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2