OFFIS DCMTK  Version 3.6.0
dcvrpn.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
17  *
18  * Purpose: Interface of class DcmPersonName
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-11-05 09:34:11 $
22  * CVS/RCS Revision: $Revision: 1.26 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DCVRPN_H
31 #define DCVRPN_H
32 
33 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
34 
35 #include "dcmtk/dcmdata/dcchrstr.h"
36 
37 
41  : public DcmCharString
42 {
43 
44  public:
45 
51  DcmPersonName(const DcmTag &tag,
52  const Uint32 len = 0);
53 
57  DcmPersonName(const DcmPersonName &old);
58 
61  virtual ~DcmPersonName();
62 
68 
72  virtual DcmObject *clone() const
73  {
74  return new DcmPersonName(*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 
137  OFString &firstName,
138  OFString &middleName,
139  OFString &namePrefix,
140  OFString &nameSuffix,
141  const unsigned long pos = 0,
142  const unsigned int componentGroup = 0);
143 
154  OFCondition getFormattedName(OFString &formattedName,
155  const unsigned long pos = 0,
156  const unsigned int componentGroup = 0);
157 
158 
170  OFCondition putNameComponents(const OFString &lastName,
171  const OFString &firstName,
172  const OFString &middleName,
173  const OFString &namePrefix,
174  const OFString &nameSuffix);
175 
176  /* --- static helper functions --- */
177 
198  static OFCondition getNameComponentsFromString(const OFString &dicomName,
199  OFString &lastName,
200  OFString &firstName,
201  OFString &middleName,
202  OFString &namePrefix,
203  OFString &nameSuffix,
204  const unsigned int componentGroup = 0);
205 
216  static OFCondition getFormattedNameFromString(const OFString &dicomName,
217  OFString &formattedName,
218  const unsigned int componentGroup = 0);
219 
232  static OFCondition getFormattedNameFromComponents(const OFString &lastName,
233  const OFString &firstName,
234  const OFString &middleName,
235  const OFString &namePrefix,
236  const OFString &nameSuffix,
237  OFString &formattedName);
238 
251  static OFCondition getStringFromNameComponents(const OFString &lastName,
252  const OFString &firstName,
253  const OFString &middleName,
254  const OFString &namePrefix,
255  const OFString &nameSuffix,
256  OFString &dicomName);
257 
267  static OFCondition checkStringValue(const OFString &value,
268  const OFString &vm = "1-n",
269  const OFBool oldFormat = OFTrue);
270 };
271 
272 
273 #endif // DCVRPN_H
274 
275 
276 /*
277 ** CVS/RCS Log:
278 ** $Log: dcvrpn.h,v $
279 ** Revision 1.26 2010-11-05 09:34:11 joergr
280 ** Added support for checking the value multiplicity "9" (see Supplement 131).
281 **
282 ** Revision 1.25 2010-10-14 13:15:43 joergr
283 ** Updated copyright header. Added reference to COPYRIGHT file.
284 **
285 ** Revision 1.24 2010-04-23 15:26:13 joergr
286 ** Specify an appropriate default value for the "vm" parameter of checkValue().
287 **
288 ** Revision 1.23 2010-04-23 14:25:27 joergr
289 ** Added new method to all VR classes which checks whether the stored value
290 ** conforms to the VR definition and to the specified VM.
291 **
292 ** Revision 1.22 2010-04-22 09:31:30 joergr
293 ** Revised misleading parameter documentation for the checkValue() method.
294 **
295 ** Revision 1.21 2010-04-22 08:59:10 joergr
296 ** Added support for further VM values ("1-8", "1-99", "16", "32") to be checked.
297 **
298 ** Revision 1.20 2009-08-03 09:05:30 joergr
299 ** Added methods that check whether a given string value conforms to the VR and
300 ** VM definitions of the DICOM standards.
301 **
302 ** Revision 1.19 2008-07-17 11:19:49 onken
303 ** Updated copyFrom() documentation.
304 **
305 ** Revision 1.18 2008-07-17 10:30:23 onken
306 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which
307 ** permits setting an instance's value from an existing object. Implemented
308 ** assignment operator where necessary.
309 **
310 ** Revision 1.17 2005-12-08 16:29:05 meichel
311 ** Changed include path schema for all DCMTK header files
312 **
313 ** Revision 1.16 2004/07/01 12:28:25 meichel
314 ** Introduced virtual clone method for DcmObject and derived classes.
315 **
316 ** Revision 1.15 2003/05/20 08:56:20 joergr
317 ** Added methods and static functions to compose a DICOM Person Name from five
318 ** name components.
319 **
320 ** Revision 1.14 2002/12/06 12:49:17 joergr
321 ** Enhanced "print()" function by re-working the implementation and replacing
322 ** the boolean "showFullData" parameter by a more general integer flag.
323 ** Added doc++ documentation.
324 ** Made source code formatting more consistent with other modules/files.
325 **
326 ** Revision 1.13 2002/04/25 09:56:19 joergr
327 ** Removed getOFStringArray() implementation.
328 **
329 ** Revision 1.12 2001/10/10 15:17:38 joergr
330 ** Updated comments.
331 **
332 ** Revision 1.11 2001/10/01 15:01:39 joergr
333 ** Introduced new general purpose functions to get/set person names, date, time
334 ** and date/time.
335 **
336 ** Revision 1.10 2001/09/25 17:19:33 meichel
337 ** Adapted dcmdata to class OFCondition
338 **
339 ** Revision 1.9 2001/06/01 15:48:51 meichel
340 ** Updated copyright header
341 **
342 ** Revision 1.8 2000/03/08 16:26:25 meichel
343 ** Updated copyright header.
344 **
345 ** Revision 1.7 1999/03/31 09:25:04 meichel
346 ** Updated copyright header in module dcmdata
347 **
348 ** Revision 1.6 1998/11/12 16:47:52 meichel
349 ** Implemented operator= for all classes derived from DcmObject.
350 **
351 ** Revision 1.5 1997/09/11 15:13:16 hewett
352 ** Modified getOFString method arguments by removing a default value
353 ** for the pos argument. By requiring the pos argument to be provided
354 ** ensures that callers realise getOFString only gets one component of
355 ** a multi-valued string.
356 **
357 ** Revision 1.4 1997/08/29 08:32:43 andreas
358 ** - Added methods getOFString and getOFStringArray for all
359 ** string VRs. These methods are able to normalise the value, i. e.
360 ** to remove leading and trailing spaces. This will be done only if
361 ** it is described in the standard that these spaces are not relevant.
362 ** These methods do not test the strings for conformance, this means
363 ** especially that they do not delete spaces where they are not allowed!
364 ** getOFStringArray returns the string with all its parts separated by \
365 ** and getOFString returns only one value of the string.
366 ** CAUTION: Currently getString returns a string with trailing
367 ** spaces removed (if dcmEnableAutomaticInputDataCorrection == OFTrue) and
368 ** truncates the original string (since it is not copied!). If you rely on this
369 ** behaviour please change your application now.
370 ** Future changes will ensure that getString returns the original
371 ** string from the DICOM object (NULL terminated) inclusive padding.
372 ** Currently, if you call getOF... before calling getString without
373 ** normalisation, you can get the original string read from the DICOM object.
374 **
375 ** Revision 1.3 1996/01/05 13:23:08 andreas
376 ** - changed to support new streaming facilities
377 ** - more cleanups
378 ** - merged read / write methods for block and file transfer
379 **
380 */


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