00001 /* 00002 * 00003 * Copyright (C) 1994-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: dcmdata 00015 * 00016 * Author: Gerd Ehlers, Andreas Barth, Joerg Riesmeier 00017 * 00018 * Purpose: Interface of class DcmDate 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-11-05 09:34:11 $ 00022 * CVS/RCS Revision: $Revision: 1.23 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 #ifndef DCVRDA_H 00030 #define DCVRDA_H 00031 00032 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00033 00034 #include "dcmtk/dcmdata/dcbytstr.h" 00035 #include "dcmtk/ofstd/ofdate.h" 00036 00037 00040 class DcmDate 00041 : public DcmByteString 00042 { 00043 00044 public: 00045 00051 DcmDate(const DcmTag &tag, 00052 const Uint32 len = 0); 00053 00057 DcmDate(const DcmDate &old); 00058 00061 virtual ~DcmDate(); 00062 00067 DcmDate &operator=(const DcmDate &obj); 00068 00072 virtual DcmObject *clone() const 00073 { 00074 return new DcmDate(*this); 00075 } 00076 00089 virtual OFCondition copyFrom(const DcmObject& rhs); 00090 00094 virtual DcmEVR ident() const; 00095 00103 virtual OFCondition checkValue(const OFString &vm = "1-n", 00104 const OFBool oldFormat = OFFalse); 00105 00112 virtual OFCondition getOFString(OFString &stringVal, 00113 const unsigned long pos, 00114 OFBool normalize = OFTrue); 00115 00122 OFCondition setCurrentDate(); 00123 00128 OFCondition setOFDate(const OFDate &dateValue); 00129 00139 OFCondition getOFDate(OFDate &dateValue, 00140 const unsigned long pos = 0, 00141 const OFBool supportOldFormat = OFTrue); 00142 00153 OFCondition getISOFormattedDate(OFString &formattedDate, 00154 const unsigned long pos = 0, 00155 const OFBool supportOldFormat = OFTrue); 00156 00157 /* --- static helper functions --- */ 00158 00166 static OFCondition getCurrentDate(OFString &dicomDate); 00167 00175 static OFCondition getDicomDateFromOFDate(const OFDate &dateValue, 00176 OFString &dicomDate); 00177 00187 static OFCondition getOFDateFromString(const OFString &dicomDate, 00188 OFDate &dateValue, 00189 const OFBool supportOldFormat = OFTrue); 00190 00201 static OFCondition getISOFormattedDateFromString(const OFString &dicomDate, 00202 OFString &formattedDate, 00203 const OFBool supportOldFormat = OFTrue); 00204 00214 static OFCondition checkStringValue(const OFString &value, 00215 const OFString &vm = "1-n", 00216 const OFBool oldFormat = OFFalse); 00217 }; 00218 00219 00220 #endif // DCVRDA_H 00221 00222 00223 /* 00224 ** CVS/RCS Log: 00225 ** $Log: dcvrda.h,v $ 00226 ** Revision 1.23 2010-11-05 09:34:11 joergr 00227 ** Added support for checking the value multiplicity "9" (see Supplement 131). 00228 ** 00229 ** Revision 1.22 2010-10-14 13:15:42 joergr 00230 ** Updated copyright header. Added reference to COPYRIGHT file. 00231 ** 00232 ** Revision 1.21 2010-04-23 15:26:13 joergr 00233 ** Specify an appropriate default value for the "vm" parameter of checkValue(). 00234 ** 00235 ** Revision 1.20 2010-04-23 14:25:27 joergr 00236 ** Added new method to all VR classes which checks whether the stored value 00237 ** conforms to the VR definition and to the specified VM. 00238 ** 00239 ** Revision 1.19 2010-04-22 09:31:30 joergr 00240 ** Revised misleading parameter documentation for the checkValue() method. 00241 ** 00242 ** Revision 1.18 2010-04-22 08:59:10 joergr 00243 ** Added support for further VM values ("1-8", "1-99", "16", "32") to be checked. 00244 ** 00245 ** Revision 1.17 2010-03-01 09:08:45 uli 00246 ** Removed some unnecessary include directives in the headers. 00247 ** 00248 ** Revision 1.16 2009-08-03 09:05:30 joergr 00249 ** Added methods that check whether a given string value conforms to the VR and 00250 ** VM definitions of the DICOM standards. 00251 ** 00252 ** Revision 1.15 2008-07-17 11:19:49 onken 00253 ** Updated copyFrom() documentation. 00254 ** 00255 ** Revision 1.14 2008-07-17 10:30:23 onken 00256 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which 00257 ** permits setting an instance's value from an existing object. Implemented 00258 ** assignment operator where necessary. 00259 ** 00260 ** Revision 1.13 2005-12-08 16:28:55 meichel 00261 ** Changed include path schema for all DCMTK header files 00262 ** 00263 ** Revision 1.12 2004/07/01 12:28:25 meichel 00264 ** Introduced virtual clone method for DcmObject and derived classes. 00265 ** 00266 ** Revision 1.11 2002/12/06 12:49:14 joergr 00267 ** Enhanced "print()" function by re-working the implementation and replacing 00268 ** the boolean "showFullData" parameter by a more general integer flag. 00269 ** Added doc++ documentation. 00270 ** Made source code formatting more consistent with other modules/files. 00271 ** 00272 ** Revision 1.10 2002/04/11 12:25:09 joergr 00273 ** Enhanced DICOM date, time and date/time classes. Added support for new 00274 ** standard date and time functions. 00275 ** 00276 ** Revision 1.9 2001/10/10 15:16:40 joergr 00277 ** Added new flag to date/time routines allowing to choose whether the old 00278 ** prior V3.0 format for the corresponding DICOM VRs is supported or not. 00279 ** 00280 ** Revision 1.8 2001/10/01 15:01:38 joergr 00281 ** Introduced new general purpose functions to get/set person names, date, time 00282 ** and date/time. 00283 ** 00284 ** Revision 1.7 2001/06/01 15:48:49 meichel 00285 ** Updated copyright header 00286 ** 00287 ** Revision 1.6 2000/03/08 16:26:22 meichel 00288 ** Updated copyright header. 00289 ** 00290 ** Revision 1.5 1999/03/31 09:24:58 meichel 00291 ** Updated copyright header in module dcmdata 00292 ** 00293 ** Revision 1.4 1998/11/12 16:47:47 meichel 00294 ** Implemented operator= for all classes derived from DcmObject. 00295 ** 00296 ** Revision 1.3 1996/01/05 13:23:04 andreas 00297 ** - changed to support new streaming facilities 00298 ** - more cleanups 00299 ** - merged read / write methods for block and file transfer 00300 ** 00301 */