dsrcodvl.h

00001 /*
00002  *
00003  *  Copyright (C) 2000-2005, 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: meichel $
00026  *  Update Date:      $Date: 2005/12/08 16:04:52 $
00027  *  CVS/RCS Revision: $Revision: 1.16 $
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 "dcmtk/config/osconfig.h"   /* make sure OS specific configuration is included first */
00039 
00040 #include "dcmtk/dcmsr/dsrtypes.h"
00041 
00042 #include "dcmtk/ofstd/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 
00321     OFBool valueContainsExtendedCharacters() const;
00322 
00323   protected:
00324 
00328     inline DSRCodedEntryValue *getValuePtr()
00329     {
00330         return this;
00331     }
00332 
00339     OFCondition readItem(DcmItem &dataset,
00340                          OFConsole *logStream,
00341                          const char *moduleName = NULL);
00342 
00348     OFCondition writeItem(DcmItem &dataset,
00349                           OFConsole *logStream) const;
00350 
00360     OFBool checkCode(const OFString &codeValue,
00361                      const OFString &codingSchemeDesignator,
00362                      const OFString &codeMeaning) const;
00363 
00364 
00365   private:
00366 
00368     OFString CodeValue;
00370     OFString CodingSchemeDesignator;
00372     OFString CodingSchemeVersion;
00374     OFString CodeMeaning;
00375 };
00376 
00377 
00378 #endif
00379 
00380 
00381 /*
00382  *  CVS/RCS Log:
00383  *  $Log: dsrcodvl.h,v $
00384  *  Revision 1.16  2005/12/08 16:04:52  meichel
00385  *  Changed include path schema for all DCMTK header files
00386  *
00387  *  Revision 1.15  2004/11/22 16:39:09  meichel
00388  *  Added method that checks if the SR document contains non-ASCII characters
00389  *    in any of the strings affected by SpecificCharacterSet.
00390  *
00391  *  Revision 1.14  2003/12/16 15:56:53  joergr
00392  *  Added note on coding scheme identfication and private coding schemes.
00393  *
00394  *  Revision 1.13  2003/12/11 17:14:28  joergr
00395  *  Adapted documentation of print() method to new output format of CodingScheme
00396  *  Version (square brackets instead of comma to separate from CodingScheme).
00397  *
00398  *  Revision 1.12  2003/09/10 13:16:13  joergr
00399  *  Replaced PrivateCodingSchemeUID by new CodingSchemeIdenticationSequence as
00400  *  required by CP 324.
00401  *
00402  *  Revision 1.11  2003/08/07 17:31:00  joergr
00403  *  Removed libxml dependency from header files. Simplifies linking (MSVC).
00404  *
00405  *  Revision 1.10  2003/08/07 12:20:48  joergr
00406  *  Added readXML functionality.
00407  *
00408  *  Revision 1.9  2001/09/26 13:04:04  meichel
00409  *  Adapted dcmsr to class OFCondition
00410  *
00411  *  Revision 1.8  2001/06/01 15:50:59  meichel
00412  *  Updated copyright header
00413  *
00414  *  Revision 1.7  2000/11/09 20:32:07  joergr
00415  *  Added support for non-ASCII characters in HTML 3.2 (use numeric value).
00416  *
00417  *  Revision 1.6  2000/11/06 11:14:55  joergr
00418  *  Updated comments/formatting.
00419  *
00420  *  Revision 1.5  2000/11/01 16:12:55  joergr
00421  *  Added support for conversion to XML.
00422  *
00423  *  Revision 1.4  2000/10/23 15:08:33  joergr
00424  *  Added/updated doc++ comments.
00425  *
00426  *  Revision 1.3  2000/10/19 16:02:13  joergr
00427  *  Renamed some set methods.
00428  *  Added optional module name to read method to provide more detailed warning
00429  *  messages.
00430  *
00431  *  Revision 1.2  2000/10/18 17:00:29  joergr
00432  *  Added methods allowing direct access to certain content item values.
00433  *  Added doc++ comments.
00434  *
00435  *  Revision 1.1  2000/10/13 07:49:23  joergr
00436  *  Added new module 'dcmsr' providing access to DICOM structured reporting
00437  *  documents (supplement 23).  Doc++ documentation not yet completed.
00438  *
00439  *
00440  */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5