DSRNumericMeasurementValue Class Reference

Class for numeric measurement values. More...

Inheritance diagram for DSRNumericMeasurementValue:

DSRNumTreeNode List of all members.

Public Member Functions

 DSRNumericMeasurementValue ()
 default constructor
 DSRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit)
 constructor.
 DSRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const DSRCodedEntryValue &valueQualifier)
 constructor.
 DSRNumericMeasurementValue (const DSRNumericMeasurementValue &numericMeasurement)
 copy constructor
virtual ~DSRNumericMeasurementValue ()
 destructor
DSRNumericMeasurementValueoperator= (const DSRNumericMeasurementValue &numericMeasurement)
 assignment operator
virtual void clear ()
 clear all internal variables.
virtual OFBool isValid () const
 check whether the current numeric measurement value is valid.
virtual OFBool isEmpty () const
 check whether the current numeric measurement value is empty.
virtual OFCondition print (STD_NAMESPACE ostream &stream, const size_t flags) const
 print numeric measurement value.
virtual OFCondition readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor)
 read numeric measurement value from XML document
virtual OFCondition writeXML (STD_NAMESPACE ostream &stream, const size_t flags) const
 write numeric measurement value in XML format
virtual OFCondition readSequence (DcmItem &dataset)
 read measured value sequence and numeric value qualifier code sequence from dataset.
virtual OFCondition writeSequence (DcmItem &dataset) const
 write measured value sequence and numeric value qualifier code sequence to dataset.
virtual OFCondition renderHTML (STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &annexStream, size_t &annexNumber, const size_t flags) const
 render numeric measurement value in HTML/XHTML format
const DSRNumericMeasurementValuegetValue () const
 get reference to numeric measurement value
OFCondition getValue (DSRNumericMeasurementValue &numericMeasurement) const
 get copy of numeric measurement value
const OFStringgetNumericValue () const
 get numeric value
const DSRCodedEntryValuegetMeasurementUnit () const
 get measurement unit
const DSRCodedEntryValuegetNumericValueQualifier () const
 get numeric value qualifier (optional)
OFCondition getMeasurementUnit (DSRCodedEntryValue &measurementUnit) const
 get copy of measurement unit
OFCondition setValue (const DSRNumericMeasurementValue &numericMeasurement)
 set numeric measurement value.
OFCondition setValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit)
 set numeric value and measurement unit.
OFCondition setValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const DSRCodedEntryValue &valueQualifier)
 set numeric value, measurement unit and numeric value qualifier.
OFCondition setNumericValue (const OFString &numericValue)
 set numeric value.
OFCondition setMeasurementUnit (const DSRCodedEntryValue &measurementUnit)
 set measurement unit.
OFCondition setNumericValueQualifier (const DSRCodedEntryValue &valueQualifier)
 set numeric value qualifier.

Protected Member Functions

DSRNumericMeasurementValuegetValuePtr ()
 get pointer to numeric measurement value
virtual OFCondition readItem (DcmItem &dataset)
 read numeric measurement value from dataset
virtual OFCondition writeItem (DcmItem &dataset) const
 write numeric measurement value to dataset
virtual OFBool checkNumericValue (const OFString &numericValue) const
 check the specified numeric value for validity.
virtual OFBool checkMeasurementUnit (const DSRCodedEntryValue &measurementUnit) const
 check the specified measurement unit for validity.
virtual OFBool checkNumericValueQualifier (const DSRCodedEntryValue &valueQualifier) const
 check the specified numeric value qualifier for validity.

Private Attributes

OFString NumericValue
 numeric value (VR=DS, type 1)
DSRCodedEntryValue MeasurementUnit
 measurement unit (type 2)
DSRCodedEntryValue ValueQualifier
 numeric value qualifier (type 3)

Friends

class DSRContentItem

Detailed Description

Class for numeric measurement values.

Definition at line 47 of file dsrnumvl.h.


Constructor & Destructor Documentation

DSRNumericMeasurementValue::DSRNumericMeasurementValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit 
)

constructor.

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

Parameters:
numericValue numeric measurement value. (VR=DS, type 1)
measurementUnit code representing the measurement name (code meaning) and unit (code value). (type 2)

