DCMTK  Version 3.6.9
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | List of all members
CMR_SRNumericMeasurementValue Class Reference

Class for SR numeric values and measurements (extended version with additional support of the DICOM Content Mapping Resource). More...

+ Inheritance diagram for CMR_SRNumericMeasurementValue:

Public Member Functions

 CMR_SRNumericMeasurementValue ()
 default constructor
 
 CMR_SRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const OFBool check=OFTrue)
 constructor More...
 
 CMR_SRNumericMeasurementValue (const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
 constructor More...
 
 CMR_SRNumericMeasurementValue (const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
 constructor More...
 
 CMR_SRNumericMeasurementValue (const CMR_SRNumericMeasurementValue &numericMeasurement)
 copy constructor More...
 
 CMR_SRNumericMeasurementValue (const DSRNumericMeasurementValue &numericMeasurement)
 copy constructor More...
 
virtual ~CMR_SRNumericMeasurementValue ()
 destructor
 
CMR_SRNumericMeasurementValueoperator= (const CMR_SRNumericMeasurementValue &numericMeasurement)
 assignment operator More...
 
OFCondition setValue (const CID42_NumericValueQualifier &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 CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
 set numeric value, measurement unit and numeric value qualifier. More...
 
OFCondition setNumericValueQualifier (const CID42_NumericValueQualifier &valueQualifier, const OFBool check=OFTrue)
 set numeric value qualifier. 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 setNumericValueQualifier (const DSRCodedEntryValue &valueQualifier, const OFBool check=OFTrue)
 set numeric value qualifier. More...
 
- Public Member Functions inherited from DSRNumericMeasurementValue
 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...
 
virtual void clear ()
 clear all internal variables. More...
 
OFBool isEqual (const DSRNumericMeasurementValue &numericMeasurement) const
 check whether values are "equal". More...
 
OFBool isNotEqual (const DSRNumericMeasurementValue &numericMeasurement) const
 check whether values are "not equal". 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 (conditional) More...
 
OFCondition getMeasurementUnit (DSRCodedEntryValue &measurementUnit) const
 get copy of measurement unit More...
 
OFCondition getNumericValueQualifier (DSRCodedEntryValue &valueQualifier) const
 get copy of numeric value qualifier (conditional) 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

virtual OFCondition checkNumericValueQualifier (const DSRCodedEntryValue &valueQualifier) const
 check the specified numeric value qualifier for validity. More...
 
- Protected Member Functions inherited from DSRNumericMeasurementValue
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 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...
 

Detailed Description

Class for SR numeric values and measurements (extended version with additional support of the DICOM Content Mapping Resource).

This class checks whether the optional value qualifier uses a coded entry from the Defined Context Group 42 (Numeric Value Qualifier), see DICOM PS 3.3 Table C.18.1-1.

Constructor & Destructor Documentation

◆ CMR_SRNumericMeasurementValue() [1/5]

CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue ( 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.

◆ CMR_SRNumericMeasurementValue() [2/5]

CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue ( const CID42_NumericValueQualifier valueQualifier,
const OFBool  check = OFTrue 
)

constructor

Parameters
valueQualifiercode representing the numeric value qualifier (mandatory). 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.

◆ CMR_SRNumericMeasurementValue() [3/5]

CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit,
const CID42_NumericValueQualifier 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)
checkif enabled, check values for validity before setting them. See corresponding setValue() method for details.

◆ CMR_SRNumericMeasurementValue() [4/5]

CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue ( const CMR_SRNumericMeasurementValue numericMeasurement)

copy constructor

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

◆ CMR_SRNumericMeasurementValue() [5/5]

CMR_SRNumericMeasurementValue::CMR_SRNumericMeasurementValue ( const DSRNumericMeasurementValue numericMeasurement)

copy constructor

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

Member Function Documentation

◆ checkNumericValueQualifier()

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

check the specified numeric value qualifier for validity.

In addition to DSRNumericMeasurementValue::checkNumericValueQualifier(), this method also checks the conformance with the Context Group 42 (see CID42_NumericValueQualifier).

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

Reimplemented from DSRNumericMeasurementValue.

◆ operator=()

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

assignment operator

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

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

◆ setNumericValueQualifier() [1/2]

OFCondition CMR_SRNumericMeasurementValue::setNumericValueQualifier ( const CID42_NumericValueQualifier 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 (conditional). 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

◆ setNumericValueQualifier() [2/2]

OFCondition DSRNumericMeasurementValue::setNumericValueQualifier

set numeric value qualifier.

This conditional 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 (conditional). 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

◆ setValue() [1/6]

OFCondition CMR_SRNumericMeasurementValue::setValue ( const CID42_NumericValueQualifier 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() [2/6]

OFCondition DSRNumericMeasurementValue::setValue

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. Shall be 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() [3/6]

OFCondition DSRNumericMeasurementValue::setValue

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

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

◆ setValue() [4/6]

OFCondition CMR_SRNumericMeasurementValue::setValue ( const OFString numericValue,
const DSRCodedEntryValue measurementUnit,
const CID42_NumericValueQualifier 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). 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

◆ setValue() [5/6]

OFCondition DSRNumericMeasurementValue::setValue

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

◆ setValue() [6/6]

OFCondition DSRNumericMeasurementValue::setValue

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

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


Generated on Wed Dec 11 2024 for DCMTK Version 3.6.9 by Doxygen 1.9.1