changeset 2087:51c8b21b81e4

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Nov 2023 18:11:13 +0100
parents 40476d5e0cfd
children b98d159c7545 7c3d65166c26
files OrthancStone/Sources/Toolbox/DicomStructuredReport.cpp OrthancStone/Sources/Toolbox/DicomStructuredReport.h
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancStone/Sources/Toolbox/DicomStructuredReport.cpp	Tue Nov 07 17:03:54 2023 +0100
+++ b/OrthancStone/Sources/Toolbox/DicomStructuredReport.cpp	Tue Nov 07 18:11:13 2023 +0100
@@ -33,6 +33,13 @@
 #include <dcmtk/dcmdata/dcfilefo.h>
 
 
+static std::string FormatTag(const DcmTagKey& key)
+{
+  OFString s = key.toString();
+  return std::string(s.c_str());
+}
+
+
 static std::string GetStringValue(DcmItem& dataset,
                                   const DcmTagKey& key)
 {
@@ -45,7 +52,7 @@
   else
   {
     throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
-                                    "Missing tag in DICOM-SR: " + key.toString());
+                                    "Missing tag in DICOM-SR: " + FormatTag(key));
   }
 }
 
@@ -62,7 +69,7 @@
   else
   {
     throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
-                                    "Missing sequence in DICOM-SR: " + key.toString());
+                                    "Missing sequence in DICOM-SR: " + FormatTag(key));
   }
 }
 
--- a/OrthancStone/Sources/Toolbox/DicomStructuredReport.h	Tue Nov 07 17:03:54 2023 +0100
+++ b/OrthancStone/Sources/Toolbox/DicomStructuredReport.h	Tue Nov 07 18:11:13 2023 +0100
@@ -34,6 +34,7 @@
 #include <DicomParsing/ParsedDicomFile.h>
 
 #include <dcmtk/dcmdata/dcitem.h>
+#include <list>
 
 namespace OrthancStone
 {