diff OrthancFramework/Sources/Enumerations.cpp @ 4730:7826ac059c31

Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Jun 2021 18:13:45 +0200
parents 521e39b3f2c0
children 7053502fbf97
line wrap: on
line diff
--- a/OrthancFramework/Sources/Enumerations.cpp	Fri Jun 25 10:41:35 2021 +0200
+++ b/OrthancFramework/Sources/Enumerations.cpp	Fri Jun 25 18:13:45 2021 +0200
@@ -1158,6 +1158,25 @@
   }
 
 
+  const char* EnumerationToString(DicomToJsonFormat format)
+  {
+    switch (format)
+    {
+      case DicomToJsonFormat_Full:
+        return "Full";
+
+      case DicomToJsonFormat_Human:
+        return "Simplify";
+
+      case DicomToJsonFormat_Short:
+        return "Short";
+
+      default:
+        throw OrthancException(ErrorCode_ParameterOutOfRange);
+    }
+  }
+
+
   Encoding StringToEncoding(const char* encoding)
   {
     std::string s(encoding);
@@ -1809,6 +1828,27 @@
   }
   
 
+  DicomToJsonFormat StringToDicomToJsonFormat(const std::string& format)
+  {
+    if (format == "Full")
+    {
+      return DicomToJsonFormat_Full;
+    }
+    else if (format == "Short")
+    {
+      return DicomToJsonFormat_Short;
+    }
+    else if (format == "Simplify")
+    {
+      return DicomToJsonFormat_Human;
+    }
+    else
+    {
+      throw OrthancException(ErrorCode_ParameterOutOfRange);
+    }
+  }
+
+
   unsigned int GetBytesPerPixel(PixelFormat format)
   {
     switch (format)