Mercurial > hg > orthanc-stone
comparison Framework/Loaders/SeriesThumbnailsLoader.cpp @ 1476:4db187d29731
renamed SeriesMetadataLoader::SeriesLoadedMessage to SuccessMessage
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 17 Jun 2020 18:21:26 +0200 |
parents | 9cbc6d21ae89 |
children | 121d01aa328e |
comparison
equal
deleted
inserted
replaced
1475:615035c2f3ba | 1476:4db187d29731 |
---|---|
277 } | 277 } |
278 | 278 |
279 virtual void HandleError() | 279 virtual void HandleError() |
280 { | 280 { |
281 // The DICOMweb wasn't able to generate a thumbnail, try to | 281 // The DICOMweb wasn't able to generate a thumbnail, try to |
282 // retrieve the SopClassUID tag using a call to "/metadata" | 282 // retrieve the SopClassUID tag using QIDO-RS |
283 | 283 |
284 std::map<std::string, std::string> arguments, headers; | |
285 arguments["0020000D"] = GetStudyInstanceUid(); | |
286 arguments["0020000E"] = GetSeriesInstanceUid(); | |
287 arguments["includefield"] = "00080016"; | |
288 | |
284 std::unique_ptr<IOracleCommand> command( | 289 std::unique_ptr<IOracleCommand> command( |
285 GetSource().CreateDicomWebCommand( | 290 GetSource().CreateDicomWebCommand( |
286 "/studies/" + GetStudyInstanceUid() + "/series/" + GetSeriesInstanceUid() + "/metadata", | 291 "/instances", arguments, headers, new DicomWebSopClassHandler( |
287 new DicomWebSopClassHandler( | |
288 GetLoader(), GetSource(), GetStudyInstanceUid(), GetSeriesInstanceUid()))); | 292 GetLoader(), GetSource(), GetStudyInstanceUid(), GetSeriesInstanceUid()))); |
289 GetLoader()->Schedule(command.release()); | 293 GetLoader()->Schedule(command.release()); |
290 } | 294 } |
291 }; | 295 }; |
292 | 296 |
546 void SeriesThumbnailsLoader::ScheduleLoadThumbnail(const DicomSource& source, | 550 void SeriesThumbnailsLoader::ScheduleLoadThumbnail(const DicomSource& source, |
547 const std::string& patientId, | 551 const std::string& patientId, |
548 const std::string& studyInstanceUid, | 552 const std::string& studyInstanceUid, |
549 const std::string& seriesInstanceUid) | 553 const std::string& seriesInstanceUid) |
550 { | 554 { |
555 if (IsScheduledSeries(seriesInstanceUid)) | |
556 { | |
557 return; | |
558 } | |
559 | |
551 if (source.IsDicomWeb()) | 560 if (source.IsDicomWeb()) |
552 { | 561 { |
553 if (!source.HasDicomWebRendered()) | 562 if (!source.HasDicomWebRendered()) |
554 { | 563 { |
555 // TODO - Could use DCMTK here | 564 // TODO - Could use DCMTK here |
572 std::unique_ptr<IOracleCommand> command( | 581 std::unique_ptr<IOracleCommand> command( |
573 source.CreateDicomWebCommand( | 582 source.CreateDicomWebCommand( |
574 uri, arguments, headers, new DicomWebThumbnailHandler( | 583 uri, arguments, headers, new DicomWebThumbnailHandler( |
575 shared_from_this(), source, studyInstanceUid, seriesInstanceUid))); | 584 shared_from_this(), source, studyInstanceUid, seriesInstanceUid))); |
576 Schedule(command.release()); | 585 Schedule(command.release()); |
586 | |
587 scheduledSeries_.insert(seriesInstanceUid); | |
577 } | 588 } |
578 else if (source.IsOrthanc()) | 589 else if (source.IsOrthanc()) |
579 { | 590 { |
580 // Dummy SOP Instance UID, as we are working at the "series" level | 591 // Dummy SOP Instance UID, as we are working at the "series" level |
581 Orthanc::DicomInstanceHasher hasher(patientId, studyInstanceUid, seriesInstanceUid, "dummy"); | 592 Orthanc::DicomInstanceHasher hasher(patientId, studyInstanceUid, seriesInstanceUid, "dummy"); |
583 std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); | 594 std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); |
584 command->SetUri("/series/" + hasher.HashSeries()); | 595 command->SetUri("/series/" + hasher.HashSeries()); |
585 command->AcquirePayload(new SelectOrthancInstanceHandler( | 596 command->AcquirePayload(new SelectOrthancInstanceHandler( |
586 shared_from_this(), source, studyInstanceUid, seriesInstanceUid)); | 597 shared_from_this(), source, studyInstanceUid, seriesInstanceUid)); |
587 Schedule(command.release()); | 598 Schedule(command.release()); |
599 | |
600 scheduledSeries_.insert(seriesInstanceUid); | |
588 } | 601 } |
589 else | 602 else |
590 { | 603 { |
591 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented, | 604 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented, |
592 "Can only load thumbnails from Orthanc or DICOMweb"); | 605 "Can only load thumbnails from Orthanc or DICOMweb"); |