Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

dcvrpn.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-2003, 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:  dcmdata
00019  *
00020  *  Author:  Gerd Ehlers
00021  *
00022  *  Purpose: Interface of class DcmPersonName
00023  *
00024  *  Last Update:      $Author: joergr $
00025  *  Update Date:      $Date: 2003/05/20 08:56:20 $
00026  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcvrpn.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.15 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 
00035 #ifndef DCVRPN_H
00036 #define DCVRPN_H
00037 
00038 #include "osconfig.h"    /* make sure OS specific configuration is included first */
00039 
00040 #include "dcchrstr.h"
00041 
00042 
00045 class DcmPersonName
00046   : public DcmCharString
00047 {
00048 
00049   public:
00050 
00056     DcmPersonName(const DcmTag &tag,
00057                   const Uint32 len = 0);
00058 
00062     DcmPersonName(const DcmPersonName &old);
00063 
00066     virtual ~DcmPersonName();
00067 
00072     DcmPersonName &operator=(const DcmPersonName &obj);
00073 
00077     virtual DcmEVR ident() const;
00078 
00085     virtual OFCondition getOFString(OFString &stringVal,
00086                                     const unsigned long pos,
00087                                     OFBool normalize = OFTrue);
00088 
00109     OFCondition getNameComponents(OFString &lastName,
00110                                   OFString &firstName,
00111                                   OFString &middleName,
00112                                   OFString &namePrefix,
00113                                   OFString &nameSuffix,
00114                                   const unsigned long pos = 0,
00115                                   const unsigned int componentGroup = 0);
00116 
00127     OFCondition getFormattedName(OFString &formattedName,
00128                                  const unsigned long pos = 0,
00129                                  const unsigned int componentGroup = 0);
00130 
00131 
00143     OFCondition putNameComponents(const OFString &lastName,
00144                                   const OFString &firstName,
00145                                   const OFString &middleName,
00146                                   const OFString &namePrefix,
00147                                   const OFString &nameSuffix);
00148 
00149     /* --- static helper functions --- */
00150 
00171     static OFCondition getNameComponentsFromString(const OFString &dicomName,
00172                                                    OFString &lastName,
00173                                                    OFString &firstName,
00174                                                    OFString &middleName,
00175                                                    OFString &namePrefix,
00176                                                    OFString &nameSuffix,
00177                                                    const unsigned int componentGroup = 0);
00178 
00189     static OFCondition getFormattedNameFromString(const OFString &dicomName,
00190                                                   OFString &formattedName,
00191                                                   const unsigned int componentGroup = 0);
00192 
00205     static OFCondition getFormattedNameFromComponents(const OFString &lastName,
00206                                                       const OFString &firstName,
00207                                                       const OFString &middleName,
00208                                                       const OFString &namePrefix,
00209                                                       const OFString &nameSuffix,
00210                                                       OFString &formattedName);
00211 
00224     static OFCondition getStringFromNameComponents(const OFString &lastName,
00225                                                    const OFString &firstName,
00226                                                    const OFString &middleName,
00227                                                    const OFString &namePrefix,
00228                                                    const OFString &nameSuffix,
00229                                                    OFString &dicomName);
00230 };
00231 
00232 
00233 #endif // DCVRPN_H
00234 
00235 
00236 /*
00237 ** CVS/RCS Log:
00238 ** $Log: dcvrpn.h,v $
00239 ** Revision 1.15  2003/05/20 08:56:20  joergr
00240 ** Added methods and static functions to compose a DICOM Person Name from five
00241 ** name components.
00242 **
00243 ** Revision 1.14  2002/12/06 12:49:17  joergr
00244 ** Enhanced "print()" function by re-working the implementation and replacing
00245 ** the boolean "showFullData" parameter by a more general integer flag.
00246 ** Added doc++ documentation.
00247 ** Made source code formatting more consistent with other modules/files.
00248 **
00249 ** Revision 1.13  2002/04/25 09:56:19  joergr
00250 ** Removed getOFStringArray() implementation.
00251 **
00252 ** Revision 1.12  2001/10/10 15:17:38  joergr
00253 ** Updated comments.
00254 **
00255 ** Revision 1.11  2001/10/01 15:01:39  joergr
00256 ** Introduced new general purpose functions to get/set person names, date, time
00257 ** and date/time.
00258 **
00259 ** Revision 1.10  2001/09/25 17:19:33  meichel
00260 ** Adapted dcmdata to class OFCondition
00261 **
00262 ** Revision 1.9  2001/06/01 15:48:51  meichel
00263 ** Updated copyright header
00264 **
00265 ** Revision 1.8  2000/03/08 16:26:25  meichel
00266 ** Updated copyright header.
00267 **
00268 ** Revision 1.7  1999/03/31 09:25:04  meichel
00269 ** Updated copyright header in module dcmdata
00270 **
00271 ** Revision 1.6  1998/11/12 16:47:52  meichel
00272 ** Implemented operator= for all classes derived from DcmObject.
00273 **
00274 ** Revision 1.5  1997/09/11 15:13:16  hewett
00275 ** Modified getOFString method arguments by removing a default value
00276 ** for the pos argument.  By requiring the pos argument to be provided
00277 ** ensures that callers realise getOFString only gets one component of
00278 ** a multi-valued string.
00279 **
00280 ** Revision 1.4  1997/08/29 08:32:43  andreas
00281 ** - Added methods getOFString and getOFStringArray for all
00282 **   string VRs. These methods are able to normalise the value, i. e.
00283 **   to remove leading and trailing spaces. This will be done only if
00284 **   it is described in the standard that these spaces are not relevant.
00285 **   These methods do not test the strings for conformance, this means
00286 **   especially that they do not delete spaces where they are not allowed!
00287 **   getOFStringArray returns the string with all its parts separated by \
00288 **   and getOFString returns only one value of the string.
00289 **   CAUTION: Currently getString returns a string with trailing
00290 **   spaces removed (if dcmEnableAutomaticInputDataCorrection == OFTrue) and
00291 **   truncates the original string (since it is not copied!). If you rely on this
00292 **   behaviour please change your application now.
00293 **   Future changes will ensure that getString returns the original
00294 **   string from the DICOM object (NULL terminated) inclusive padding.
00295 **   Currently, if you call getOF... before calling getString without
00296 **   normalisation, you can get the original string read from the DICOM object.
00297 **
00298 ** Revision 1.3  1996/01/05 13:23:08  andreas
00299 ** - changed to support new streaming facilities
00300 ** - more cleanups
00301 ** - merged read / write methods for block and file transfer
00302 **
00303 */


Generated on 8 Dec 2004 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.3.9.1