Mercurial > hg > orthanc
diff OrthancServer/OrthancRestApi/OrthancRestApi.cpp @ 948:e57e08ed510f dicom-rt
integration mainline -> dicom-rt
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 25 Jun 2014 13:57:05 +0200 |
parents | c19552f604d5 84513f2ee1f3 |
children |
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestApi.cpp Wed Apr 16 16:15:58 2014 +0200 +++ b/OrthancServer/OrthancRestApi/OrthancRestApi.cpp Wed Jun 25 13:57:05 2014 +0200 @@ -30,12 +30,33 @@ **/ +#include "../PrecompiledHeadersServer.h" #include "OrthancRestApi.h" +#include "../DicomModification.h" + #include <glog/logging.h> namespace Orthanc { + void OrthancRestApi::AnswerStoredInstance(RestApi::PostCall& call, + const std::string& publicId, + StoreStatus status) + { + Json::Value result = Json::objectValue; + + if (status != StoreStatus_Failure) + { + result["ID"] = publicId; + result["Path"] = GetBasePath(ResourceType_Instance, publicId); + } + + result["Status"] = EnumerationToString(status); + call.GetOutput().AnswerJson(result); + } + + + // Upload of DICOM files through HTTP --------------------------------------- static void UploadDicomFile(RestApi::PostCall& call) @@ -52,16 +73,8 @@ std::string publicId; StoreStatus status = context.Store(publicId, postData); - Json::Value result = Json::objectValue; - if (status != StoreStatus_Failure) - { - result["ID"] = publicId; - result["Path"] = GetBasePath(ResourceType_Instance, publicId); - } - - result["Status"] = EnumerationToString(status); - call.GetOutput().AnswerJson(result); + OrthancRestApi::GetApi(call).AnswerStoredInstance(call, publicId, status); }