00001 /* 00002 * 00003 * Copyright (C) 1994-2005, 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: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:29:05 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcmtk/dcmdata/dcvrpn.h,v $ 00027 * CVS/RCS Revision: $Revision: 1.17 $ 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 "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00039 00040 #include "dcmtk/dcmdata/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 DcmObject *clone() const 00078 { 00079 return new DcmPersonName(*this); 00080 } 00081 00085 virtual DcmEVR ident() const; 00086 00093 virtual OFCondition getOFString(OFString &stringVal, 00094 const unsigned long pos, 00095 OFBool normalize = OFTrue); 00096 00117 OFCondition getNameComponents(OFString &lastName, 00118 OFString &firstName, 00119 OFString &middleName, 00120 OFString &namePrefix, 00121 OFString &nameSuffix, 00122 const unsigned long pos = 0, 00123 const unsigned int componentGroup = 0); 00124 00135 OFCondition getFormattedName(OFString &formattedName, 00136 const unsigned long pos = 0, 00137 const unsigned int componentGroup = 0); 00138 00139 00151 OFCondition putNameComponents(const OFString &lastName, 00152 const OFString &firstName, 00153 const OFString &middleName, 00154 const OFString &namePrefix, 00155 const OFString &nameSuffix); 00156 00157 /* --- static helper functions --- */ 00158 00179 static OFCondition getNameComponentsFromString(const OFString &dicomName, 00180 OFString &lastName, 00181 OFString &firstName, 00182 OFString &middleName, 00183 OFString &namePrefix, 00184 OFString &nameSuffix, 00185 const unsigned int componentGroup = 0); 00186 00197 static OFCondition getFormattedNameFromString(const OFString &dicomName, 00198 OFString &formattedName, 00199 const unsigned int componentGroup = 0); 00200 00213 static OFCondition getFormattedNameFromComponents(const OFString &lastName, 00214 const OFString &firstName, 00215 const OFString &middleName, 00216 const OFString &namePrefix, 00217 const OFString &nameSuffix, 00218 OFString &formattedName); 00219 00232 static OFCondition getStringFromNameComponents(const OFString &lastName, 00233 const OFString &firstName, 00234 const OFString &middleName, 00235 const OFString &namePrefix, 00236 const OFString &nameSuffix, 00237 OFString &dicomName); 00238 }; 00239 00240 00241 #endif // DCVRPN_H 00242 00243 00244 /* 00245 ** CVS/RCS Log: 00246 ** $Log: dcvrpn.h,v $ 00247 ** Revision 1.17 2005/12/08 16:29:05 meichel 00248 ** Changed include path schema for all DCMTK header files 00249 ** 00250 ** Revision 1.16 2004/07/01 12:28:25 meichel 00251 ** Introduced virtual clone method for DcmObject and derived classes. 00252 ** 00253 ** Revision 1.15 2003/05/20 08:56:20 joergr 00254 ** Added methods and static functions to compose a DICOM Person Name from five 00255 ** name components. 00256 ** 00257 ** Revision 1.14 2002/12/06 12:49:17 joergr 00258 ** Enhanced "print()" function by re-working the implementation and replacing 00259 ** the boolean "showFullData" parameter by a more general integer flag. 00260 ** Added doc++ documentation. 00261 ** Made source code formatting more consistent with other modules/files. 00262 ** 00263 ** Revision 1.13 2002/04/25 09:56:19 joergr 00264 ** Removed getOFStringArray() implementation. 00265 ** 00266 ** Revision 1.12 2001/10/10 15:17:38 joergr 00267 ** Updated comments. 00268 ** 00269 ** Revision 1.11 2001/10/01 15:01:39 joergr 00270 ** Introduced new general purpose functions to get/set person names, date, time 00271 ** and date/time. 00272 ** 00273 ** Revision 1.10 2001/09/25 17:19:33 meichel 00274 ** Adapted dcmdata to class OFCondition 00275 ** 00276 ** Revision 1.9 2001/06/01 15:48:51 meichel 00277 ** Updated copyright header 00278 ** 00279 ** Revision 1.8 2000/03/08 16:26:25 meichel 00280 ** Updated copyright header. 00281 ** 00282 ** Revision 1.7 1999/03/31 09:25:04 meichel 00283 ** Updated copyright header in module dcmdata 00284 ** 00285 ** Revision 1.6 1998/11/12 16:47:52 meichel 00286 ** Implemented operator= for all classes derived from DcmObject. 00287 ** 00288 ** Revision 1.5 1997/09/11 15:13:16 hewett 00289 ** Modified getOFString method arguments by removing a default value 00290 ** for the pos argument. By requiring the pos argument to be provided 00291 ** ensures that callers realise getOFString only gets one component of 00292 ** a multi-valued string. 00293 ** 00294 ** Revision 1.4 1997/08/29 08:32:43 andreas 00295 ** - Added methods getOFString and getOFStringArray for all 00296 ** string VRs. These methods are able to normalise the value, i. e. 00297 ** to remove leading and trailing spaces. This will be done only if 00298 ** it is described in the standard that these spaces are not relevant. 00299 ** These methods do not test the strings for conformance, this means 00300 ** especially that they do not delete spaces where they are not allowed! 00301 ** getOFStringArray returns the string with all its parts separated by \ 00302 ** and getOFString returns only one value of the string. 00303 ** CAUTION: Currently getString returns a string with trailing 00304 ** spaces removed (if dcmEnableAutomaticInputDataCorrection == OFTrue) and 00305 ** truncates the original string (since it is not copied!). If you rely on this 00306 ** behaviour please change your application now. 00307 ** Future changes will ensure that getString returns the original 00308 ** string from the DICOM object (NULL terminated) inclusive padding. 00309 ** Currently, if you call getOF... before calling getString without 00310 ** normalisation, you can get the original string read from the DICOM object. 00311 ** 00312 ** Revision 1.3 1996/01/05 13:23:08 andreas 00313 ** - changed to support new streaming facilities 00314 ** - more cleanups 00315 ** - merged read / write methods for block and file transfer 00316 ** 00317 */