changeset 106:332fec038d52

patch for dcmtk dictionaries
author jodogne
date Wed, 03 Oct 2012 17:53:23 +0200
parents 5bae1ac18ded
children 3b45473c0a73
files Core/DicomFormat/DicomTag.h OrthancServer/FromDcmtkBridge.cpp
diffstat 2 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomFormat/DicomTag.h	Wed Oct 03 17:14:52 2012 +0200
+++ b/Core/DicomFormat/DicomTag.h	Wed Oct 03 17:53:23 2012 +0200
@@ -54,6 +54,16 @@
 
     bool operator< (const DicomTag& other) const;
 
+    bool operator== (const DicomTag& other) const
+    {
+      return group_ == other.group_ && element_ == other.element_;
+    }
+
+    bool operator!= (const DicomTag& other) const
+    {
+      return !(*this == other);
+    }
+
     std::string Format() const;
 
     friend std::ostream& operator<< (std::ostream& o, const DicomTag& tag);
@@ -74,4 +84,6 @@
   static const DicomTag DICOM_TAG_NUMBER_OF_FRAMES(0x0028, 0x0008);
   static const DicomTag DICOM_TAG_CARDIAC_NUMBER_OF_IMAGES(0x0018, 0x1090);
   static const DicomTag DICOM_TAG_IMAGES_IN_ACQUISITION(0x0020, 0x1002);
+
+  static const DicomTag DICOM_TAG_PATIENT_NAME(0x0010, 0x0010);
 }
--- a/OrthancServer/FromDcmtkBridge.cpp	Wed Oct 03 17:14:52 2012 +0200
+++ b/OrthancServer/FromDcmtkBridge.cpp	Wed Oct 03 17:53:23 2012 +0200
@@ -538,6 +538,19 @@
 
   std::string FromDcmtkBridge::GetName(const DicomTag& t)
   {
+    // Some patches for important tags because of different DICOM
+    // dictionaries between DCMTK versions
+    if (t == DICOM_TAG_PATIENT_NAME)
+      return "PatientName";
+
+    if (t == DicomTag(0x0010, 0x0030))
+      return "PatientBirthDate";
+
+    if (t == DicomTag(0x0010, 0x0040))
+      return "PatientSex";
+
+    // End of patches
+
     DcmTagKey tag(t.GetGroup(), t.GetElement());
     const DcmDataDictionary& dict = dcmDataDict.rdlock();
     const DcmDictEntry* entry = dict.findEntry(tag, NULL);