OFFIS DCMTK  Version 3.6.0
dcvrda.h
1 /*
2  *
3  * Copyright (C) 1994-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmdata
15  *
16  * Author: Gerd Ehlers, Andreas Barth, Joerg Riesmeier
17  *
18  * Purpose: Interface of class DcmDate
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-11-05 09:34:11 $
22  * CVS/RCS Revision: $Revision: 1.23 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DCVRDA_H
30 #define DCVRDA_H
31 
32 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
33 
34 #include "dcmtk/dcmdata/dcbytstr.h"
35 #include "dcmtk/ofstd/ofdate.h"
36 
37 
40 class DcmDate
41  : public DcmByteString
42 {
43 
44  public:
45 
51  DcmDate(const DcmTag &tag,
52  const Uint32 len = 0);
53 
57  DcmDate(const DcmDate &old);
58 
61  virtual ~DcmDate();
62 
67  DcmDate &operator=(const DcmDate &obj);
68 
72  virtual DcmObject *clone() const
73  {
74  return new DcmDate(*this);
75  }
76 
89  virtual OFCondition copyFrom(const DcmObject& rhs);
90 
94  virtual DcmEVR ident() const;
95 
103  virtual OFCondition checkValue(const OFString &vm = "1-n",
104  const OFBool oldFormat = OFFalse);
105 
112  virtual OFCondition getOFString(OFString &stringVal,
113  const unsigned long pos,
114  OFBool normalize = OFTrue);
115 
123 
128  OFCondition setOFDate(const OFDate &dateValue);
129 
139  OFCondition getOFDate(OFDate &dateValue,
140  const unsigned long pos = 0,
141  const OFBool supportOldFormat = OFTrue);
142 
154  const unsigned long pos = 0,
155  const OFBool supportOldFormat = OFTrue);
156 
157  /* --- static helper functions --- */
158 
166  static OFCondition getCurrentDate(OFString &dicomDate);
167 
175  static OFCondition getDicomDateFromOFDate(const OFDate &dateValue,
176  OFString &dicomDate);
177 
187  static OFCondition getOFDateFromString(const OFString &dicomDate,
188  OFDate &dateValue,
189  const OFBool supportOldFormat = OFTrue);
190 
201  static OFCondition getISOFormattedDateFromString(const OFString &dicomDate,
202  OFString &formattedDate,
203  const OFBool supportOldFormat = OFTrue);
204 
214  static OFCondition checkStringValue(const OFString &value,
215  const OFString &vm = "1-n",
216  const OFBool oldFormat = OFFalse);
217 };
218 
219 
220 #endif // DCVRDA_H
221 
222 
223 /*
224 ** CVS/RCS Log:
225 ** $Log: dcvrda.h,v $
226 ** Revision 1.23 2010-11-05 09:34:11 joergr
227 ** Added support for checking the value multiplicity "9" (see Supplement 131).
228 **
229 ** Revision 1.22 2010-10-14 13:15:42 joergr
230 ** Updated copyright header. Added reference to COPYRIGHT file.
231 **
232 ** Revision 1.21 2010-04-23 15:26:13 joergr
233 ** Specify an appropriate default value for the "vm" parameter of checkValue().
234 **
235 ** Revision 1.20 2010-04-23 14:25:27 joergr
236 ** Added new method to all VR classes which checks whether the stored value
237 ** conforms to the VR definition and to the specified VM.
238 **
239 ** Revision 1.19 2010-04-22 09:31:30 joergr
240 ** Revised misleading parameter documentation for the checkValue() method.
241 **
242 ** Revision 1.18 2010-04-22 08:59:10 joergr
243 ** Added support for further VM values ("1-8", "1-99", "16", "32") to be checked.
244 **
245 ** Revision 1.17 2010-03-01 09:08:45 uli
246 ** Removed some unnecessary include directives in the headers.
247 **
248 ** Revision 1.16 2009-08-03 09:05:30 joergr
249 ** Added methods that check whether a given string value conforms to the VR and
250 ** VM definitions of the DICOM standards.
251 **
252 ** Revision 1.15 2008-07-17 11:19:49 onken
253 ** Updated copyFrom() documentation.
254 **
255 ** Revision 1.14 2008-07-17 10:30:23 onken
256 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which
257 ** permits setting an instance's value from an existing object. Implemented
258 ** assignment operator where necessary.
259 **
260 ** Revision 1.13 2005-12-08 16:28:55 meichel
261 ** Changed include path schema for all DCMTK header files
262 **
263 ** Revision 1.12 2004/07/01 12:28:25 meichel
264 ** Introduced virtual clone method for DcmObject and derived classes.
265 **
266 ** Revision 1.11 2002/12/06 12:49:14 joergr
267 ** Enhanced "print()" function by re-working the implementation and replacing
268 ** the boolean "showFullData" parameter by a more general integer flag.
269 ** Added doc++ documentation.
270 ** Made source code formatting more consistent with other modules/files.
271 **
272 ** Revision 1.10 2002/04/11 12:25:09 joergr
273 ** Enhanced DICOM date, time and date/time classes. Added support for new
274 ** standard date and time functions.
275 **
276 ** Revision 1.9 2001/10/10 15:16:40 joergr
277 ** Added new flag to date/time routines allowing to choose whether the old
278 ** prior V3.0 format for the corresponding DICOM VRs is supported or not.
279 **
280 ** Revision 1.8 2001/10/01 15:01:38 joergr
281 ** Introduced new general purpose functions to get/set person names, date, time
282 ** and date/time.
283 **
284 ** Revision 1.7 2001/06/01 15:48:49 meichel
285 ** Updated copyright header
286 **
287 ** Revision 1.6 2000/03/08 16:26:22 meichel
288 ** Updated copyright header.
289 **
290 ** Revision 1.5 1999/03/31 09:24:58 meichel
291 ** Updated copyright header in module dcmdata
292 **
293 ** Revision 1.4 1998/11/12 16:47:47 meichel
294 ** Implemented operator= for all classes derived from DcmObject.
295 **
296 ** Revision 1.3 1996/01/05 13:23:04 andreas
297 ** - changed to support new streaming facilities
298 ** - more cleanups
299 ** - merged read / write methods for block and file transfer
300 **
301 */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2