changeset 5042:120945ce48b6

fix
author Alain Mazy <am@osimis.io>
date Mon, 27 Jun 2022 14:09:17 +0200
parents 71960fdfe5a8
children ec5c203a97ea
files OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Mon Jun 27 12:44:06 2022 +0200
+++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Mon Jun 27 14:09:17 2022 +0200
@@ -93,8 +93,14 @@
       Json::Value sequenceForConversion = Json::objectValue;
       sequenceForConversion[it->first.Format()] = it->second;
 
-      Json::Value requestedFormatJson;
-      Toolbox::SimplifyDicomAsJson(requestedFormatJson, sequenceForConversion, format);  
+      Json::Value& requestedFormatJson = sequenceForConversion;
+      Json::Value convertedJson;
+
+      if (format != DicomToJsonFormat_Full)
+      {
+        Toolbox::SimplifyDicomAsJson(convertedJson, sequenceForConversion, format);
+        requestedFormatJson = convertedJson;
+      }
       
       Json::Value::Members keys = requestedFormatJson.getMemberNames();  
       for (size_t i = 0; i < keys.size(); i++)  // there should always be only one member in this JSON