# HG changeset patch # User Alain Mazy # Date 1653982560 -7200 # Node ID c014ab79fca572adc4981008c92e469f1d92d652 # Parent 88d838c6b4c7a390ffd6492d5cc8118c33cca777 fixed /move documentation + improved error reporting diff -r 88d838c6b4c7 -r c014ab79fca5 OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp --- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Mon May 30 09:08:54 2022 +0200 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Tue May 31 09:36:00 2022 +0200 @@ -2296,11 +2296,19 @@ void FromDcmtkBridge::FromJson(DicomMap& target, - const Json::Value& source) + const Json::Value& source, + const char* fieldName) { if (source.type() != Json::objectValue) { - throw OrthancException(ErrorCode_BadFileFormat); + if (fieldName != NULL) + { + throw OrthancException(ErrorCode_BadFileFormat, std::string("Expecting an object in field '") + std::string(fieldName) + std::string("'")); + } + else + { + throw OrthancException(ErrorCode_BadFileFormat, "Expecting an object"); + } } target.Clear(); @@ -2313,7 +2321,7 @@ if (value.type() != Json::stringValue) { - throw OrthancException(ErrorCode_BadFileFormat); + throw OrthancException(ErrorCode_BadFileFormat, std::string("Expecting a string in field '") + members[i] + std::string("'")); } target.SetValue(ParseTag(members[i]), value.asString(), false); @@ -2321,6 +2329,8 @@ } + + void FromDcmtkBridge::ChangeStringEncoding(DcmItem& dataset, Encoding source, bool hasSourceCodeExtensions, diff -r 88d838c6b4c7 -r c014ab79fca5 OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h --- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h Mon May 30 09:08:54 2022 +0200 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h Tue May 31 09:36:00 2022 +0200 @@ -240,7 +240,8 @@ size_t size); static void FromJson(DicomMap& values, - const Json::Value& result); + const Json::Value& result, + const char* fieldName = NULL); static void ExtractDicomSummary(DicomMap& target, DcmItem& dataset, diff -r 88d838c6b4c7 -r c014ab79fca5 OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Mon May 30 09:08:54 2022 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Tue May 31 09:36:00 2022 +0200 @@ -1523,8 +1523,8 @@ .SetDescription("Start a C-MOVE SCU command as a job, in order to drive the execution of a sequence of " "C-STORE commands by some remote DICOM modality whose identifier is provided in the URL: " "https://book.orthanc-server.com/users/rest.html#performing-c-move") - .SetRequestField(KEY_RESOURCES, RestApiCallDocumentation::Type_JsonListOfStrings, - "List of the Orthanc identifiers of all the DICOM resources to be sent", true) + .SetRequestField(KEY_RESOURCES, RestApiCallDocumentation::Type_JsonListOfObjects, + "List of queries identifying all the DICOM resources to be sent", true) .SetRequestField(KEY_LEVEL, RestApiCallDocumentation::Type_String, "Level of the query (`Patient`, `Study`, `Series` or `Instance`)", true) .SetRequestField(KEY_LOCAL_AET, RestApiCallDocumentation::Type_String, @@ -1572,7 +1572,7 @@ for (Json::Value::ArrayIndex i = 0; i < request[KEY_RESOURCES].size(); i++) { DicomMap resource; - FromDcmtkBridge::FromJson(resource, request[KEY_RESOURCES][i]); + FromDcmtkBridge::FromJson(resource, request[KEY_RESOURCES][i], "Resources elements"); connection.Move(targetAet, level, resource); }