dcmsr/include/dcmtk/dcmsr/dsrcodvl.h

00001 /*
00002  *
00003  *  Copyright (C) 2000-2010, OFFIS e.V.
00004  *  All rights reserved.  See COPYRIGHT file for details.
00005  *
00006  *  This software and supporting documentation were developed by
00007  *
00008  *    OFFIS e.V.
00009  *    R&D Division Health
00010  *    Escherweg 2
00011  *    D-26121 Oldenburg, Germany
00012  *
00013  *
00014  *  Module: dcmsr
00015  *
00016  *  Author: Joerg Riesmeier
00017  *
00018  *  Purpose:
00019  *    classes: DSRCodedEntryValue
00020  *
00021  *  Last Update:      $Author: joergr $
00022  *  Update Date:      $Date: 2010-10-14 13:16:32 $
00023  *  CVS/RCS Revision: $Revision: 1.21 $
00024  *  Status:           $State: Exp $
00025  *
00026  *  CVS/RCS Log at end of file
00027  *
00028  */
00029 
00030 
00031 #ifndef DSRCODVL_H
00032 #define DSRCODVL_H
00033 
00034 #include "dcmtk/config/osconfig.h"   /* make sure OS specific configuration is included first */
00035 
00036 #include "dcmtk/dcmsr/dsrtypes.h"
00037 
00038 #include "dcmtk/ofstd/ofstring.h"
00039 
00040 
00041 /*---------------------*
00042  *  class declaration  *
00043  *---------------------*/
00044 
00047 class DSRCodedEntryValue
00048 {
00049     // allow access to getValuePtr()
00050     friend class DSRContentItem;
00051 
00052   public:
00053 
00056     DSRCodedEntryValue();
00057 
00068     DSRCodedEntryValue(const OFString &codeValue,
00069                        const OFString &codingSchemeDesignator,
00070                        const OFString &codeMeaning);
00071 
00086     DSRCodedEntryValue(const OFString &codeValue,
00087                        const OFString &codingSchemeDesignator,
00088                        const OFString &codingSchemeVersion,
00089                        const OFString &codeMeaning);
00090 
00094     DSRCodedEntryValue(const DSRCodedEntryValue &codedEntryValue);
00095 
00098     virtual ~DSRCodedEntryValue();
00099 
00104     DSRCodedEntryValue &operator=(const DSRCodedEntryValue &codedEntryValue);
00105 
00112     OFBool operator==(const DSRCodedEntryValue &codedEntryValue) const;
00113 
00117     virtual void clear();
00118 
00123     virtual OFBool isValid() const;
00124 
00129     virtual OFBool isEmpty() const;
00130 
00142     void print(STD_NAMESPACE ostream &stream,
00143                const OFBool printCodeValue = OFTrue,
00144                const OFBool printInvalid = OFFalse) const;
00145 
00156     OFCondition readSequence(DcmItem &dataset,
00157                              const DcmTagKey &tagKey,
00158                              const OFString &type);
00159 
00165     OFCondition writeSequence(DcmItem &dataset,
00166                               const DcmTagKey &tagKey) const;
00167 
00173     OFCondition readXML(const DSRXMLDocument &doc,
00174                         DSRXMLCursor cursor);
00175 
00181     OFCondition writeXML(STD_NAMESPACE ostream &stream,
00182                          const size_t flags) const;
00183 
00193     OFCondition renderHTML(STD_NAMESPACE ostream &stream,
00194                            const size_t flags,
00195                            const OFBool fullCode = OFTrue,
00196                            const OFBool valueFirst = OFFalse) const;
00197 
00201     inline const DSRCodedEntryValue &getValue() const
00202     {
00203         return *this;
00204     }
00205 
00210     OFCondition getValue(DSRCodedEntryValue &codedEntryValue) const;
00211 
00216     inline const OFString &getCodeValue() const
00217     {
00218         return CodeValue;
00219     }
00220 
00228     inline const OFString &getCodingSchemeDesignator() const
00229     {
00230         return CodingSchemeDesignator;
00231     }
00232 
00238     inline const OFString &getCodingSchemeVersion() const
00239     {
00240         return CodingSchemeVersion;
00241     }
00242 
00248     inline const OFString &getCodeMeaning() const
00249     {
00250         return CodeMeaning;
00251     }
00252 
00259     OFCondition setValue(const DSRCodedEntryValue &codedEntryValue);
00260 
00277     OFCondition setCode(const OFString &codeValue,
00278                         const OFString &codingSchemeDesignator,
00279                         const OFString &codeMeaning);
00280 
00301     OFCondition setCode(const OFString &codeValue,
00302                         const OFString &codingSchemeDesignator,
00303                         const OFString &codingSchemeVersion,
00304                         const OFString &codeMeaning);
00305 
00306 
00307   protected:
00308 
00312     inline DSRCodedEntryValue *getValuePtr()
00313     {
00314         return this;
00315     }
00316 
00322     OFCondition readItem(DcmItem &dataset,
00323                          const char *moduleName = NULL);
00324 
00329     OFCondition writeItem(DcmItem &dataset) const;
00330 
00340     OFBool checkCode(const OFString &codeValue,
00341                      const OFString &codingSchemeDesignator,
00342                      const OFString &codeMeaning) const;
00343 
00344 
00345   private:
00346 
00348     OFString CodeValue;
00350     OFString CodingSchemeDesignator;
00352     OFString CodingSchemeVersion;
00354     OFString CodeMeaning;
00355 };
00356 
00357 
00358 #endif
00359 
00360 
00361 /*
00362  *  CVS/RCS Log:
00363  *  $Log: dsrcodvl.h,v $
00364  *  Revision 1.21  2010-10-14 13:16:32  joergr
00365  *  Updated copyright header. Added reference to COPYRIGHT file.
00366  *
00367  *  Revision 1.20  2009-10-13 14:57:50  uli
00368  *  Switched to logging mechanism provided by the "new" oflog module.
00369  *
00370  *  Revision 1.19  2007-11-15 16:33:30  joergr
00371  *  Added support for output in XHTML 1.1 format.
00372  *
00373  *  Revision 1.18  2006/08/15 16:40:03  meichel
00374  *  Updated the code in module dcmsr to correctly compile when
00375  *    all standard C++ classes remain in namespace std.
00376  *
00377  *  Revision 1.17  2006/05/11 09:18:21  joergr
00378  *  Moved containsExtendedCharacters() from dcmsr to dcmdata module.
00379  *
00380  *  Revision 1.16  2005/12/08 16:04:52  meichel
00381  *  Changed include path schema for all DCMTK header files
00382  *
00383  *  Revision 1.15  2004/11/22 16:39:09  meichel
00384  *  Added method that checks if the SR document contains non-ASCII characters
00385  *    in any of the strings affected by SpecificCharacterSet.
00386  *
00387  *  Revision 1.14  2003/12/16 15:56:53  joergr
00388  *  Added note on coding scheme identfication and private coding schemes.
00389  *
00390  *  Revision 1.13  2003/12/11 17:14:28  joergr
00391  *  Adapted documentation of print() method to new output format of CodingScheme
00392  *  Version (square brackets instead of comma to separate from CodingScheme).
00393  *
00394  *  Revision 1.12  2003/09/10 13:16:13  joergr
00395  *  Replaced PrivateCodingSchemeUID by new CodingSchemeIdenticationSequence as
00396  *  required by CP 324.
00397  *
00398  *  Revision 1.11  2003/08/07 17:31:00  joergr
00399  *  Removed libxml dependency from header files. Simplifies linking (MSVC).
00400  *
00401  *  Revision 1.10  2003/08/07 12:20:48  joergr
00402  *  Added readXML functionality.
00403  *
00404  *  Revision 1.9  2001/09/26 13:04:04  meichel
00405  *  Adapted dcmsr to class OFCondition
00406  *
00407  *  Revision 1.8  2001/06/01 15:50:59  meichel
00408  *  Updated copyright header
00409  *
00410  *  Revision 1.7  2000/11/09 20:32:07  joergr
00411  *  Added support for non-ASCII characters in HTML 3.2 (use numeric value).
00412  *
00413  *  Revision 1.6  2000/11/06 11:14:55  joergr
00414  *  Updated comments/formatting.
00415  *
00416  *  Revision 1.5  2000/11/01 16:12:55  joergr
00417  *  Added support for conversion to XML.
00418  *
00419  *  Revision 1.4  2000/10/23 15:08:33  joergr
00420  *  Added/updated doc++ comments.
00421  *
00422  *  Revision 1.3  2000/10/19 16:02:13  joergr
00423  *  Renamed some set methods.
00424  *  Added optional module name to read method to provide more detailed warning
00425  *  messages.
00426  *
00427  *  Revision 1.2  2000/10/18 17:00:29  joergr
00428  *  Added methods allowing direct access to certain content item values.
00429  *  Added doc++ comments.
00430  *
00431  *  Revision 1.1  2000/10/13 07:49:23  joergr
00432  *  Added new module 'dcmsr' providing access to DICOM structured reporting
00433  *  documents (supplement 23).  Doc++ documentation not yet completed.
00434  *
00435  *
00436  */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1