# HG changeset patch # User Sebastien Jodogne # Date 1720803560 -7200 # Node ID 31eb66eaed86ec33e1b54510df5bd958c51f6d09 # Parent a786da7599d5b2ad502529fa18f861c5741cf60b fix previous integration diff -r a786da7599d5 -r 31eb66eaed86 OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Fri Jul 12 18:55:22 2024 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Fri Jul 12 18:59:20 2024 +0200 @@ -3443,7 +3443,7 @@ const DicomToJsonFormat format = OrthancRestApi::GetDicomFormat(call, DicomToJsonFormat_Human); Json::Value resource; - if (OrthancRestApi::GetContext(call).ExpandResource(resource, current, end, format, requestedTags, true /* allowStorageAccess */)) + if (ExpandResource(resource, OrthancRestApi::GetIndex(call), currentType, current, format, false)) { call.GetOutput().AnswerJson(resource); } @@ -3722,24 +3722,6 @@ } - static void AddMetadata(Json::Value& target, - ServerIndex& index, - const std::string& resource, - ResourceType level) - { - target = Json::objectValue; - - std::map content; - index.GetAllMetadata(content, resource, level); - - for (std::map::const_iterator - it = content.begin(); it != content.end(); ++it) - { - target[EnumerationToString(it->first)] = it->second; - } - } - - static void BulkContent(RestApiPostCall& call) { static const char* const LEVEL = "Level"; @@ -3877,15 +3859,8 @@ it = interest.begin(); it != interest.end(); ++it) { Json::Value item; - std::set emptyRequestedTags; // not supported for bulk content - - if (OrthancRestApi::GetContext(call).ExpandResource(item, *it, level, format, emptyRequestedTags, true /* allowStorageAccess */)) + if (ExpandResource(item, OrthancRestApi::GetIndex(call), level, *it, format, metadata)) { - if (metadata) - { - AddMetadata(item[METADATA], index, *it, level); - } - answer.append(item); } } @@ -3901,16 +3876,10 @@ { ResourceType level; Json::Value item; - std::set emptyRequestedTags; // not supported for bulk content if (index.LookupResourceType(level, *it) && - OrthancRestApi::GetContext(call).ExpandResource(item, *it, level, format, emptyRequestedTags, true /* allowStorageAccess */)) + ExpandResource(item, OrthancRestApi::GetIndex(call), level, *it, format, metadata)) { - if (metadata) - { - AddMetadata(item[METADATA], index, *it, level); - } - answer.append(item); } else