DSRNumericMeasurementValue::DSRNumericMeasurementValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit,
const DSRCodedEntryValue valueQualifier 
)

constructor.

The two codes are only set if they passed the validity check (see setValue()).

Parameters:
numericValue numeric measurement value. (VR=DS, type 1)
measurementUnit code representing the measurement name (code meaning) and unit (code value). (type 2)
valueQualifier code representing the numeric value qualifier. (type 3)

DSRNumericMeasurementValue::DSRNumericMeasurementValue ( const DSRNumericMeasurementValue numericMeasurement  ) 

copy constructor

Parameters:
numericMeasurement numeric measurement value to be copied (not checked !)


Member Function Documentation

DSRNumericMeasurementValue& DSRNumericMeasurementValue::operator= ( const DSRNumericMeasurementValue numericMeasurement  ) 

assignment operator

Parameters:
numericMeasurement numeric measurement value to be copied (not checked !)
Returns:
reference to this numeric value after 'numericMeasurement' has been copied

virtual void DSRNumericMeasurementValue::clear (  )  [virtual]

clear all internal variables.

Use this method to create an empty numeric measurement value.

Reimplemented in DSRNumTreeNode.

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

check whether the current numeric measurement value is valid.

The value is valid if isEmpty() is true or all three values (numeric value, measurement unit and value qualifier) do contain valid values (see checkXXX() methods).

Returns:
OFTrue if value is valid, OFFalse otherwise

Reimplemented in DSRNumTreeNode.

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

check whether the current numeric measurement value is empty.

Checks whether both the numeric value and the measurement unit are empty.

Returns:
OFTrue if value is empty, OFFalse otherwise

virtual OFCondition DSRNumericMeasurementValue::print ( STD_NAMESPACE ostream &  stream,
const size_t  flags 
) const [virtual]

print numeric measurement value.

The output of a typical numeric measurement value looks like this: "3" (cm,99_OFFIS_DCMTK,"Length Unit"). If the value is empty the text "empty" is printed instead. The numeric value qualifier is never printed.

Parameters:
stream output stream to which the numeric measurement value should be printed
flags flag used to customize the output (not used)
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRNumTreeNode.

virtual OFCondition DSRNumericMeasurementValue::readXML ( const DSRXMLDocument doc,
DSRXMLCursor  cursor 
) [virtual]

read numeric measurement value 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

virtual OFCondition DSRNumericMeasurementValue::writeXML ( STD_NAMESPACE ostream &  stream,
const size_t  flags 
) const [virtual]

write numeric measurement value 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 DSRNumTreeNode.

virtual OFCondition DSRNumericMeasurementValue::readSequence ( DcmItem dataset  )  [virtual]

read measured value sequence and numeric value qualifier code sequence from dataset.

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

Parameters:
dataset DICOM dataset from which the sequences should be read
Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFCondition DSRNumericMeasurementValue::writeSequence ( DcmItem dataset  )  const [virtual]

write measured value sequence and numeric value qualifier code sequence to dataset.

The measured value sequence is always written (might be empty, though). The numeric value qualifier code sequence is optional and, therefore, only written if non-empty.

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

virtual OFCondition DSRNumericMeasurementValue::renderHTML ( STD_NAMESPACE ostream &  docStream,
STD_NAMESPACE ostream &  annexStream,
size_t &  annexNumber,
const size_t  flags 
) const [virtual]

render numeric measurement value in HTML/XHTML format

