DSRCodedEntryValue Class Reference

Class for coded entry values. More...

Inheritance diagram for DSRCodedEntryValue:

DSRCodeTreeNode List of all members.

Public Member Functions

 DSRCodedEntryValue ()
 default contructor
 DSRCodedEntryValue (const OFString &codeValue, const OFString &codingSchemeDesignator, const OFString &codeMeaning)
 constructor.
 DSRCodedEntryValue (const OFString &codeValue, const OFString &codingSchemeDesignator, const OFString &codingSchemeVersion, const OFString &codeMeaning)
 constructor.
 DSRCodedEntryValue (const DSRCodedEntryValue &codedEntryValue)
 copy constructor
virtual ~DSRCodedEntryValue ()
 destructor
DSRCodedEntryValueoperator= (const DSRCodedEntryValue &codedEntryValue)
 assignment operator
OFBool operator== (const DSRCodedEntryValue &codedEntryValue) const
 comparison operator.
virtual void clear ()
 clear all internal variables.
virtual OFBool isValid () const
 check whether the current code is valid.
virtual OFBool isEmpty () const
 check whether the current code is empty.
void print (STD_NAMESPACE ostream &stream, const OFBool printCodeValue=OFTrue, const OFBool printInvalid=OFFalse) const
 print code.
OFCondition readSequence (DcmItem &dataset, const DcmTagKey &tagKey, const OFString &type)
 read code sequence from dataset.
OFCondition writeSequence (DcmItem &dataset, const DcmTagKey &tagKey) const
 write code sequence to dataset
OFCondition readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor)
 read code from XML document
OFCondition writeXML (STD_NAMESPACE ostream &stream, const size_t flags) const
 write code in XML format
OFCondition renderHTML (STD_NAMESPACE ostream &stream, const size_t flags, const OFBool fullCode=OFTrue, const OFBool valueFirst=OFFalse) const
 render code in HTML/XHTML format
const DSRCodedEntryValuegetValue () const
 get reference to code value
OFCondition getValue (DSRCodedEntryValue &codedEntryValue) const
 get copy of code value
const OFStringgetCodeValue () const
 get code value.
const OFStringgetCodingSchemeDesignator () const
 get coding scheme designator.
const OFStringgetCodingSchemeVersion () const
 get coding scheme version.
const OFStringgetCodeMeaning () const
 get code meaning.
OFCondition setValue (const DSRCodedEntryValue &codedEntryValue)
 set code value.
OFCondition setCode (const OFString &codeValue, const OFString &codingSchemeDesignator, const OFString &codeMeaning)
 set code value.
OFCondition setCode (const OFString &codeValue, const OFString &codingSchemeDesignator, const OFString &codingSchemeVersion, const OFString &codeMeaning)
 set code value.

Protected Member Functions

DSRCodedEntryValuegetValuePtr ()
 get pointer to code value
OFCondition readItem (DcmItem &dataset, const char *moduleName=NULL)
 read code from dataset
OFCondition writeItem (DcmItem &dataset) const
 write code to dataset
OFBool checkCode (const OFString &codeValue, const OFString &codingSchemeDesignator, const OFString &codeMeaning) const
 check the specified code for validity.

Private Attributes

OFString CodeValue
 code value (VR=SH, mandatory)
OFString CodingSchemeDesignator
 coding scheme designator (VR=SH, mandatory)
OFString CodingSchemeVersion
 coding scheme version (VR=SH, optional)
OFString CodeMeaning
 code meaning (VR=LO, mandatory)

Friends

class DSRContentItem

Detailed Description

Class for coded entry values.

Definition at line 47 of file dsrcodvl.h.


Constructor & Destructor Documentation

DSRCodedEntryValue::DSRCodedEntryValue ( const OFString codeValue,
const OFString codingSchemeDesignator,
const OFString codeMeaning 
)

constructor.

The code triple is only set if it passed the validity check (see setCode()).

Parameters:
codeValue identifier of the code to be set that is unambiguous within the coding scheme. (VR=SH, mandatory)
codingSchemeDesignator textual identifier of the table where the 'codeValue' is linked to its 'codeMeaning'. (VR=SH, mandatory)
codeMeaning human-readable translation of the 'codeValue'. Used for display when code dictionary is not available. (VR=LO, mandatory)

DSRCodedEntryValue::DSRCodedEntryValue ( const OFString codeValue,
const OFString codingSchemeDesignator,
const OFString codingSchemeVersion,
const OFString codeMeaning 
)

constructor.

The code 4-tuple is only set if it passed the validity check (see setCode()).

Parameters:
codeValue identifier of the code to be set that is unambiguous within the coding scheme. (VR=SH, mandatory)
codingSchemeDesignator textual identifier of the table where the 'codeValue' is linked to its 'codeMeaning'. (VR=SH, mandatory)
codingSchemeVersion version of the coding scheme. Used when a coding scheme has multiple versions and the 'codingScheme Designator' does not explicitly (or adequately) specify the version number. (VR=SH, optional)
codeMeaning human-readable translation of the 'codeValue'. Used for display when (appropriate) code dictionary is not available. (VR=LO, mandatory)

