diff OrthancServer/Internals/FindScp.cpp @ 1787:1b1d5470233f worklists

refactoring of DicomFindAnswers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Nov 2015 15:50:32 +0100
parents 164d78911382
children 6a2d507ef064
line wrap: on
line diff
--- a/OrthancServer/Internals/FindScp.cpp	Wed Nov 18 12:00:14 2015 +0100
+++ b/OrthancServer/Internals/FindScp.cpp	Wed Nov 18 15:50:32 2015 +0100
@@ -87,7 +87,7 @@
 #include "../../Core/Logging.h"
 #include "../../Core/OrthancException.h"
 
-
+#include <dcmtk/dcmdata/dcfilefo.h>
 
 namespace Orthanc
 {
@@ -134,9 +134,9 @@
             if (data.worklistHandler_ != NULL)
             {
               // TODO
-              std::auto_ptr<ParsedDicomFile> query(ParsedDicomFile::CreateFromDcmtkDataset(requestIdentifiers));
+              /*std::auto_ptr<ParsedDicomFile> query(ParsedDicomFile::CreateFromDcmtkDataset(requestIdentifiers));
               DicomWorklistAnswers a;
-              data.worklistHandler_->Handle(a, *query, *data.remoteIp_, *data.remoteAet_);
+              data.worklistHandler_->Handle(a, *query, *data.remoteIp_, *data.remoteAet_);*/
               ok = true;
             }
             else
@@ -187,7 +187,12 @@
       {
         // There are pending results that are still to be sent
         response->DimseStatus = STATUS_Pending;
-        *responseIdentifiers = ToDcmtkBridge::Convert(data.answers_.GetAnswer(responseCount - 1));
+
+        void* obj = data.answers_.GetAnswer(responseCount - 1).GetDcmtkObject();
+        DcmFileFormat* fileFormat = static_cast<DcmFileFormat*>(obj);
+        assert(fileFormat != NULL);
+
+        *responseIdentifiers = new DcmDataset(*fileFormat->getDataset());
       }
       else if (data.noCroppingOfResults_)
       {