# HG changeset patch # User Sebastien Jodogne # Date 1597385942 -7200 # Node ID 1ec3e1e18f50e6c30a95cef1d37c05125f8ce5ea # Parent 0ea450e1f0ea87c05c37e498118951115467c708 Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses diff -r 0ea450e1f0ea -r 1ec3e1e18f50 NEWS --- a/NEWS Thu Aug 13 17:44:39 2020 +0200 +++ b/NEWS Fri Aug 14 08:19:02 2020 +0200 @@ -1,6 +1,7 @@ Pending changes in the mainline =============================== +* Add missing tag "Retrieve AE Title (0008,0054)" in C-FIND SCP responses * Fix DICOM SCP filters if some query tag has more than 256 characters * "/series/.../ordered-slices" supports spaces in Image Position/Orientation Patient tags diff -r 0ea450e1f0ea -r 1ec3e1e18f50 OrthancFramework/Sources/DicomFormat/DicomTag.h --- a/OrthancFramework/Sources/DicomFormat/DicomTag.h Thu Aug 13 17:44:39 2020 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomTag.h Fri Aug 14 08:19:02 2020 +0200 @@ -125,6 +125,7 @@ static const DicomTag DICOM_TAG_SPECIFIC_CHARACTER_SET(0x0008, 0x0005); static const DicomTag DICOM_TAG_QUERY_RETRIEVE_LEVEL(0x0008, 0x0052); static const DicomTag DICOM_TAG_MODALITIES_IN_STUDY(0x0008, 0x0061); + static const DicomTag DICOM_TAG_RETRIEVE_AE_TITLE(0x0008, 0x0054); // Tags for images static const DicomTag DICOM_TAG_COLUMNS(0x0028, 0x0011); diff -r 0ea450e1f0ea -r 1ec3e1e18f50 OrthancServer/Sources/OrthancConfiguration.h --- a/OrthancServer/Sources/OrthancConfiguration.h Thu Aug 13 17:44:39 2020 +0200 +++ b/OrthancServer/Sources/OrthancConfiguration.h Fri Aug 14 08:19:02 2020 +0200 @@ -237,6 +237,11 @@ std::string GetDefaultPrivateCreator() const; + std::string GetOrthancAET() const + { + return GetStringParameter("DicomAet", "ORTHANC"); + } + static void DefaultExtractDicomSummary(DicomMap& target, ParsedDicomFile& dicom); diff -r 0ea450e1f0ea -r 1ec3e1e18f50 OrthancServer/Sources/OrthancFindRequestHandler.cpp --- a/OrthancServer/Sources/OrthancFindRequestHandler.cpp Thu Aug 13 17:44:39 2020 +0200 +++ b/OrthancServer/Sources/OrthancFindRequestHandler.cpp Fri Aug 14 08:19:02 2020 +0200 @@ -304,7 +304,8 @@ const std::list& sequencesToReturn, const DicomMap* counters, const std::string& defaultPrivateCreator, - const std::map& privateCreators) + const std::map& privateCreators, + const std::string& retrieveAet) { DicomMap match; @@ -319,6 +320,13 @@ DicomMap result; + /** + * Add the mandatory "Retrieve AE Title (0008,0054)" tag, which was missing in Orthanc <= 1.7.2. + * http://dicom.nema.org/medical/dicom/current/output/html/part04.html#sect_C.4.1.1.3.2 + * https://groups.google.com/g/orthanc-users/c/-7zNTKR_PMU/m/kfjwzEVNAgAJ + **/ + result.SetValue(DICOM_TAG_RETRIEVE_AE_TITLE, retrieveAet, false /* not binary */); + for (size_t i = 0; i < query.GetSize(); i++) { if (query.GetElement(i).GetTag() == DICOM_TAG_QUERY_RETRIEVE_LEVEL) @@ -504,6 +512,7 @@ const std::list& sequencesToReturn_; std::string defaultPrivateCreator_; // the private creator to use if the group is not defined in the query itself const std::map& privateCreators_; // the private creators defined in the query itself + std::string retrieveAet_; public: LookupVisitor(DicomFindAnswers& answers, @@ -525,6 +534,7 @@ { OrthancConfiguration::ReaderLock lock; defaultPrivateCreator_ = lock.GetConfiguration().GetDefaultPrivateCreator(); + retrieveAet_ = lock.GetConfiguration().GetOrthancAET(); } } @@ -566,8 +576,8 @@ { std::unique_ptr counters(ComputeCounters(context_, instanceId, level_, query_)); - AddAnswer(answers_, mainDicomTags, dicomAsJson, - queryAsArray_, sequencesToReturn_, counters.get(), defaultPrivateCreator_, privateCreators_); + AddAnswer(answers_, mainDicomTags, dicomAsJson, queryAsArray_, sequencesToReturn_, + counters.get(), defaultPrivateCreator_, privateCreators_, retrieveAet_); } }; diff -r 0ea450e1f0ea -r 1ec3e1e18f50 OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp Thu Aug 13 17:44:39 2020 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp Fri Aug 14 08:19:02 2020 +0200 @@ -69,7 +69,7 @@ { OrthancConfiguration::ReaderLock lock; - result["DicomAet"] = lock.GetConfiguration().GetStringParameter("DicomAet", "ORTHANC"); + result["DicomAet"] = lock.GetConfiguration().GetOrthancAET(); result["DicomPort"] = lock.GetConfiguration().GetUnsignedIntegerParameter("DicomPort", 4242); result["HttpPort"] = lock.GetConfiguration().GetUnsignedIntegerParameter("HttpPort", 8042); result["Name"] = lock.GetConfiguration().GetStringParameter("Name", ""); diff -r 0ea450e1f0ea -r 1ec3e1e18f50 OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Thu Aug 13 17:44:39 2020 +0200 +++ b/OrthancServer/Sources/ServerContext.cpp Fri Aug 14 08:19:02 2020 +0200 @@ -280,7 +280,7 @@ new SharedArchive(lock.GetConfiguration().GetUnsignedIntegerParameter("QueryRetrieveSize", 100))); mediaArchive_.reset( new SharedArchive(lock.GetConfiguration().GetUnsignedIntegerParameter("MediaArchiveSize", 1))); - defaultLocalAet_ = lock.GetConfiguration().GetStringParameter("DicomAet", "ORTHANC"); + defaultLocalAet_ = lock.GetConfiguration().GetOrthancAET(); jobsEngine_.SetWorkersCount(lock.GetConfiguration().GetUnsignedIntegerParameter("ConcurrentJobs", 2)); saveJobs_ = lock.GetConfiguration().GetBooleanParameter("SaveJobs", true); metricsRegistry_->SetEnabled(lock.GetConfiguration().GetBooleanParameter("MetricsEnabled", true)); diff -r 0ea450e1f0ea -r 1ec3e1e18f50 OrthancServer/Sources/main.cpp --- a/OrthancServer/Sources/main.cpp Thu Aug 13 17:44:39 2020 +0200 +++ b/OrthancServer/Sources/main.cpp Fri Aug 14 08:19:02 2020 +0200 @@ -1073,7 +1073,7 @@ dicomServer.SetCalledApplicationEntityTitleCheck(lock.GetConfiguration().GetBooleanParameter("DicomCheckCalledAet", false)); dicomServer.SetAssociationTimeout(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomScpTimeout", 30)); dicomServer.SetPortNumber(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomPort", 4242)); - dicomServer.SetApplicationEntityTitle(lock.GetConfiguration().GetStringParameter("DicomAet", "ORTHANC")); + dicomServer.SetApplicationEntityTitle(lock.GetConfiguration().GetOrthancAET()); } #if ORTHANC_ENABLE_PLUGINS == 1