diff OrthancServer/Internals/FindScp.cpp @ 2256:de1ba22fd28a

simplification wrt. modality manufacturers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Feb 2017 16:26:57 +0100
parents a3a65de1840f
children b8969010b534
line wrap: on
line diff
--- a/OrthancServer/Internals/FindScp.cpp	Wed Feb 01 14:04:24 2017 +0000
+++ b/OrthancServer/Internals/FindScp.cpp	Wed Feb 01 16:26:57 2017 +0100
@@ -191,6 +191,20 @@
 
         try
         {
+          RemoteModalityParameters modality;
+
+          /**
+           * Ensure that the remote modality is known to Orthanc for C-FIND requests.
+           **/
+
+          if (!Configuration::LookupDicomModalityUsingAETitle(modality, *data.remoteAet_))
+          {
+            LOG(ERROR) << "Modality with AET \"" << *data.remoteAet_
+                       << "\" is not defined in the \"DicomModalities\" configuration option";
+            throw OrthancException(ErrorCode_UnknownModality);
+          }
+
+          
           if (sopClassUid == UID_FINDModalityWorklistInformationModel)
           {
             data.answers_.SetWorklist(true);
@@ -202,7 +216,7 @@
 
               data.worklistHandler_->Handle(data.answers_, query,
                                             *data.remoteIp_, *data.remoteAet_,
-                                            *data.calledAet_);
+                                            *data.calledAet_, modality.GetManufacturer());
               ok = true;
             }
             else
@@ -242,7 +256,7 @@
 
               data.findHandler_->Handle(data.answers_, input, sequencesToReturn,
                                         *data.remoteIp_, *data.remoteAet_,
-                                        *data.calledAet_);
+                                        *data.calledAet_, modality.GetManufacturer());
               ok = true;
             }
             else