diff OrthancStone/Sources/Toolbox/DicomStructuredReport.cpp @ 2087:51c8b21b81e4

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Nov 2023 18:11:13 +0100
parents 554bc96e7508
children 63d77859edee 7c3d65166c26
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));
   }
 }