# HG changeset patch # User jodogne # Date 1349279603 -7200 # Node ID 332fec038d52a4756a4ad8a4c2173e8defc60a1c # Parent 5bae1ac18ded1e379fa73a62f91003b9fc7f5cd3 patch for dcmtk dictionaries diff -r 5bae1ac18ded -r 332fec038d52 Core/DicomFormat/DicomTag.h --- 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); } diff -r 5bae1ac18ded -r 332fec038d52 OrthancServer/FromDcmtkBridge.cpp --- 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);