# HG changeset patch # User Sebastien Jodogne # Date 1580899930 -3600 # Node ID e5811a9f8df03bf32734280a441d7bf8258d4ea5 # Parent 8aab20dde416d60ee94b97991cd91b2165cf3792 removing DicomMap::LoadMainDicomTags() diff -r 8aab20dde416 -r e5811a9f8df0 Core/DicomFormat/DicomMap.cpp --- a/Core/DicomFormat/DicomMap.cpp Tue Feb 04 08:32:38 2020 +0100 +++ b/Core/DicomFormat/DicomMap.cpp Wed Feb 05 11:52:10 2020 +0100 @@ -124,9 +124,9 @@ }; - void DicomMap::LoadMainDicomTags(const DicomTag*& tags, - size_t& size, - ResourceType level) + static void LoadMainDicomTags(const DicomTag*& tags, + size_t& size, + ResourceType level) { switch (level) { @@ -1317,6 +1317,21 @@ } + void DicomMap::DumpMainDicomTags(Json::Value& target, + ResourceType level) const + { + target = Json::objectValue; + + + } + + + void DicomMap::ParseMainDicomTags(Json::Value& target, + ResourceType level) + { + } + + void DicomMap::Print(FILE* fp) const { DicomArray a(*this); diff -r 8aab20dde416 -r e5811a9f8df0 Core/DicomFormat/DicomMap.h --- a/Core/DicomFormat/DicomMap.h Tue Feb 04 08:32:38 2020 +0100 +++ b/Core/DicomFormat/DicomMap.h Wed Feb 05 11:52:10 2020 +0100 @@ -188,10 +188,6 @@ void GetTags(std::set& tags) const; - static void LoadMainDicomTags(const DicomTag*& tags, - size_t& size, - ResourceType level); - static bool ParseDicomMetaInformation(DicomMap& result, const char* dicom, size_t size); @@ -240,6 +236,12 @@ void RemoveBinaryTags(); + void DumpMainDicomTags(Json::Value& target, + ResourceType level) const; + + void ParseMainDicomTags(Json::Value& target, + ResourceType level); + void Print(FILE* fp) const; // For debugging only }; } diff -r 8aab20dde416 -r e5811a9f8df0 OrthancServer/ServerIndex.cpp --- a/OrthancServer/ServerIndex.cpp Tue Feb 04 08:32:38 2020 +0100 +++ b/OrthancServer/ServerIndex.cpp Wed Feb 05 11:52:10 2020 +0100 @@ -356,34 +356,40 @@ void LoadTags(ResourceType level) { - const DicomTag* tags = NULL; - size_t size; + { + const DicomTag* tags = NULL; + size_t size; - ServerToolbox::LoadIdentifiers(tags, size, level); + ServerToolbox::LoadIdentifiers(tags, size, level); - for (size_t i = 0; i < size; i++) - { - if (registry_.find(tags[i]) == registry_.end()) + for (size_t i = 0; i < size; i++) { - registry_[tags[i]] = TagInfo(level, DicomTagType_Identifier); - } - else - { - // These patient-level tags are copied in the study level - assert(level == ResourceType_Study && - (tags[i] == DICOM_TAG_PATIENT_ID || - tags[i] == DICOM_TAG_PATIENT_NAME || - tags[i] == DICOM_TAG_PATIENT_BIRTH_DATE)); + if (registry_.find(tags[i]) == registry_.end()) + { + registry_[tags[i]] = TagInfo(level, DicomTagType_Identifier); + } + else + { + // These patient-level tags are copied in the study level + assert(level == ResourceType_Study && + (tags[i] == DICOM_TAG_PATIENT_ID || + tags[i] == DICOM_TAG_PATIENT_NAME || + tags[i] == DICOM_TAG_PATIENT_BIRTH_DATE)); + } } } - - DicomMap::LoadMainDicomTags(tags, size, level); - - for (size_t i = 0; i < size; i++) + { - if (registry_.find(tags[i]) == registry_.end()) + std::set tags; + DicomMap::GetMainDicomTags(tags, level); + + for (std::set::const_iterator + tag = tags.begin(); tag != tags.end(); ++tag) { - registry_[tags[i]] = TagInfo(level, DicomTagType_Main); + if (registry_.find(*tag) == registry_.end()) + { + registry_[*tag] = TagInfo(level, DicomTagType_Main); + } } } }