comparison Orthanc/Core/Enumerations.cpp @ 90:a54260a7fe59

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 27 Nov 2015 13:54:33 +0100
parents bc05500ea317
children 3809121c3290
comparison
equal deleted inserted replaced
89:bc05500ea317 90:a54260a7fe59
149 return "Error in the plugin implementing a custom storage area"; 149 return "Error in the plugin implementing a custom storage area";
150 150
151 case ErrorCode_EmptyRequest: 151 case ErrorCode_EmptyRequest:
152 return "The request is empty"; 152 return "The request is empty";
153 153
154 case ErrorCode_NotAcceptable:
155 return "Cannot send a response which is acceptable according to the Accept HTTP header";
156
154 case ErrorCode_SQLiteNotOpened: 157 case ErrorCode_SQLiteNotOpened:
155 return "SQLite: The database is not opened"; 158 return "SQLite: The database is not opened";
156 159
157 case ErrorCode_SQLiteAlreadyOpened: 160 case ErrorCode_SQLiteAlreadyOpened:
158 return "SQLite: Connection is already open"; 161 return "SQLite: Connection is already open";
319 case ErrorCode_SslDisabled: 322 case ErrorCode_SslDisabled:
320 return "Orthanc has been built without SSL support"; 323 return "Orthanc has been built without SSL support";
321 324
322 case ErrorCode_CannotOrderSlices: 325 case ErrorCode_CannotOrderSlices:
323 return "Unable to order the slices of the series"; 326 return "Unable to order the slices of the series";
327
328 case ErrorCode_NoWorklistHandler:
329 return "No request handler factory for DICOM C-Find Modality SCP";
324 330
325 default: 331 default:
326 if (error >= ErrorCode_START_PLUGINS) 332 if (error >= ErrorCode_START_PLUGINS)
327 { 333 {
328 return "Error encountered within some plugin"; 334 return "Error encountered within some plugin";
673 return "Unknown"; 679 return "Unknown";
674 680
675 case RequestOrigin_DicomProtocol: 681 case RequestOrigin_DicomProtocol:
676 return "DicomProtocol"; 682 return "DicomProtocol";
677 683
678 case RequestOrigin_Http: 684 case RequestOrigin_RestApi:
679 return "Http"; 685 return "RestApi";
680 686
681 case RequestOrigin_Plugins: 687 case RequestOrigin_Plugins:
682 return "Plugins"; 688 return "Plugins";
683 689
684 case RequestOrigin_Lua: 690 case RequestOrigin_Lua:
978 // The encoding was properly detected 984 // The encoding was properly detected
979 return true; 985 return true;
980 } 986 }
981 987
982 988
983 const char* GetMimeType(FileContentType type)
984 {
985 switch (type)
986 {
987 case FileContentType_Dicom:
988 return "application/dicom";
989
990 case FileContentType_DicomAsJson:
991 return "application/json";
992
993 default:
994 return "application/octet-stream";
995 }
996 }
997
998
999 const char* GetFileExtension(FileContentType type)
1000 {
1001 switch (type)
1002 {
1003 case FileContentType_Dicom:
1004 return ".dcm";
1005
1006 case FileContentType_DicomAsJson:
1007 return ".json";
1008
1009 default:
1010 // Unknown file type
1011 return "";
1012 }
1013 }
1014
1015
1016 ResourceType GetChildResourceType(ResourceType type) 989 ResourceType GetChildResourceType(ResourceType type)
1017 { 990 {
1018 switch (type) 991 switch (type)
1019 { 992 {
1020 case ResourceType_Patient: 993 case ResourceType_Patient:
1162 return HttpStatus_400_BadRequest; 1135 return HttpStatus_400_BadRequest;
1163 1136
1164 case ErrorCode_Unauthorized: 1137 case ErrorCode_Unauthorized:
1165 return HttpStatus_401_Unauthorized; 1138 return HttpStatus_401_Unauthorized;
1166 1139
1140 case ErrorCode_NotAcceptable:
1141 return HttpStatus_406_NotAcceptable;
1142
1167 default: 1143 default:
1168 return HttpStatus_500_InternalServerError; 1144 return HttpStatus_500_InternalServerError;
1169 } 1145 }
1170 } 1146 }
1147
1148
1149 bool IsUserContentType(FileContentType type)
1150 {
1151 return (type >= FileContentType_StartUser &&
1152 type <= FileContentType_EndUser);
1153 }
1171 } 1154 }