DCMTK  Version 3.6.5
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
DSRNumericMeasurementValue Class Reference

Class for numeric values and measurements. More...

+ Inheritance diagram for DSRNumericMeasurementValue:

Public Member Functions

 DSRNumericMeasurementValue ()
 default constructor
 
 DSRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const OFBool check=OFTrue)
 constructor More...
 
 DSRNumericMeasurementValue (const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
 constructor More...
 
 DSRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
 constructor More...
 
 DSRNumericMeasurementValue (const DSRNumericMeasurementValue &numericMeasurement)
 copy constructor More...
 
virtual ~DSRNumericMeasurementValue ()
 destructor
 
DSRNumericMeasurementValueoperator= (const DSRNumericMeasurementValue &numericMeasurement)
 assignment operator More...
 
OFBool operator== (const DSRNumericMeasurementValue &numericMeasurement) const
 comparison operator "equal". More...
 
OFBool operator!= (const DSRNumericMeasurementValue &numericMeasurement) const
 comparison operator "not equal". More...
 
virtual void clear ()
 clear all internal variables. More...
 
virtual OFBool isValid () const
 check whether the current numeric measurement value is valid. More...
 
virtual OFBool isEmpty () const
 check whether the current numeric measurement value is empty. More...
 
virtual OFBool isComplete () const
 check whether the current numeric measurement value is complete, i.e. whether the numeric value is non-empty and the measurement unit is complete, or whether the value qualifier is complete. More...
 
virtual OFCondition print (STD_NAMESPACE ostream &stream, const size_t flags) const
 print numeric measurement value. More...
 
virtual OFCondition readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read numeric measurement value from XML document More...
 
virtual OFCondition writeXML (STD_NAMESPACE ostream &stream, const size_t flags) const
 write numeric measurement value in XML format More...
 
virtual OFCondition readSequence (DcmItem &dataset, const size_t flags)
 read measured value sequence and numeric value qualifier code sequence from dataset. More...
 
virtual OFCondition writeSequence (DcmItem &dataset) const
 write measured value sequence and numeric value qualifier code sequence to dataset. More...
 
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 More...
 
const DSRNumericMeasurementValuegetValue () const
 get reference to numeric measurement value More...
 
OFCondition getValue (DSRNumericMeasurementValue &numericMeasurement) const
 get copy of numeric measurement value More...
 
const OFStringgetNumericValue () const
 get numeric value More...
 
const DSRCodedEntryValuegetMeasurementUnit () const
 get measurement unit More...
 
const DSRCodedEntryValuegetNumericValueQualifier () const
 get numeric value qualifier (optional) More...
 
OFCondition getMeasurementUnit (DSRCodedEntryValue &measurementUnit) const
 get copy of measurement unit More...
 
OFCondition getNumericValueQualifier (DSRCodedEntryValue &valueQualifier) const
 get copy of numeric value qualifier (optional). More...
 
OFCondition getFloatingPointRepresentation (Float64 &floatingPoint) const
 get floating point representation of the numeric value (optional) More...
 
OFCondition getRationalRepresentation (Sint32 &rationalNumerator, Uint32 &rationalDenominator) const
 get rational representation of the numeric value (optional) More...
 
OFCondition setValue (const DSRNumericMeasurementValue &numericMeasurement, const OFBool check=OFTrue)
 set numeric measurement value. More...
 
OFCondition setValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const OFBool check=OFTrue)
 set numeric value and measurement unit. More...
 
