changeset 4788:b47ee86a0d10

support 64 bit integers in DICOMweb
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Sep 2021 22:13:07 +0200
parents 9a1f106e175c
children 51ec061516c9
files OrthancFramework/Sources/DicomFormat/DicomMap.cpp OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp
diffstat 2 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomFormat/DicomMap.cpp	Tue Aug 31 12:49:39 2021 +0200
+++ b/OrthancFramework/Sources/DicomFormat/DicomMap.cpp	Mon Sep 06 22:13:07 2021 +0200
@@ -1406,11 +1406,11 @@
                 break;
               
               case Json::intValue:
-                s += boost::lexical_cast<std::string>(value[j].asInt());
+                s += boost::lexical_cast<std::string>(value[j].asInt64());
                 break;
               
               case Json::uintValue:
-                s += boost::lexical_cast<std::string>(value[j].asUInt());
+                s += boost::lexical_cast<std::string>(value[j].asUInt64());
                 break;
               
               case Json::realValue:
--- a/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp	Tue Aug 31 12:49:39 2021 +0200
+++ b/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp	Mon Sep 06 22:13:07 2021 +0200
@@ -3132,6 +3132,23 @@
 }
 
 
+TEST(DicomMap, DicomWebWithInteger64)
+{
+  /**
+   * This failed in Orthanc <= 1.9.7 with
+   * "http://localhost:8042/dicom-web/studies/1.3.6.1.4.1.14519.5.2.1.314316487728501506587013300243937537423/series/1.3.6.1.4.1.1459.5.2.1.62266640231940987006694557463549207147/instances/1.3.6.1.4.1.14519.5.2.1.147718809116229175846174241356499989705/metadata"
+   * of patient "GLIOMA01-i_03A6" from collection "ICDC-Glioma" of
+   * TCIA.
+   **/
+  Json::Value v = Json::objectValue;
+  v["00191297"]["Value"][0] = 29362240;
+  v["00191297"]["Value"][1] = Json::Int64(4294948074l);
+  v["00191297"]["vr"] = "UL";
+  DicomMap m;
+  m.FromDicomWeb(v);
+}
+
+
 
 
 #if ORTHANC_ENABLE_DCMTK_TRANSCODING == 1