]> Creatis software - gdcm.git/commitdiff
Force 0018|0015 [CS] [Body Part Examined] (in any) to upper value,
authorjpr <jpr>
Wed, 17 Oct 2007 12:14:02 +0000 (12:14 +0000)
committerjpr <jpr>
Wed, 17 Oct 2007 12:14:02 +0000 (12:14 +0000)
(avoid dciodvfy to complain!)

src/gdcmFileHelper.cxx

index 1ec952328eea41e0c55b42ad2f289504537420da..68b5316a465f53e3a6635c05ce2ac2fa42b01da1 100644 (file)
@@ -4,8 +4,8 @@
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
 
-  Date:      $Date: 2007/10/17 10:03:59 $
-  Version:   $Revision: 1.133 $
+  Date:      $Date: 2007/10/17 12:14:02 $
+  Version:   $Revision: 1.134 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -1504,9 +1504,16 @@ void FileHelper::CheckMandatoryElements()
 
    // --------------------- For DataSet ---------------------
 
-   /// \todo check that 0018|0015 [CS] [Body Part Examined] value is UPPER CASE
-   ///      (avoid dciodvfy to complain!)
-   
+   // check whether 0018|0015 [CS] [Body Part Examined] value is UPPER CASE
+   //      (avoid dciodvfy to complain!)
+   DataEntry *e_0018_0015 = FileInternal->GetDataEntry(0x0018, 0x0015);  
+   if ( e_0018_0015)
+   {
+      std::string bodyPartExamined = e_0018_0015->GetString();
+      std::transform(bodyPartExamined.begin(), bodyPartExamined.end(), bodyPartExamined.begin(), 
+                    (int(*)(int)) toupper);
+      CopyMandatoryEntry(0x0018,0x0015,bodyPartExamined,"CS");       
+   }
 
    if ( ContentType != USER_OWN_IMAGE) // when it's not a user made image
    {