DSRCodedEntryValue::DSRCodedEntryValue ( const DSRCodedEntryValue codedEntryValue  ) 

copy constructor

Parameters:
codedEntryValue code to be copied (not checked !)


Member Function Documentation

DSRCodedEntryValue& DSRCodedEntryValue::operator= ( const DSRCodedEntryValue codedEntryValue  ) 

assignment operator

Parameters:
codedEntryValue code to be copied (not checked !)
Returns:
reference to this code after 'codedEntryValue' has been copied

OFBool DSRCodedEntryValue::operator== ( const DSRCodedEntryValue codedEntryValue  )  const

comparison operator.

Two codes are equal if the code value, coding scheme designator and the (optional) coding scheme version are equal. The code meaning is not relevant for this check.

Parameters:
codedEntryValue code which should be compared to the current one
Returns:
OFTrue if both codes are equal, OFFalse otherwise

virtual void DSRCodedEntryValue::clear (  )  [virtual]

clear all internal variables.

Since an empty code is invalid the code becomes invalid afterwards.

Reimplemented in DSRCodeTreeNode.

virtual OFBool DSRCodedEntryValue::isValid (  )  const [virtual]

check whether the current code is valid.

See checkCode() for details.

Returns:
OFTrue if code is valid, OFFalse otherwise

Reimplemented in DSRCodeTreeNode.

virtual OFBool DSRCodedEntryValue::isEmpty (  )  const [virtual]

check whether the current code is empty.

Checks whether all four components of the code are empty.

Returns:
OFTrue if code is empty, OFFalse otherwise

void DSRCodedEntryValue::print ( STD_NAMESPACE ostream &  stream,
const OFBool  printCodeValue = OFTrue,
const OFBool  printInvalid = OFFalse 
) const

print code.

The output of a typical code triple looks like this: (1234,99_OFFIS_DCMTK,"Code Meaning"). The optional coding scheme version is printed in square brackets directly after the coding scheme designator, e.g.: (cm,UCUM[1.4],"centimeter")

Parameters:
stream output stream to which the code should be printed
printCodeValue flag indicating whether the code value and coding scheme designator should be printed (default) or not. If OFFalse the output looks like this: (,,"Code Meaning")
printInvalid flag indicating whether the text "invalid code" should be printed for invalid codes or not (default)

OFCondition DSRCodedEntryValue::readSequence ( DcmItem dataset,
const DcmTagKey tagKey,
const OFString type 
)

read code sequence from dataset.

The number of items within the code sequence is checked. If error/warning output are enabled a warning message is printed if the sequence is empty or contains more than one item.

Parameters:
dataset DICOM dataset from which the code sequence should be read
tagKey DICOM tag specifying the attribute (= sequence) which should be read
type value type of the sequence (valid value: "1", "2", something else). This parameter is used for checking purpose, any difference is reported.
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRCodedEntryValue::writeSequence ( DcmItem dataset,
const DcmTagKey tagKey 
) const

write code sequence to dataset

Parameters:
dataset DICOM dataset to which the code sequence should be written
tagKey DICOM tag specifying the attribute (= sequence) which should be written
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRCodedEntryValue::readXML ( const DSRXMLDocument doc,
DSRXMLCursor  cursor 
)

read code from XML document

Parameters:
doc document containing the XML file content
cursor cursor pointing to the starting node
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRCodedEntryValue::writeXML ( STD_NAMESPACE ostream &  stream,
const size_t  flags 
) const

write code in XML format