OFCondition setValue (const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
 set empty numeric value and measurement unit with a numeric value qualifier. More...
 
OFCondition setValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
 set numeric value, measurement unit and numeric value qualifier. More...
 
OFCondition setNumericValue (const OFString &numericValue, const OFBool check=OFTrue)
 set numeric value. More...
 
OFCondition setNumericValue (const DcmElement &delem, const unsigned long pos=0, const OFBool check=OFTrue)
 set numeric value from element. More...
 
OFCondition setNumericValue (DcmItem &dataset, const DcmTagKey &tagKey, const unsigned long pos=0, const OFBool check=OFTrue)
 set numeric value from dataset. More...
 
OFCondition setMeasurementUnit (const DSRCodedEntryValue &measurementUnit, const OFBool check=OFTrue)
 set measurement unit. More...
 
OFCondition setNumericValueQualifier (const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
 set numeric value qualifier. More...
 
OFCondition setFloatingPointRepresentation (const Float64 floatingPoint, const OFBool check=OFTrue)
 set floating point representation of the numeric value. More...
 
OFCondition setRationalRepresentation (const Sint32 rationalNumerator, const Uint32 rationalDenominator, const OFBool check=OFTrue)
 set rational representation of the numeric value. More...
 
void removeFloatingPointRepresentation ()
 remove floating point representation of the numeric value (if any). More...
 
void removeRationalRepresentation ()
 remove rational representation of the numeric value (if any). More...
 

Protected Member Functions

DSRNumericMeasurementValuegetValuePtr ()
 get pointer to numeric measurement value More...
 
virtual OFCondition readItem (DcmItem &dataset, const size_t flags)
 read numeric measurement value from dataset More...
 
virtual OFCondition writeItem (DcmItem &dataset) const
 write numeric measurement value to dataset More...
 
virtual OFCondition checkNumericValue (const OFString &numericValue) const
 check the specified numeric value for validity. More...
 
virtual OFCondition checkMeasurementUnit (const DSRCodedEntryValue &measurementUnit) const
 check the specified measurement unit for validity. More...
 
virtual OFCondition checkNumericValueQualifier (const DSRCodedEntryValue &valueQualifier) const
 check the specified numeric value qualifier for validity. More...
 
virtual OFCondition checkRationalRepresentation (const Sint32 rationalNumerator, const Uint32 rationalDenominator) const
 check the specified rational representation for validity. More...
 
virtual OFCondition checkCurrentValue () const
 check the currently stored numeric measurement value for validity. More...
 

Private Attributes

OFString NumericValue
 Numeric Value (VR=DS, type 1 within a type 2 sequence)
 
DSRCodedEntryValue MeasurementUnit
 Measurement Unit (type 1 within a type 2 sequence)
 
DSRCodedEntryValue ValueQualifier
 Numeric Value Qualifier (type 3)
 
DcmFloatingPointDouble FloatingPointValue
 Floating Point Value (VR=FD, type 1C)
 
DcmSignedLong RationalNumeratorValue
 Rational Numerator Value (VR=SL, type 1C)
 
DcmUnsignedLong RationalDenominatorValue
 Rational Denominator Value (VR=UL, type 1C)
 

Friends

class DSRContentItem
 

Detailed Description

Class for numeric values and measurements.

Constructor & Destructor Documentation

◆ DSRNumericMeasurementValue() [1/4]

DSRNumericMeasurementValue::DSRNumericMeasurementValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit,
const OFBool  check = OFTrue 
)

constructor

Parameters
numericValuenumeric value (VR=DS, mandatory)
measurementUnitcode representing the units of measurement (mandatory)
checkif enabled, check 'numericValue' and 'measurementUnit' for validity before setting them. See corresponding setValue() method for details.

◆ DSRNumericMeasurementValue() [2/4]

DSRNumericMeasurementValue::DSRNumericMeasurementValue ( const DSRCodedEntryValue valueQualifier,
const OFBool  check = OFTrue 
)

constructor

Parameters
valueQualifiercode representing the numeric value qualifier. Used to specify the reason for the absence of the measured value sequence, i.e. why the numeric value and measurement unit are empty.
checkif enabled, check value for validity before setting it. See corresponding setValue() method for details.

◆ DSRNumericMeasurementValue() [3/4]

DSRNumericMeasurementValue::DSRNumericMeasurementValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit,
const DSRCodedEntryValue valueQualifier,
const OFBool  check = OFTrue 
)

constructor

Parameters
numericValuenumeric value (VR=DS, mandatory)
measurementUnitcode representing the units of measurement (mandatory)
valueQualifiercode representing the numeric value qualifier (optional). Can also be used to specify the reason for the absence of the measured value sequence (where 'numericValue' and 'measurementUnit' are stored).
checkif enabled, check values for validity before setting them. See corresponding setValue() method for details.

◆ DSRNumericMeasurementValue() [4/4]

DSRNumericMeasurementValue::DSRNumericMeasurementValue ( const DSRNumericMeasurementValue numericMeasurement)

copy constructor

Parameters
numericMeasurementnumeric measurement value to be copied (not checked !)

Member Function Documentation

◆ checkCurrentValue()

virtual OFCondition DSRNumericMeasurementValue::checkCurrentValue ( ) const
protectedvirtual

