# HG changeset patch # User Sebastien Jodogne # Date 1615392901 -3600 # Node ID 94147ce2f097106ef7e62fb9405ac96802fbf223 # Parent 888868a5dc4eedd5fce115de21d7d3f2203b038a fix build on os x diff -r 888868a5dc4e -r 94147ce2f097 OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp --- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp Wed Mar 10 15:59:03 2021 +0100 +++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp Wed Mar 10 17:15:01 2021 +0100 @@ -420,28 +420,6 @@ #endif - static inline uint16_t GetCharValue(char c) - { - if (c >= '0' && c <= '9') - return c - '0'; - else if (c >= 'a' && c <= 'f') - return c - 'a' + 10; - else if (c >= 'A' && c <= 'F') - return c - 'A' + 10; - else - return 0; - } - - - static inline uint16_t GetTagValue(const char* c) - { - return ((GetCharValue(c[0]) << 12) + - (GetCharValue(c[1]) << 8) + - (GetCharValue(c[2]) << 4) + - GetCharValue(c[3])); - } - - #if ORTHANC_ENABLE_CIVETWEB == 1 || ORTHANC_ENABLE_MONGOOSE == 1 void ParsedDicomFile::SendPathValue(RestApiOutput& output, const UriComponents& uri) const diff -r 888868a5dc4e -r 94147ce2f097 OrthancServer/Sources/Database/StatelessDatabaseOperations.h --- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.h Wed Mar 10 15:59:03 2021 +0100 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.h Wed Mar 10 17:15:01 2021 +0100 @@ -45,7 +45,7 @@ { class DatabaseLookup; class ParsedDicomFile; - class ServerIndexChange; + struct ServerIndexChange; class StatelessDatabaseOperations : public boost::noncopyable { @@ -408,7 +408,7 @@ boost::mutex databaseMutex_; // TODO - REMOVE std::unique_ptr factory_; unsigned int maxRetries_; - std::unique_ptr mainDicomTagsRegistry_; + boost::shared_ptr mainDicomTagsRegistry_; // "shared_ptr" because of PImpl bool hasFlushToDisk_; void NormalizeLookup(std::vector& target, diff -r 888868a5dc4e -r 94147ce2f097 OrthancServer/Sources/OrthancWebDav.cpp --- a/OrthancServer/Sources/OrthancWebDav.cpp Wed Mar 10 15:59:03 2021 +0100 +++ b/OrthancServer/Sources/OrthancWebDav.cpp Wed Mar 10 17:15:01 2021 +0100 @@ -50,7 +50,6 @@ static const char* const BY_DATES = "by-dates"; static const char* const BY_UIDS = "by-uids"; static const char* const UPLOADS = "uploads"; -static const char* const MAIN_DICOM_TAGS = "MainDicomTags"; static const char* const STUDY_INFO = "study.json"; static const char* const SERIES_INFO = "series.json"; diff -r 888868a5dc4e -r 94147ce2f097 OrthancServer/Sources/ServerIndex.cpp --- a/OrthancServer/Sources/ServerIndex.cpp Wed Mar 10 15:59:03 2021 +0100 +++ b/OrthancServer/Sources/ServerIndex.cpp Wed Mar 10 17:15:01 2021 +0100 @@ -387,113 +387,6 @@ }; - class ServerIndex::MainDicomTagsRegistry : public boost::noncopyable - { - private: - class TagInfo - { - private: - ResourceType level_; - DicomTagType type_; - - public: - TagInfo() - { - } - - TagInfo(ResourceType level, - DicomTagType type) : - level_(level), - type_(type) - { - } - - ResourceType GetLevel() const - { - return level_; - } - - DicomTagType GetType() const - { - return type_; - } - }; - - typedef std::map Registry; - - - Registry registry_; - - void LoadTags(ResourceType level) - { - { - const DicomTag* tags = NULL; - size_t size; - - ServerToolbox::LoadIdentifiers(tags, size, level); - - for (size_t i = 0; i < size; i++) - { - 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)); - } - } - } - - { - std::set tags; - DicomMap::GetMainDicomTags(tags, level); - - for (std::set::const_iterator - tag = tags.begin(); tag != tags.end(); ++tag) - { - if (registry_.find(*tag) == registry_.end()) - { - registry_[*tag] = TagInfo(level, DicomTagType_Main); - } - } - } - } - - public: - MainDicomTagsRegistry() - { - LoadTags(ResourceType_Patient); - LoadTags(ResourceType_Study); - LoadTags(ResourceType_Series); - LoadTags(ResourceType_Instance); - } - - void LookupTag(ResourceType& level, - DicomTagType& type, - const DicomTag& tag) const - { - Registry::const_iterator it = registry_.find(tag); - - if (it == registry_.end()) - { - // Default values - level = ResourceType_Instance; - type = DicomTagType_Generic; - } - else - { - level = it->second.GetLevel(); - type = it->second.GetType(); - } - } - }; - - void ServerIndex::FlushThread(ServerIndex* that, unsigned int threadSleepGranularityMilliseconds) { diff -r 888868a5dc4e -r 94147ce2f097 OrthancServer/Sources/ServerJobs/ArchiveJob.cpp --- a/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp Wed Mar 10 15:59:03 2021 +0100 +++ b/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp Wed Mar 10 17:15:01 2021 +0100 @@ -708,14 +708,11 @@ { private: ZipCommands& commands_; - ServerContext& context_; unsigned int counter_; public: - MediaIndexVisitor(ZipCommands& commands, - ServerContext& context) : + MediaIndexVisitor(ZipCommands& commands) : commands_(commands), - context_(context), counter_(0) { } @@ -746,7 +743,6 @@ class ArchiveJob::ZipWriterIterator : public boost::noncopyable { private: - TemporaryFile& target_; ServerContext& context_; ZipCommands commands_; std::unique_ptr zip_; @@ -759,13 +755,12 @@ ArchiveIndex& archive, bool isMedia, bool enableExtendedSopClass) : - target_(target), context_(context), isMedia_(isMedia) { if (isMedia) { - MediaIndexVisitor visitor(commands_, context); + MediaIndexVisitor visitor(commands_); archive.Expand(context.GetIndex()); commands_.AddOpenDirectory(MEDIA_IMAGES_FOLDER);