# HG changeset patch # User Sebastien Jodogne # Date 1686860506 -7200 # Node ID c34ecc350b32039bc6336f17cb6d0c27d930cffd # Parent fdb8c6c420d02953e3f30d55f859f5c628a7b706 upgraded the node docker image diff -r fdb8c6c420d0 -r c34ecc350b32 Resources/CreateOHIFDist/Dockerfile --- a/Resources/CreateOHIFDist/Dockerfile Thu Jun 15 21:18:34 2023 +0200 +++ b/Resources/CreateOHIFDist/Dockerfile Thu Jun 15 22:21:46 2023 +0200 @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -FROM node:19.7.0-bullseye-slim +FROM node:20.3.0-bullseye-slim MAINTAINER Sebastien Jodogne LABEL Description="Orthanc, free DICOM server" Vendor="The Orthanc project" diff -r fdb8c6c420d0 -r c34ecc350b32 Resources/CreateOHIFDist/build.sh --- a/Resources/CreateOHIFDist/build.sh Thu Jun 15 21:18:34 2023 +0200 +++ b/Resources/CreateOHIFDist/build.sh Thu Jun 15 22:21:46 2023 +0200 @@ -30,7 +30,7 @@ tar xvf /source/$1.tar.gz cd /tmp/$1 -yarn install --frozen-lockfile -QUICK_BUILD=true PUBLIC_URL=./ yarn run build +HOME=/tmp yarn install --frozen-lockfile +HOME=/tmp QUICK_BUILD=true PUBLIC_URL=./ yarn run build cp -r /tmp/$1/platform/app/dist/* /target diff -r fdb8c6c420d0 -r c34ecc350b32 Sources/Plugin.cpp --- a/Sources/Plugin.cpp Thu Jun 15 21:18:34 2023 +0200 +++ b/Sources/Plugin.cpp Thu Jun 15 22:21:46 2023 +0200 @@ -26,8 +26,10 @@ #include #include +#include #include #include +#include #include @@ -261,16 +263,55 @@ break; case DataType_Integer: - target[tag] = boost::lexical_cast(value.asString()); + { + int32_t v; + if (Orthanc::SerializationToolbox::ParseInteger32(v, value.asString())) + { + target[tag] = v; + } break; + } case DataType_Float: - target[tag] = boost::lexical_cast(value.asString()); + { + float v; + if (Orthanc::SerializationToolbox::ParseFloat(v, value.asString())) + { + target[tag] = v; + } break; + } + + case DataType_ListOfStrings: + { + std::vector tokens; + Orthanc::Toolbox::TokenizeString(tokens, value.asString(), '\\'); + target[tag] = Json::arrayValue; + for (size_t i = 0; i < tokens.size(); i++) + { + target[tag].append(tokens[i]); + } + break; + } + + case DataType_ListOfFloats: + { + std::vector tokens; + Orthanc::Toolbox::TokenizeString(tokens, value.asString(), '\\'); + target[tag] = Json::arrayValue; + for (size_t i = 0; i < tokens.size(); i++) + { + float v; + if (Orthanc::SerializationToolbox::ParseFloat(v, tokens[i])) + { + target[tag].append(v); + } + } + break; + } default: - // TODO - break; + throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } } @@ -280,9 +321,6 @@ } } } - - //Orthanc::DicomMap m; - } @@ -338,8 +376,20 @@ { /*{ Json::Value v; - GetOhifDicomTags(v, "4368e7c1-33f7303d-5fc9fcc6-6e5fde31-6959b209"); + GetOhifDicomTags(v, "54bfd747-407e46b1-ef106fdd-dc19e482-ff8dbe02"); std::cout << v.toStyledString(); + std::string s; + Orthanc::Toolbox::WriteFastJson(s, v); + std::cout << s.size() << std::endl; + + Orthanc::GzipCompressor c; + std::string ss; + Orthanc::IBufferCompressor::Compress(ss, c, s); + std::cout << ss.size() << std::endl; + + std::string sss; + Orthanc::Toolbox::EncodeBase64(sss, ss); + std::cout << sss.size() << std::endl; }*/ Json::Value info;