check the currently stored numeric measurement value for validity.

See above checkXXX() methods for details.

Returns
status, EC_Normal if current value is valid, an error code otherwise

◆ checkMeasurementUnit()

virtual OFCondition DSRNumericMeasurementValue::checkMeasurementUnit ( const DSRCodedEntryValue measurementUnit) const
protectedvirtual

check the specified measurement unit for validity.

Internally, the methods DSRCodedEntryValue::isEmpty() and DSRCodedEntryValue::checkCurrentValue() are used for this purpose. Conformance with the Context Group 82 (as defined in the DICOM standard) is not yet checked.

Parameters
measurementUnitmeasurement unit to be checked
Returns
status, EC_Normal if measurement unit is valid, an error code otherwise

Reimplemented in CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >.

Referenced by CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::checkMeasurementUnit().

◆ checkNumericValue()

virtual OFCondition DSRNumericMeasurementValue::checkNumericValue ( const OFString numericValue) const
protectedvirtual

check the specified numeric value for validity.

Currently, the only checks performed are that the string is non-empty and that the given value conforms to the corresponding VR (DS) and VM (1).

Parameters
numericValuenumeric value to be checked
Returns
status, EC_Normal if numeric value is valid, an error code otherwise

◆ checkNumericValueQualifier()

virtual OFCondition DSRNumericMeasurementValue::checkNumericValueQualifier ( const DSRCodedEntryValue valueQualifier) const
protectedvirtual

check the specified numeric value qualifier for validity.

Internally, DSRCodedEntryValue::isEmpty() and DSRCodedEntryValue::checkCurrentValue() are used for this purpose. Conformance with the Context Group 42 (as defined in the DICOM standard) is not checked; see class CMR_SRNumericMeasurementValue if needed, which supports such additional checks.

Parameters
valueQualifiernumeric value qualifier to be checked
Returns
status, EC_Normal if value qualifier is valid, an error code otherwise

Reimplemented in CMR_SRNumericMeasurementValue.

◆ checkRationalRepresentation()

virtual OFCondition DSRNumericMeasurementValue::checkRationalRepresentation ( const Sint32  rationalNumerator,
const Uint32  rationalDenominator 
) const
protectedvirtual

check the specified rational representation for validity.

The only check that is performed is that the 'rationalDenominator' is not zero, i.e. it is not checked whether this representation is consistent with the numeric value stored as a string.

Parameters
rationalNumeratornumerator of the rational representation to be checked
rationalDenominatordenominator of a rational representation to be checked
Returns
status, EC_Normal if rational representation is valid, an error code otherwise

◆ clear()

virtual void DSRNumericMeasurementValue::clear ( )
virtual

clear all internal variables.

Use this method to create an empty numeric measurement value.

Reimplemented in DSRNumTreeNode.

◆ getFloatingPointRepresentation()

OFCondition DSRNumericMeasurementValue::getFloatingPointRepresentation ( Float64 &  floatingPoint) const

get floating point representation of the numeric value (optional)

Parameters
floatingPointreference to variable in which the floating point representation should be stored
Returns
status, EC_Normal if successful, an error code otherwise. Returns SR_EC_RepresentationNotAvailable if floating point representation is not available.

◆ getMeasurementUnit() [1/2]

const DSRCodedEntryValue& DSRNumericMeasurementValue::getMeasurementUnit ( ) const
inline

get measurement unit

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

◆ getMeasurementUnit() [2/2]

OFCondition DSRNumericMeasurementValue::getMeasurementUnit ( DSRCodedEntryValue measurementUnit) const

get copy of measurement unit

Parameters
measurementUnitreference to variable in which the code should be stored
Returns
always returns EC_Normal

◆ getNumericValue()

const OFString& DSRNumericMeasurementValue::getNumericValue ( ) const
inline

get numeric value

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

◆ getNumericValueQualifier() [1/2]

const DSRCodedEntryValue& DSRNumericMeasurementValue::getNumericValueQualifier ( ) const
inline

get numeric value qualifier (optional)

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

◆ getNumericValueQualifier() [2/2]

OFCondition DSRNumericMeasurementValue::getNumericValueQualifier ( DSRCodedEntryValue valueQualifier) const

get copy of numeric value qualifier (optional).

Can be used to specify the reason for the absence of the measured value sequence.

