DCMTK Version 3.7.1
OFFIS DICOM Toolkit
Loading...
Searching...
No Matches
IODRule Class Reference

Class representing a single rule, that refers to a single attribute. More...

Public Member Functions

 IODRule (const DcmTagKey &key, const OFString &VM, const OFString &type, const OFString &module, const DcmIODTypes::IOD_IE ie, const OFString &defaultValue="", const OFString &privateCreator="")
 Constructor to create a new attribute rule.
IODRule * clone ()
 Return deep copy of this object.
virtual DcmTagKey getTagKey () const
 Get tag key of the attribute rule.
virtual OFString getPrivateCreator () const
 Get private creator of the related attribute.
virtual OFString getType () const
 The requirement type of the attribute (1, 1C, 2, 2C or 3).
virtual OFString getVM () const
 The VM of the attribute as noted in the DICOM standard part 6, e.g. "1-n" or "2".
virtual OFString getModule () const
 Get module (or component name) the related attribute belongs to.
virtual OFString getDefaultValue () const
 Get default value of this attribute.
virtual DcmIODTypes::IOD_IE getIE () const
 Get Information Entity the related attribute belongs to.
virtual OFBool isActiveOnWrite () const
 Returns whether this rule is active when writing, i.e. whether the related attribute is written to the dataset by the IOD writing routines.
virtual void setActiveOnWrite (const OFBool active)
 Set whether this rule is active when writing (see isActiveOnWrite()).
virtual OFCondition check (DcmItem &item, const OFBool quiet=OFFalse)
 Check whether the given item fulfills the requirements of this rule, i.e. the related attribute is checked within the given item.
virtual ~IODRule ()
 Virtual Destructor.

Private Member Functions

 IODRule ()
 Private undefined default constructor.
 IODRule (const IODRule &rhs)
 Private undefined copy constructor.

Private Attributes

DcmTagKey m_Key
 Tag key.
OFString m_VM
 VM, see DcmElement::checkVM() for permitted values (e.g. "1-n").
OFString m_Type
 Requirement type: 1, 1C, 2, 2C or 3.
