Description: Fix compatibility with Orthanc >= 1.12.5 (the images were not displayed)
Author: Sebastien Jodogne <s.jodogne@orthanc-labs.com>
Forwarded: https://orthanc.uclouvain.be/hg/orthanc-webviewer/rev/7fa1522f4569
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: OrthancWebViewer-2.9/Plugin/SeriesInformationAdapter.cpp
===================================================================
--- OrthancWebViewer-2.9.orig/Plugin/SeriesInformationAdapter.cpp
+++ OrthancWebViewer-2.9/Plugin/SeriesInformationAdapter.cpp
@@ -2,8 +2,9 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2024 Osimis S.A., Belgium
- * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium
+ * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -35,11 +36,18 @@ namespace OrthancPlugins
   {
     LOG(INFO) << "Ordering instances of series: " << seriesId;
 
-    Json::Value series, study, patient, ordered;
-    if (!GetJsonFromOrthanc(series, context_, "/series/" + seriesId) ||
-        !GetJsonFromOrthanc(study, context_, "/studies/" + series["ID"].asString() + "/module?simplify") ||
-        !GetJsonFromOrthanc(patient, context_, "/studies/" + series["ID"].asString() + "/module-patient?simplify") ||
-        !GetJsonFromOrthanc(ordered, context_, "/series/" + series["ID"].asString() + "/ordered-slices") ||
+    Json::Value series;
+    if (!GetJsonFromOrthanc(series, context_, "/series/" + seriesId))
+    {
+      return false;
+    }
+
+    const std::string studyId = series["ParentStudy"].asString();
+
+    Json::Value study, patient, ordered;
+    if (!GetJsonFromOrthanc(study, context_, "/studies/" + studyId + "/module?simplify") ||
+        !GetJsonFromOrthanc(patient, context_, "/studies/" + studyId + "/module-patient?simplify") ||
+        !GetJsonFromOrthanc(ordered, context_, "/series/" + seriesId + "/ordered-slices") ||
         !series.isMember("Instances") ||
         series["Instances"].type() != Json::arrayValue)
     {
