comparison 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
comparison
equal deleted inserted replaced
4729:4e2247df6327 4730:7826ac059c31
1156 return "Unknown failure reason"; 1156 return "Unknown failure reason";
1157 } 1157 }
1158 } 1158 }
1159 1159
1160 1160
1161 const char* EnumerationToString(DicomToJsonFormat format)
1162 {
1163 switch (format)
1164 {
1165 case DicomToJsonFormat_Full:
1166 return "Full";
1167
1168 case DicomToJsonFormat_Human:
1169 return "Simplify";
1170
1171 case DicomToJsonFormat_Short:
1172 return "Short";
1173
1174 default:
1175 throw OrthancException(ErrorCode_ParameterOutOfRange);
1176 }
1177 }
1178
1179
1161 Encoding StringToEncoding(const char* encoding) 1180 Encoding StringToEncoding(const char* encoding)
1162 { 1181 {
1163 std::string s(encoding); 1182 std::string s(encoding);
1164 Toolbox::ToUpperCase(s); 1183 Toolbox::ToUpperCase(s);
1165 1184
1806 { 1825 {
1807 throw OrthancException(ErrorCode_ParameterOutOfRange); 1826 throw OrthancException(ErrorCode_ParameterOutOfRange);
1808 } 1827 }
1809 } 1828 }
1810 1829
1830
1831 DicomToJsonFormat StringToDicomToJsonFormat(const std::string& format)
1832 {
1833 if (format == "Full")
1834 {
1835 return DicomToJsonFormat_Full;
1836 }
1837 else if (format == "Short")
1838 {
1839 return DicomToJsonFormat_Short;
1840 }
1841 else if (format == "Simplify")
1842 {
1843 return DicomToJsonFormat_Human;
1844 }
1845 else
1846 {
1847 throw OrthancException(ErrorCode_ParameterOutOfRange);
1848 }
1849 }
1850
1811 1851
1812 unsigned int GetBytesPerPixel(PixelFormat format) 1852 unsigned int GetBytesPerPixel(PixelFormat format)
1813 { 1853 {
1814 switch (format) 1854 switch (format)
1815 { 1855 {