OFString m_Module
 Module (e.g. "PatientModule" or "component name", e.g. "CodeSequenceMacro".
DcmIODTypes::IOD_IE m_IE
 The Information Entity the related attribute belongs to according to the DICOM Model of the Real World, e.g. "Patient" for the attribute "Patient Name".
OFString m_DefaultValue
 Default value for attribute.
OFString m_PrivateCreator
 Private Creator (if private attribute).
OFBool m_ActiveOnWrite
 Whether this rule is taken into account when writing (default OFTrue).

Detailed Description

Class representing a single rule, that refers to a single attribute.

Each rule is uniquely identified by the attribute's tag key and includes information on the Value Multiplicity (VM) of the attribute, its type (1, 1C, 2,...), the module (e.g. "PatientModule") or structure (e.g. "CodeSequenceMacro") it belongs to, a default value and its private creator if it is a private attribute. On top, the Information Entity according to the DICOM Model of the Real World can be stored, e.g. "Patient" for the "PatientModule".

Constructor & Destructor Documentation

◆ IODRule() [1/2]

IODRule::IODRule ( const DcmTagKey & key,
const OFString & VM,
const OFString & type,
const OFString & module,
const DcmIODTypes::IOD_IE ie,
const OFString & defaultValue = "",
const OFString & privateCreator = "" )

Constructor to create a new attribute rule.

Parameters
keyThe tag key of the attribute
VMThe VM of the attribute (notation like in DICOM part 6, e.g. "1-n"), for sequences the number of items allowed.
typeThe "IOD type" of the attribute. Allowed values "1", "1C", "2", "2C" and "3"
moduleThe module or "component" this attribute belongs to
ieThe Information Entity the module belongs to
defaultValueThe default value (default: empty)
privateCreatorThe private creator of the attribute if attribute (default: No private creator)

Referenced by IODRule(), and clone().

◆ IODRule() [2/2]

IODRule::IODRule ( const IODRule & rhs)
private

Private undefined copy constructor.

Parameters
rhsRight hand side of assignment

References IODRule().

Member Function Documentation

◆ check()

virtual OFCondition IODRule::check ( DcmItem & item,
const OFBool quiet = OFFalse )
virtual

Check whether the given item fulfills the requirements of this rule, i.e. the related attribute is checked within the given item.

If this rule is inactive on writing (see setActiveOnWrite()), it is considered fulfilled (EC_Normal) without checking.

Parameters
itemThe item to check the attribute in
quietIf OFTrue, no error or warning messages will be produced but only the return code will indicate OK or error.
Returns
EC_Normal if this rule is fulfilled, error otherwise

◆ clone()

IODRule * IODRule::clone ( )

Return deep copy of this object.

Returns
Deep copy of "this" object

References IODRule().

◆ getDefaultValue()

virtual OFString IODRule::getDefaultValue ( ) const
virtual

Get default value of this attribute.

Returns
The default value (might be empty)

◆ getIE()

virtual DcmIODTypes::IOD_IE IODRule::getIE ( ) const
virtual

Get Information Entity the related attribute belongs to.

Returns
The Information Entity (might be empty)

◆ getModule()

virtual OFString IODRule::getModule ( ) const
virtual

Get module (or component name) the related attribute belongs to.

Returns
The module or component name (e.g. "PatientModule" or "CodeSequenceMacro")

Referenced by DcmIODUtil::readSubSequence(), DcmIODUtil::writeSingleItem(), and DcmIODUtil::writeSubSequence().

◆ getPrivateCreator()

virtual OFString IODRule::getPrivateCreator ( ) const
virtual

Get private creator of the related attribute.

Returns
The private creator of the attribute

◆ getTagKey()

virtual DcmTagKey IODRule::getTagKey ( ) const
virtual

Get tag key of the attribute rule.

Returns
The tag key of the rule

Referenced by DcmIODUtil::writeSubSequence().

◆ getType()

virtual OFString IODRule::getType ( ) const
virtual

The requirement type of the attribute (1, 1C, 2, 2C or 3).

Returns
The requirement type of the attribute

Referenced by DcmIODUtil::readSubSequence(), DcmIODUtil::writeSingleItem(), and DcmIODUtil::writeSubSequence().

◆ getVM()

virtual OFString IODRule::getVM ( ) const
virtual

The VM of the attribute as noted in the DICOM standard part 6, e.g. "1-n" or "2".

For Sequences (VR SQ) whose VM is always 1 by the standard, this denotes the number of items permitted.

Returns
The VM (or number of items permitted)

Referenced by DcmIODUtil::readSubSequence(), and DcmIODUtil::writeSubSequence().

◆ isActiveOnWrite()

virtual OFBool IODRule::isActiveOnWrite ( ) const
virtual

Returns whether this rule is active when writing, i.e. whether the related attribute is written to the dataset by the IOD writing routines.

An inactive rule is skipped on writing (the attribute is not written and, if it is type 1/2, its absence is not reported as an error); it does not affect the value currently held in memory. Rules are active by default.

Note
An inactive rule is also treated as fulfilled by check() (its requirements are not validated): a rule deliberately deactivated to suppress writing should not cause validation errors. Reading is not affected by this flag.
Returns
OFTrue if the rule is active on writing, OFFalse otherwise

◆ setActiveOnWrite()

virtual void IODRule::setActiveOnWrite ( const OFBool active)
virtual

Set whether this rule is active when writing (see isActiveOnWrite()).

Parameters
activeOFTrue to activate the rule on writing (default), OFFalse to skip the related attribute on writing

Member Data Documentation

◆ m_ActiveOnWrite

OFBool IODRule::m_ActiveOnWrite
private

Whether this rule is taken into account when writing (default OFTrue).

If OFFalse, the related attribute is not written and its absence is not reported as an error. Reading is not affected by this flag.


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


Generated on for DCMTK Version 3.7.1 by Doxygen 1.18.0