Parameters
valueQualifierreference to variable in which the code should be stored
Returns
always returns EC_Normal

◆ getRationalRepresentation()

OFCondition DSRNumericMeasurementValue::getRationalRepresentation ( Sint32 &  rationalNumerator,
Uint32 &  rationalDenominator 
) const

get rational representation of the numeric value (optional)

Parameters
rationalNumeratorreference to variable in which the integer numerator of the rational representation should be stored
rationalDenominatorreference to variable in which the integer denominator of the rational representation should be stored
Returns
status, EC_Normal if successful, an error code otherwise. Returns SR_EC_RepresentationNotAvailable if rational representation is not available.

◆ getValue() [1/2]

const DSRNumericMeasurementValue& DSRNumericMeasurementValue::getValue ( ) const
inline

get reference to numeric measurement value

Returns
reference to numeric measurement value

◆ getValue() [2/2]

OFCondition DSRNumericMeasurementValue::getValue ( DSRNumericMeasurementValue numericMeasurement) const

get copy of numeric measurement value

Parameters
numericMeasurementreference to variable in which the value should be stored
Returns
always returns EC_Normal

◆ getValuePtr()

DSRNumericMeasurementValue* DSRNumericMeasurementValue::getValuePtr ( )
inlineprotected

get pointer to numeric measurement value

Returns
pointer to numeric measurement value (never NULL)

◆ isComplete()

virtual OFBool DSRNumericMeasurementValue::isComplete ( ) const
virtual

check whether the current numeric measurement value is complete, i.e. whether the numeric value is non-empty and the measurement unit is complete, or whether the value qualifier is complete.

This is just a basic check that might be useful for "validating" input data. See isValid() for a more sophisticated way of checking the current numeric measurement value.

Returns
OFTrue if value is complete, OFFalse otherwise

◆ isEmpty()

virtual OFBool DSRNumericMeasurementValue::isEmpty ( ) const
virtual

check whether the current numeric measurement value is empty.

Checks whether both the numeric value and the measurement are empty. The optional value qualifier is not checked since it might contain the reason for the absence of the measured value sequence.

Returns
OFTrue if value is empty, OFFalse otherwise

◆ isValid()

virtual OFBool DSRNumericMeasurementValue::isValid ( ) const
virtual

check whether the current numeric measurement value is valid.

The value is valid if isEmpty() is true or both the numeric value and the measurement unit contain a valid value, and the value qualifier is valid (see checkXXX() methods). The possibly available additional representations of the numeric value are never checked.

Returns
OFTrue if value is valid, OFFalse otherwise

Reimplemented in DSRNumTreeNode.

◆ operator!=()

OFBool DSRNumericMeasurementValue::operator!= ( const DSRNumericMeasurementValue numericMeasurement) const

comparison operator "not equal".

Two numeric measurement values are not equal if either the numeric value or the measurement unit or the value qualifier are not equal. Other (additional) information is not used for comparison.

Parameters
numericMeasurementnumeric measurement value that should be compared to the current one
Returns
OFTrue if both numeric measurement values are not equal, OFFalse otherwise

◆ operator=()

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

assignment operator

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

◆ operator==()

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

comparison operator "equal".

Two numeric measurement values are equal if the numeric value, the measurement unit and the value qualifier are equal. Other (additional) information is not used.

Parameters
numericMeasurementnumeric measurement value that should be compared to the current one
Returns
OFTrue if both numeric measurement values are equal, OFFalse otherwise

◆ print()

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.5" (cm,UCUM[1.4],"centimeter"). If the value is empty, the text "empty" is printed instead, followed by the numeric value qualifier (if present). The possibly available additional floating point and rational representations of the numeric value are never printed.

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

Reimplemented in DSRNumTreeNode.

◆ readItem()

virtual OFCondition DSRNumericMeasurementValue::readItem ( DcmItem dataset,
const size_t  flags 
)
protectedvirtual

read numeric measurement value from dataset

