DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Private Member Functions | Private Attributes | List of all members
CodeWithModifiers Class Reference

Code with Modifier(s). More...

Inheritance diagram for CodeWithModifiers:

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

## Private Member Functions
| CodeWithModifiers ()
| Private undefined default constructor.

## Private Attributes
OFVector< CodeSequenceMacro * > | m_Modifiers
| Items of Modifier Code Sequence.
OFString | m_ModifierType
| Type 1,2,3,1C or 2C.
OFString | m_ModifierVM
| 1, 1-n, 2-2n, ...
DcmTagKey | m_CodeModifierSeq
| The sequence tag key that contains the modifier codes.

## 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. More...
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. More...
Protected Member Functions inherited from CodeSequenceMacro
void | deleteUnusedCodeValues (const DcmTagKey &keepTag)
| Deletes all out of the the following list of tags: Code Value, Long Code Value and URN Code Value. More...
Protected Attributes inherited from IODComponent
OFshared_ptr< DcmItem > | m_Item
| Shared pointer to the data handled by this class. More...
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. More...

## Detailed Description

Code with Modifier(s).

Represents the combination of a Code Sequence Macro that is amended by a Modifier Code Sequence with one or more items. The VM and requirement type of the Modifier Code Sequence can be configured, as well as the tag of the sequence holding the modifiers (default: Modifier Code Sequence). Overall, the class reads and write the following structure from an item:

Coding Scheme Designator, 1, 1C Coding Scheme Version, 1, 1C Code Value, 1, 1C Code Meaning, 1, 1C Modifier Code Sequence, VM, requirement type

> Code Sequence Macro

Note that the Code Sequence Macro does not support Long Code Value and URN Code Value, so that Coding Scheme Designator and Code Value are handled as type 1 (and not 1C as denoted now in the standard and above).

## Constructor & Destructor Documentation

## ◆ CodeWithModifiers() [1/2]

CodeWithModifiers::CodeWithModifiers | ( | const OFString & | modifierType,
|  | const OFString & | modifierVM = `"1-n"`,
|  | const DcmTagKey & | modifierSeq = `DCM_ModifierCodeSequence`
| ) |  |

Constructor.

Parameters

  modifierType | Denotes type of Modifier Code Sequence (i.e. 1, 1C, 2, 2C or 3)
  modifierVM | Denotes how many items are allowed in the Modifier Code Sequence
  modifierSeq | Tag of the sequence that holds the modifier codes. The default is the Modifier Code Sequence.

## ◆ CodeWithModifiers() [2/2]

CodeWithModifiers::CodeWithModifiers | ( | const CodeWithModifiers & | rhs | ) |

Copy constructor, performs deep copy.

Parameters

  rhs | The component to be copied from

## Member Function Documentation

## ◆ addModifier()

virtual OFCondition CodeWithModifiers::addModifier | ( | const CodeSequenceMacro & | modifier | ) |
| virtual

Adds modifier code.

Parameters

  modifier | The code to be added

Returns
  EC_Normal if adding was successful, error otherwise

## ◆ check()

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

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

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 CodeSequenceMacro.

## ◆ clearData()

void CodeWithModifiers::clearData | ( |  | ) |
| virtual

Clear all attributes from the data that are handled by this component.

An attribute is considered belonging to the module if there are rules marked as belonging to this module via the rule's module name.

Reimplemented from IODComponent.

## ◆ compare()

virtual int CodeWithModifiers::compare | ( | const IODComponent & | rhs | ) | const
| virtual

Comparison operator for IOD Components.

Parameters

  rhs | The right hand side of the comparison

Returns
  0, if the given object is equal to this object, other value otherwise

Reimplemented from IODComponent.

## ◆ getModifier()

virtual CodeSequenceMacro* CodeWithModifiers::getModifier | ( | const size_t | index = `0` | ) |
| virtual

Get modifier code denoted by index.

Parameters

  index | Index of modifier code to get (first modifier = 0)

Returns
  Code if modifier with index exists, NULL otherwise

## ◆ getName()

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

Get name of component.

Returns
  Name of the component

Reimplemented from CodeSequenceMacro.

## ◆ getRules()

OFshared_ptr<IODRules> CodeWithModifiers::getRules | ( |  | ) |
| inline

Get rules handled by this module.

Returns
  The rules

References IODComponent::m_Rules.

## ◆ operator=()

CodeWithModifiers& CodeWithModifiers::operator= | ( | const CodeWithModifiers & | rhs | ) |

Assignment operator, performs deep copy.

Parameters

  rhs | The component to be assigned from

Returns
  Reference to this object

## ◆ read()

virtual OFCondition CodeWithModifiers::read | ( | DcmItem & | source,
|  | const OFBool | clearOldData = `OFTrue`
| ) |  |
| virtual

Read attributes from given item into this class.

Parameters

  source | The source to read from
  clearOldData | If OFTrue, old data is cleared before reading. Otherwise old data is overwritten (or amended)

Returns
  EC_Normal if reading was successful, error otherwise

Reimplemented from IODComponent.

## ◆ write()

virtual OFCondition CodeWithModifiers::write | ( | DcmItem & | destination | ) |
| virtual

Write attributes from this class into given item.

Parameters

  destination | The item to write to

Returns
  EC_Normal if writing was successful, error otherwise

Reimplemented from IODComponent.

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

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

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1