Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

dsrcodvl.h

00001 /*
00002  *
00003  *  Copyright (C) 2000-2003, OFFIS
00004  *
00005  *  This software and supporting documentation were developed by
00006  *
00007  *    Kuratorium OFFIS e.V.
00008  *    Healthcare Information and Communication Systems
00009  *    Escherweg 2
00010  *    D-26121 Oldenburg, Germany
00011  *
00012  *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY
00013  *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR
00014  *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR
00015  *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
00016  *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
00017  *
00018  *  Module: dcmsr
00019  *
00020  *  Author: Joerg Riesmeier
00021  *
00022  *  Purpose:
00023  *    classes: DSRCodedEntryValue
00024  *
00025  *  Last Update:      $Author: joergr $
00026  *  Update Date:      $Date: 2003/12/16 15:56:53 $
00027  *  CVS/RCS Revision: $Revision: 1.14 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 
00035 #ifndef DSRCODVL_H
00036 #define DSRCODVL_H
00037 
00038 #include "osconfig.h"   /* make sure OS specific configuration is included first */
00039 
00040 #include "dsrtypes.h"
00041 
00042 #include "ofstring.h"
00043 
00044 
00045 /*---------------------*
00046  *  class declaration  *
00047  *---------------------*/
00048 
00051 class DSRCodedEntryValue
00052 {
00053     // allow access to getValuePtr()
00054     friend class DSRContentItem;
00055 
00056   public:
00057 
00060     DSRCodedEntryValue();
00061 
00072     DSRCodedEntryValue(const OFString &codeValue,
00073                        const OFString &codingSchemeDesignator,
00074                        const OFString &codeMeaning);
00075 
00090     DSRCodedEntryValue(const OFString &codeValue,
00091                        const OFString &codingSchemeDesignator,
00092                        const OFString &codingSchemeVersion,
00093                        const OFString &codeMeaning);
00094 
00098     DSRCodedEntryValue(const DSRCodedEntryValue &codedEntryValue);
00099 
00102     virtual ~DSRCodedEntryValue();
00103 
00108     DSRCodedEntryValue &operator=(const DSRCodedEntryValue &codedEntryValue);
00109 
00116     OFBool operator==(const DSRCodedEntryValue &codedEntryValue) const;
00117 
00121     virtual void clear();
00122 
00127     virtual OFBool isValid() const;
00128 
00133     virtual OFBool isEmpty() const;
00134 
00146     void print(ostream &stream,
00147                const OFBool printCodeValue = OFTrue,
00148                const OFBool printInvalid = OFFalse) const;
00149 
00161     OFCondition readSequence(DcmItem &dataset,
00162                              const DcmTagKey &tagKey,
00163                              const OFString &type,
00164                              OFConsole *logStream);
00165 
00172     OFCondition writeSequence(DcmItem &dataset,
00173                               const DcmTagKey &tagKey,
00174                               OFConsole *logStream) const;
00175 
00181     OFCondition readXML(const DSRXMLDocument &doc,
00182                         DSRXMLCursor cursor);
00183 
00190     OFCondition writeXML(ostream &stream,
00191                          const size_t flags,
00192                          OFConsole *logStream) const;
00193 
00204     OFCondition renderHTML(ostream &stream,
00205                            const size_t flags,
00206                            OFConsole *logStream,
00207                            const OFBool fullCode = OFTrue,
00208                            const OFBool valueFirst = OFFalse) const;
00209 
00213     inline const DSRCodedEntryValue &getValue() const
00214     {
00215         return *this;
00216     }
00217 
00222     OFCondition getValue(DSRCodedEntryValue &codedEntryValue) const;
00223 
00228     inline const OFString &getCodeValue() const
00229     {
00230         return CodeValue;
00231     }
00232 
00240     inline const OFString &getCodingSchemeDesignator() const
00241     {
00242         return CodingSchemeDesignator;
00243     }
00244 
00250     inline const OFString &getCodingSchemeVersion() const
00251     {
00252         return CodingSchemeVersion;
00253     }
00254 
00260     inline const OFString &getCodeMeaning() const
00261     {
00262         return CodeMeaning;
00263     }
00264 
00271     OFCondition setValue(const DSRCodedEntryValue &codedEntryValue);
00272 
00289     OFCondition setCode(const OFString &codeValue,
00290                         const OFString &codingSchemeDesignator,
00291                         const OFString &codeMeaning);
00292 
00313     OFCondition setCode(const OFString &codeValue,
00314                         const OFString &codingSchemeDesignator,
00315                         const OFString &codingSchemeVersion,
00316                         const OFString &codeMeaning);
00317 
00318 
00319   protected:
00320 
00324     inline DSRCodedEntryValue *getValuePtr()
00325     {
00326         return this;
00327     }
00328 
00335     OFCondition readItem(DcmItem &dataset,
00336                          OFConsole *logStream,
00337                          const char *moduleName = NULL);
00338 
00344     OFCondition writeItem(DcmItem &dataset,
00345                           OFConsole *logStream) const;
00346 
00356     OFBool checkCode(const OFString &codeValue,
00357                      const OFString &codingSchemeDesignator,
00358                      const OFString &codeMeaning) const;
00359 
00360 
00361   private:
00362 
00364     OFString CodeValue;
00366     OFString CodingSchemeDesignator;
00368     OFString CodingSchemeVersion;
00370     OFString CodeMeaning;
00371 };
00372 
00373 
00374 #endif
00375 
00376 
00377 /*
00378  *  CVS/RCS Log:
00379  *  $Log: dsrcodvl.h,v $
00380  *  Revision 1.14  2003/12/16 15:56:53  joergr
00381  *  Added note on coding scheme identfication and private coding schemes.
00382  *
00383  *  Revision 1.13  2003/12/11 17:14:28  joergr
00384  *  Adapted documentation of print() method to new output format of CodingScheme
00385  *  Version (square brackets instead of comma to separate from CodingScheme).
00386  *
00387  *  Revision 1.12  2003/09/10 13:16:13  joergr
00388  *  Replaced PrivateCodingSchemeUID by new CodingSchemeIdenticationSequence as
00389  *  required by CP 324.
00390  *
00391  *  Revision 1.11  2003/08/07 17:31:00  joergr
00392  *  Removed libxml dependency from header files. Simplifies linking (MSVC).
00393  *
00394  *  Revision 1.10  2003/08/07 12:20:48  joergr
00395  *  Added readXML functionality.
00396  *
00397  *  Revision 1.9  2001/09/26 13:04:04  meichel
00398  *  Adapted dcmsr to class OFCondition
00399  *
00400  *  Revision 1.8  2001/06/01 15:50:59  meichel
00401  *  Updated copyright header
00402  *
00403  *  Revision 1.7  2000/11/09 20:32:07  joergr
00404  *  Added support for non-ASCII characters in HTML 3.2 (use numeric value).
00405  *
00406  *  Revision 1.6  2000/11/06 11:14:55  joergr
00407  *  Updated comments/formatting.
00408  *
00409  *  Revision 1.5  2000/11/01 16:12:55  joergr
00410  *  Added support for conversion to XML.
00411  *
00412  *  Revision 1.4  2000/10/23 15:08:33  joergr
00413  *  Added/updated doc++ comments.
00414  *
00415  *  Revision 1.3  2000/10/19 16:02:13  joergr
00416  *  Renamed some set methods.
00417  *  Added optional module name to read method to provide more detailed warning
00418  *  messages.
00419  *
00420  *  Revision 1.2  2000/10/18 17:00:29  joergr
00421  *  Added methods allowing direct access to certain content item values.
00422  *  Added doc++ comments.
00423  *
00424  *  Revision 1.1  2000/10/13 07:49:23  joergr
00425  *  Added new module 'dcmsr' providing access to DICOM structured reporting
00426  *  documents (supplement 23).  Doc++ documentation not yet completed.
00427  *
00428  *
00429  */


Generated on 26 Apr 2005 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.4.2