Parameters:
stream output stream to which the XML document is written
flags flag used to customize the output (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRCodeTreeNode.

OFCondition DSRCodedEntryValue::renderHTML ( STD_NAMESPACE ostream &  stream,
const size_t  flags,
const OFBool  fullCode = OFTrue,
const OFBool  valueFirst = OFFalse 
) const

render code in HTML/XHTML format

Parameters:
stream output stream to which the HTML/XHTML document is written
flags flag used to customize the output (see DSRTypes::HF_xxx)
fullCode optional flag indicating whether to render the full code tuple or the code value/meaning only
valueFirst optional flag indicating whether to render the code value or meaning first (outside the brackets)
Returns:
status, EC_Normal if successful, an error code otherwise

const DSRCodedEntryValue& DSRCodedEntryValue::getValue (  )  const [inline]

get reference to code value

Returns:
reference to code value

Definition at line 201 of file dsrcodvl.h.

OFCondition DSRCodedEntryValue::getValue ( DSRCodedEntryValue codedEntryValue  )  const

get copy of code value

Parameters:
codedEntryValue reference to variable in which the code should be stored
Returns:
status, EC_Normal if successful, an error code otherwise

const OFString& DSRCodedEntryValue::getCodeValue (  )  const [inline]

get code value.

This is a identifier of the code that is unambiguous within the coding scheme.

Returns:
current code value (might be invalid or an empty string)

Definition at line 216 of file dsrcodvl.h.

References CodeValue.

const OFString& DSRCodedEntryValue::getCodingSchemeDesignator (  )  const [inline]

get coding scheme designator.

This is a textual identifier of the table where the code value is linked to its code meaning. Designators beginning with "99" and the designator "L" are defined to be private or local coding schemes. More details on the coding scheme might be retrieved via the DSRDocument::getCodingSchemeIdentification() method.

Returns:
current coding scheme designator (might be invalid or an empty string)

Definition at line 228 of file dsrcodvl.h.

References CodingSchemeDesignator.

const OFString& DSRCodedEntryValue::getCodingSchemeVersion (  )  const [inline]

get coding scheme version.

Optional - Used when a coding scheme has multiple versions and the coding scheme designator does not explicitly (or adequately) specify the version number.

Returns:
current coding scheme version (might be invalid or an empty string)

Definition at line 238 of file dsrcodvl.h.

References CodingSchemeVersion.

const OFString& DSRCodedEntryValue::getCodeMeaning (  )  const [inline]

get code meaning.

Human-readable translation of the code value. Used for display when code dictionary is not available.

Returns:
current code meaning (might be invalid or an empty string)

Definition at line 248 of file dsrcodvl.h.

References CodeMeaning.

OFCondition DSRCodedEntryValue::setValue ( const DSRCodedEntryValue codedEntryValue  ) 

set code value.

Before setting the code it is checked (see checkCode()). If the code is invalid the current code is not replaced and remains unchanged.

Parameters:
codedEntryValue code to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRCodedEntryValue::setCode ( const OFString codeValue,
const OFString codingSchemeDesignator,
const OFString codeMeaning 
)

set code value.

Before setting the code it is checked (see checkCode()). If the code is invalid the current code is not replaced and remains unchanged. Additional information on the coding scheme can be provided via the getCodingSchemeIdentification() method in the main interface class DSRDocument (highly recommended for private coding schemes).

Parameters:
codeValue identifier of the code to be set that is unambiguous within the coding scheme. (VR=SH, mandatory)
codingSchemeDesignator textual identifier of the table where the 'codeValue' is linked to its 'codeMeaning'. (VR=SH, mandatory) Designators beginning with "99" and the designator "L" are defined to be private or local coding schemes.
codeMeaning human-readable translation of the 'codeValue'. Used for display when code dictionary is not available. (VR=LO, mandatory)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRCodedEntryValue::setCode ( const OFString codeValue,
const OFString codingSchemeDesignator,
const OFString codingSchemeVersion,
const OFString codeMeaning 
)

set code value.

Before setting the specified code it is checked (see checkCode()). If the code is invalid the current code is not replaced and remains unchanged. Additional information on the coding scheme can be provided via the getCodingSchemeIdentification() method in the main class DSRDocument (highly recommended for private coding schemes).

Parameters:
codeValue identifier of the code to be set that is unambiguous within the coding scheme. (VR=SH, mandatory)
codingSchemeDesignator textual identifier of the table where the 'codeValue' is linked to its 'codeMeaning'. (VR=SH, mandatory) Designators beginning with "99" and the designator "L" are defined to be private or local coding schemes.
codingSchemeVersion version of the coding scheme. Used when a coding scheme has multiple versions and the 'codingScheme Designator' does not explicitly (or adequately) specify the version number. (VR=SH, optional)
codeMeaning human-readable translation of the 'codeValue'. Used for display when code dictionary is not available. (VR=LO, mandatory)
Returns:
status, EC_Normal if successful, an error code otherwise

DSRCodedEntryValue* DSRCodedEntryValue::getValuePtr (  )  [inline, protected]

get pointer to code value

Returns:
pointer to code value (never NULL)

Definition at line 312 of file dsrcodvl.h.

OFCondition DSRCodedEntryValue::readItem ( DcmItem dataset,
const char *  moduleName = NULL 
) [protected]

read code from dataset

Parameters:
dataset DICOM dataset from which the code should be read
moduleName optional module name (sequence) from which the item is read
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRCodedEntryValue::writeItem ( DcmItem dataset  )  const [protected]

write code to dataset

Parameters:
dataset DICOM dataset to which the code should be written
Returns:
status, EC_Normal if successful, an error code otherwise

OFBool DSRCodedEntryValue::checkCode ( const OFString codeValue,
const OFString codingSchemeDesignator,
const OFString codeMeaning 
) const [protected]

check the specified code for validity.

Currently the only check that is performed is that the three string values are not empty. Later on it might be checked whether the specified code really belongs to the specified coding scheme, etc. This require the presence of the relevant code dictionaries.

Parameters:
codeValue code value to be checked
codingSchemeDesignator coding scheme designator to be checked
codeMeaning code meaning tobe checked
Returns:
OFTrue if code is valid, OFFalse otherwise


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


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1