Parameters
datasetDICOM dataset from which the value should be read
flagsflag used to customize the reading process (see DSRTypes::RF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

◆ readSequence()

virtual OFCondition DSRNumericMeasurementValue::readSequence ( DcmItem dataset,
const size_t  flags 
)
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
datasetDICOM dataset from which the sequences should be read
flagsflag used to customize the reading process (see DSRTypes::RF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

◆ readXML()

virtual OFCondition DSRNumericMeasurementValue::readXML ( const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags 
)
virtual

read numeric measurement value from XML document

Parameters
docdocument containing the XML file content
cursorcursor pointing to the starting node
flagsflag used to customize the reading process (see DSRTypes::XF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

◆ removeFloatingPointRepresentation()

void DSRNumericMeasurementValue::removeFloatingPointRepresentation ( )

remove floating point representation of the numeric value (if any).

Internally, all elements that belong to this representation are cleared.

◆ removeRationalRepresentation()

void DSRNumericMeasurementValue::removeRationalRepresentation ( )

remove rational representation of the numeric value (if any).

Internally, all elements that belong to this representation are cleared.

◆ renderHTML()

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
docStreamoutput stream to which the main HTML/XHTML document is written
annexStreamoutput stream to which the HTML/XHTML document annex is written
annexNumberreference to the variable where the current annex number is stored. Value is increased automatically by 1 after a new entry has been added.
flagsflag used to customize the output (see DSRTypes::HF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

◆ setFloatingPointRepresentation()

OFCondition DSRNumericMeasurementValue::setFloatingPointRepresentation ( const Float64  floatingPoint,
const OFBool  check = OFTrue 
)

set floating point representation of the numeric value.

According to the DICOM standard, this value is "required if the numeric value has insufficient precision to represent the value as a string. May be present otherwise." Please note that it is not checked whether this representation is consistent with the numeric value stored as a string.

Parameters
floatingPointfloating point representation of the numeric value
checkdummy parameter (currently not used)
Returns
status, EC_Normal if successful, an error code otherwise

◆ setMeasurementUnit()

OFCondition DSRNumericMeasurementValue::setMeasurementUnit ( const DSRCodedEntryValue measurementUnit,
const OFBool  check = OFTrue 
)

set measurement unit.

Before setting the code, it is usually checked. If the code is invalid the current code is not replaced and remains unchanged.

Parameters
measurementUnitmeasurement unit to be set (mandatory)
checkif enabled, check value for validity before setting it. See checkMeasurementUnit() method for details. An empty value is never accepted, use the clear() method instead.
Returns
status, EC_Normal if successful, an error code otherwise

Referenced by CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::setMeasurementUnit().

◆ setNumericValue() [1/3]

OFCondition DSRNumericMeasurementValue::setNumericValue ( const OFString numericValue,
const OFBool  check = OFTrue 
)

set numeric value.

Before setting the value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged. If the value is replaced, the optional floating point and rational representations are cleared, i.e. they have to be set manually if needed.

Parameters
numericValuenumeric value to be set (VR=DS, mandatory)
checkif enabled, check value for validity before setting it. See checkNumericValue() method for details. An empty value is never accepted, use the clear() method instead.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setNumericValue() [2/3]

OFCondition DSRNumericMeasurementValue::setNumericValue ( const DcmElement delem,
const unsigned long  pos = 0,
const OFBool  check = OFTrue 
)

set numeric value from element.

Before setting the value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged. If the value is replaced, the optional floating point and rational representations are cleared, i.e. they have to be set manually if needed.

Parameters
delemDICOM element from which the numeric value should be retrieved
posindex of the value in case of multi-valued elements (0..vm-1)
checkif enabled, check numeric value for validity before setting it. See checkNumericValue() method for details. An empty value is never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setNumericValue() [3/3]

OFCondition DSRNumericMeasurementValue::setNumericValue ( DcmItem dataset,
const DcmTagKey tagKey,
const unsigned long  pos = 0,
const OFBool  check = OFTrue 
)

set numeric value from dataset.

Before setting the value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged. If the value is replaced, the optional floating point and rational representations are cleared, i.e. they have to be set manually if needed.

Parameters
datasetDICOM dataset from which the numeric value should be retrieved
tagKeyDICOM tag specifying the attribute from which the value should be retrieved. The search is limited to the top-level of the dataset.
posindex of the value in case of multi-valued elements (0..vm-1)
checkif enabled, check numeric value for validity before setting it. See checkNumericValue() method for details. An empty value is never accepted.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setNumericValueQualifier()

OFCondition DSRNumericMeasurementValue::setNumericValueQualifier ( const DSRCodedEntryValue valueQualifier,
const OFBool  check = OFTrue 
)

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 usually checked. If the code is invalid the current code is not replaced and remains unchanged.

Parameters
valueQualifiernumeric value qualifier to be set (optional). Use an empty code to remove the current value.
checkif enabled, check value for validity before setting it. See checkNumericValueQualifier() method for details.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setRationalRepresentation()

OFCondition DSRNumericMeasurementValue::setRationalRepresentation ( const Sint32  rationalNumerator,
const Uint32  rationalDenominator,
const OFBool  check = OFTrue 
)

set rational representation of the numeric value.

According to the DICOM standard, this value is "required if the numeric value has insufficient precision to represent a rational value as a string. May be present otherwise." Please note that it is not checked whether this representation is consistent with the numeric value stored as a string.

Parameters
rationalNumeratorinteger numerator of a rational representation of the numeric value (encoded as a signed integer value)
rationalDenominatorinteger denominator of a rational representation of the numeric value (encoded as a non-zero unsigned integer value)
checkif enabled, check values for validity before setting them. See checkRationalRepresentation() method for details.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setValue() [1/4]

OFCondition DSRNumericMeasurementValue::setValue ( const DSRNumericMeasurementValue numericMeasurement,
const OFBool  check = OFTrue 
)

set numeric measurement value.

Before setting the value, it is usually checked. If the value is invalid, the current value is not replaced and remains unchanged.

Parameters
numericMeasurementvalue to be set
checkif enabled, check value for validity before setting it. See checkXXX() methods for details. Empty values are only accepted for non-mandatory attributes.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setValue() [2/4]

OFCondition DSRNumericMeasurementValue::setValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit,
const OFBool  check = OFTrue 
)

set numeric value and measurement unit.

Before setting the values, they are usually checked. Please note that both values (i.e. 'numericValue' and 'measurementUnit') either have to be empty or non-empty. If the value pair is invalid, the current value pair is not replaced and remains unchanged. If the value pair is replaced, the optional floating point and rational representations are cleared, i.e. they have to be set manually if needed.

Parameters
numericValuenumeric value to be set (VR=DS, mandatory)
measurementUnitmeasurement unit to be set (mandatory)
checkif enabled, check values for validity before setting them. See checkXXX() methods for details.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setValue() [3/4]

OFCondition DSRNumericMeasurementValue::setValue ( const DSRCodedEntryValue valueQualifier,
const OFBool  check = OFTrue 
)

set empty numeric value and measurement unit with a numeric value qualifier.

Before setting the value, it is usually checked. If the value is invalid, the current numeric measurement value is not replaced and remains unchanged.

Parameters
valueQualifiernumeric value qualifier to be set. Used to specify the reason for the absence of the measured value sequence, i.e. why the numeric value and measurement unit are empty.
checkif enabled, check value for validity before setting it. See checkNumericValueQualifier() method for details.
Returns
status, EC_Normal if successful, an error code otherwise

◆ setValue() [4/4]

OFCondition DSRNumericMeasurementValue::setValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit,
const DSRCodedEntryValue valueQualifier,
const OFBool  check = OFTrue 
)

set numeric value, measurement unit and numeric value qualifier.

Before setting the values, they are usually checked. Please note that both 'numericValue' and 'measurementUnit' either have to be empty or non-empty. If one of the three values is invalid, the current numeric measurement value is not replaced and remains unchanged. If the values are replaced, the optional floating point and rational representations are cleared, i.e. they have to be set manually if needed.

Parameters
numericValuenumeric value to be set (VR=DS, mandatory)
measurementUnitmeasurement unit to be set (mandatory)
valueQualifiernumeric value qualifier to be set (optional). Can also be used to specify the reason for the absence of the measured value sequence (where 'numericValue' and 'measurementUnit' are stored). Use an empty code to remove the current value.
checkif enabled, check values for validity before setting them. See checkXXX() methods for details.
Returns
status, EC_Normal if successful, an error code otherwise

◆ writeItem()

virtual OFCondition DSRNumericMeasurementValue::writeItem ( DcmItem dataset) const
protectedvirtual

write numeric measurement value to dataset

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

◆ writeSequence()

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
datasetDICOM dataset to which the sequences should be written
Returns
status, EC_Normal if successful, an error code otherwise

◆ writeXML()

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

write numeric measurement value in XML format

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

Reimplemented in DSRNumTreeNode.


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


Generated on Mon Oct 28 2019 for DCMTK Version 3.6.5 by Doxygen 1.8.15