Parameters:
docStream output stream to which the main HTML/XHTML document is written
annexStream output stream to which the HTML/XHTML document annex is written
annexNumber reference to the variable where the current annex number is stored. Value is increased automatically by 1 after a new entry has been added.
flags flag used to customize the output (see DSRTypes::HF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

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

get reference to numeric measurement value

Returns:
reference to numeric measurement value

Definition at line 171 of file dsrnumvl.h.

OFCondition DSRNumericMeasurementValue::getValue ( DSRNumericMeasurementValue numericMeasurement  )  const

get copy of numeric measurement value

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

const OFString& DSRNumericMeasurementValue::getNumericValue (  )  const [inline]

get numeric value

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

Definition at line 185 of file dsrnumvl.h.

References NumericValue.

const DSRCodedEntryValue& DSRNumericMeasurementValue::getMeasurementUnit (  )  const [inline]

get measurement unit

Returns:
reference to current measurement unit code (might be invalid or empty)

Definition at line 193 of file dsrnumvl.h.

References MeasurementUnit.

const DSRCodedEntryValue& DSRNumericMeasurementValue::getNumericValueQualifier (  )  const [inline]

get numeric value qualifier (optional)

Returns:
reference to current numeric value qualifier code (might be invalid or empty)

Definition at line 201 of file dsrnumvl.h.

References ValueQualifier.

OFCondition DSRNumericMeasurementValue::getMeasurementUnit ( DSRCodedEntryValue measurementUnit  )  const

get copy of measurement unit

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

OFCondition DSRNumericMeasurementValue::setValue ( const DSRNumericMeasurementValue numericMeasurement  ) 

set numeric measurement value.

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

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

OFCondition DSRNumericMeasurementValue::setValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit 
)

set numeric value and measurement unit.

Before setting the values they are checked (see checkXXX()). If the value pair is invalid the current value pair is not replaced and remains unchanged.

Parameters:
numericValue numeric value to be set
measurementUnit measurement unit to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRNumericMeasurementValue::setValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit,
const DSRCodedEntryValue valueQualifier 
)

set numeric value, measurement unit and numeric value qualifier.

Before setting the values they are checked (see checkXXX()). If one of the three values is invalid the current numeric measurement value is not replaced and remains unchanged.

Parameters:
numericValue numeric value to be set
measurementUnit measurement unit to be set
valueQualifier numeric value qualifier to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRNumericMeasurementValue::setNumericValue ( const OFString numericValue  ) 

set numeric value.

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

Parameters:
numericValue numeric value to be set (VR=DS)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRNumericMeasurementValue::setMeasurementUnit ( const DSRCodedEntryValue measurementUnit  ) 

set measurement unit.

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

Parameters:
measurementUnit measurement unit to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRNumericMeasurementValue::setNumericValueQualifier ( const DSRCodedEntryValue valueQualifier  ) 

set numeric value qualifier.

This optional code specifies the qualification of the Numeric Value in the Measured Value Sequence, or the reason for the absence of the Measured Value Sequence Item. Before setting the code it is checked (see checkNumericValueQualifier()). If the code is invalid the current code is not replaced and remains unchanged.

Parameters:
valueQualifier numeric value qualifier to be set
Returns:
status, EC_Normal if successful, an error code otherwise

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

get pointer to numeric measurement value

Returns:
pointer to numeric measurement value (never NULL)

Definition at line 275 of file dsrnumvl.h.

virtual OFCondition DSRNumericMeasurementValue::readItem ( DcmItem dataset  )  [protected, virtual]

read numeric measurement value from dataset

Parameters:
dataset DICOM dataset from which the value should be read
Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFCondition DSRNumericMeasurementValue::writeItem ( DcmItem dataset  )  const [protected, virtual]

write numeric measurement value to dataset

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

virtual OFBool DSRNumericMeasurementValue::checkNumericValue ( const OFString numericValue  )  const [protected, virtual]

check the specified numeric value for validity.

Currently the only check that is performed is that the string is not empty. Later on it might be checked whether the format conforms to the definition of DS.

Parameters:
numericValue numeric value to be checked
Returns:
OFTrue if numeric value is valid, OFFalse otherwise

virtual OFBool DSRNumericMeasurementValue::checkMeasurementUnit ( const DSRCodedEntryValue measurementUnit  )  const [protected, virtual]

check the specified measurement unit for validity.

The isValid() method in class DSRCodedEntryValue is used for this purpose.

Parameters:
measurementUnit measurement unit to be checked
Returns:
OFTrue if measurement unit is valid, OFFalse otherwise

virtual OFBool DSRNumericMeasurementValue::checkNumericValueQualifier ( const DSRCodedEntryValue valueQualifier  )  const [protected, virtual]

check the specified numeric value qualifier for validity.

The isEmpty() and isValid() methods in class DSRCodedEntryValue are used for this purpose. The conformance with the Context Group 42 (as defined in the DICOM standard) is not yet checked.

Parameters:
valueQualifier numeric value qualifier to be checked
Returns:
OFTrue if value qualifier 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