📄 dsrnumvl.h
字号:
/* * * Copyright (C) 2000-2005, OFFIS * * This software and supporting documentation were developed by * * Kuratorium OFFIS e.V. * Healthcare Information and Communication Systems * Escherweg 2 * D-26121 Oldenburg, Germany * * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. * * Module: dcmsr * * Author: Joerg Riesmeier * * Purpose: * classes: DSRNumericMeasurementValue * * Last Update: $Author: meichel $ * Update Date: $Date: 2005/12/08 16:05:11 $ * CVS/RCS Revision: $Revision: 1.10 $ * Status: $State: Exp $ * * CVS/RCS Log at end of file * */#ifndef DSRNUMVL_H#define DSRNUMVL_H#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */#include "dcmtk/dcmsr/dsrcodvl.h"#include "dcmtk/ofstd/ofstring.h"/*---------------------* * class declaration * *---------------------*//** Class for numeric measurement values */class DSRNumericMeasurementValue{ // allow access to getValuePtr() friend class DSRContentItem; public: /** default constructor */ DSRNumericMeasurementValue(); /** constructor. * The code triple is only set if it passed the validity check (see setValue()). ** @param numericValue numeric measurement value. (VR=DS, type 1) * @param measurementUnit code representing the measurement name (code meaning) * and unit (code value). (type 2) */ DSRNumericMeasurementValue(const OFString &numericValue, const DSRCodedEntryValue &measurementUnit); /** constructor. * The two codes are only set if they passed the validity check (see setValue()). ** @param numericValue numeric measurement value. (VR=DS, type 1) * @param measurementUnit code representing the measurement name (code meaning) * and unit (code value). (type 2) * @param valueQualifier code representing the numeric value qualifier. (type 3) */ DSRNumericMeasurementValue(const OFString &numericValue, const DSRCodedEntryValue &measurementUnit, const DSRCodedEntryValue &valueQualifier); /** copy constructor ** @param numericMeasurement numeric measurement value to be copied (not checked !) */ DSRNumericMeasurementValue(const DSRNumericMeasurementValue &numericMeasurement); /** destructor */ virtual ~DSRNumericMeasurementValue(); /** assignment operator ** @param numericMeasurement numeric measurement value to be copied (not checked !) ** @return reference to this numeric value after 'numericMeasurement' has been copied */ DSRNumericMeasurementValue &operator=(const DSRNumericMeasurementValue &numericMeasurement); /** clear all internal variables. * Use this method to create an empty numeric measurement value. */ virtual void clear(); /** 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). ** @return OFTrue if value is valid, OFFalse otherwise */ virtual OFBool isValid() const; /** check whether the current numeric measurement value is empty. * Checks whether both the numeric value and the measurement unit are empty. ** @return OFTrue if value is empty, OFFalse otherwise */ virtual OFBool isEmpty() const; /** 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. ** @param stream output stream to which the numeric measurement value should be printed * @param flags flag used to customize the output (not used) ** @return status, EC_Normal if successful, an error code otherwise */ virtual OFCondition print(ostream &stream, const size_t flags) const; /** read numeric measurement value from XML document ** @param doc document containing the XML file content * @param cursor cursor pointing to the starting node ** @return status, EC_Normal if successful, an error code otherwise */ virtual OFCondition readXML(const DSRXMLDocument &doc, DSRXMLCursor cursor); /** write numeric measurement value in XML format ** @param stream output stream to which the XML document is written * @param flags flag used to customize the output (see DSRTypes::XF_xxx) * @param logStream pointer to error/warning output stream (output disabled if NULL) ** @return status, EC_Normal if successful, an error code otherwise */ virtual OFCondition writeXML(ostream &stream, const size_t flags, OFConsole *logStream) const; /** 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. ** @param dataset DICOM dataset from which the sequences should be read * @param logStream pointer to error/warning output stream (output disabled if NULL) ** @return status, EC_Normal if successful, an error code otherwise */ virtual OFCondition readSequence(DcmItem &dataset, OFConsole *logStream); /** 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. ** @param dataset DICOM dataset to which the sequences should be written * @param logStream pointer to error/warning output stream (output disabled if NULL) ** @return status, EC_Normal if successful, an error code otherwise */ virtual OFCondition writeSequence(DcmItem &dataset, OFConsole *logStream) const; /** render numeric measurement value in HTML format ** @param docStream output stream to which the main HTML document is written * @param annexStream output stream to which the HTML document annex is written * @param 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. * @param flags flag used to customize the output (see DSRTypes::HF_xxx) * @param logStream pointer to error/warning output stream (output disabled if NULL) ** @return status, EC_Normal if successful, an error code otherwise */ virtual OFCondition renderHTML(ostream &docStream, ostream &annexStream, size_t &annexNumber, const size_t flags, OFConsole *logStream) const; /** get reference to numeric measurement value ** @return reference to numeric measurement value */ inline const DSRNumericMeasurementValue &getValue() const { return *this; } /** get copy of numeric measurement value ** @param numericMeasurement reference to variable in which the value should be stored ** @return status, EC_Normal if successful, an error code otherwise */ OFCondition getValue(DSRNumericMeasurementValue &numericMeasurement) const; /** get numeric value ** @return current numeric value (might be invalid or an empty string) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -