DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
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.
| CodeWithModifiers (const CodeWithModifiers &rhs)
| Copy constructor, performs deep copy.
CodeWithModifiers & | operator= (const CodeWithModifiers &rhs)
| Assignment operator, performs deep copy.
virtual | ~CodeWithModifiers ()
| Virtual Destructor, frees memory.
void | clearData ()
| Clear all attributes from the data that are handled by this component.
virtual void | resetRules ()
| Resets rules to their original values.
OFshared_ptr< IODRules > | getRules ()
| Get rules handled by this module.
virtual OFString | getName () const
| Get name of component.
virtual CodeSequenceMacro * | getModifier (const size_t index=0)
| Get modifier code denoted by index.
virtual OFCondition | addModifier (const CodeSequenceMacro &modifier)
| Adds modifier code.
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 OFCondition | check (const OFBool quiet=OFFalse)
| Check whether this component's data satisfies the underlying rules.
virtual int | compare (const IODComponent &rhs) const
| Comparison operator for IOD Components.
Public Member Functions inherited from CodeSequenceMacro
| 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 | ~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.
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 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.

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

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.

Referenced by CodeWithModifiers(), and operator=().

## ◆ CodeWithModifiers() [2/2]

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

Copy constructor, performs deep copy.

Parameters

  rhs | The component to be copied from

References CodeWithModifiers().

## 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

References CodeSequenceMacro::CodeSequenceMacro().

## ◆ 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 | ( |  | ) |

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.

## ◆ 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.

References IODComponent::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

References CodeSequenceMacro::CodeSequenceMacro().

## ◆ 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

References CodeWithModifiers().

## ◆ 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 Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2