comparison OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp @ 5405:62bb63346185

All 'expand' GET arguments now accepts expand=true and expand=false values + /studies/../instances now supports expand=false
author Alain Mazy <am@osimis.io>
date Tue, 17 Oct 2023 15:06:11 +0200
parents 261ce0ed85e6
children 59e3b6f8c5be
comparison
equal deleted inserted replaced
5404:7bae5f7ebe6a 5405:62bb63346185
841 .AddAnswerType(MimeType_Json, "JSON array containing the indices of the answers, or detailed information " 841 .AddAnswerType(MimeType_Json, "JSON array containing the indices of the answers, or detailed information "
842 "about the reported answers (if `expand` argument is provided)"); 842 "about the reported answers (if `expand` argument is provided)");
843 return; 843 return;
844 } 844 }
845 845
846 const bool expand = call.HasArgument("expand"); 846 const bool expand = call.HasArgument("expand") && call.GetBooleanArgument("expand", true);
847 const DicomToJsonFormat format = OrthancRestApi::GetDicomFormat(call, DicomToJsonFormat_Full); 847 const DicomToJsonFormat format = OrthancRestApi::GetDicomFormat(call, DicomToJsonFormat_Full);
848 848
849 QueryAccessor query(call); 849 QueryAccessor query(call);
850 size_t count = query.GetHandler().GetAnswersCount(); 850 size_t count = query.GetHandler().GetAnswersCount();
851 851
1647 OrthancConfiguration::ReaderLock lock; 1647 OrthancConfiguration::ReaderLock lock;
1648 1648
1649 OrthancRestApi::SetOfStrings peers; 1649 OrthancRestApi::SetOfStrings peers;
1650 lock.GetConfiguration().GetListOfOrthancPeers(peers); 1650 lock.GetConfiguration().GetListOfOrthancPeers(peers);
1651 1651
1652 if (call.HasArgument("expand")) 1652 if (call.HasArgument("expand") && call.GetBooleanArgument("expand", true))
1653 { 1653 {
1654 Json::Value result = Json::objectValue; 1654 Json::Value result = Json::objectValue;
1655 for (OrthancRestApi::SetOfStrings::const_iterator 1655 for (OrthancRestApi::SetOfStrings::const_iterator
1656 it = peers.begin(); it != peers.end(); ++it) 1656 it = peers.begin(); it != peers.end(); ++it)
1657 { 1657 {
1931 OrthancConfiguration::ReaderLock lock; 1931 OrthancConfiguration::ReaderLock lock;
1932 1932
1933 OrthancRestApi::SetOfStrings modalities; 1933 OrthancRestApi::SetOfStrings modalities;
1934 lock.GetConfiguration().GetListOfDicomModalities(modalities); 1934 lock.GetConfiguration().GetListOfDicomModalities(modalities);
1935 1935
1936 if (call.HasArgument("expand")) 1936 if (call.HasArgument("expand") && call.GetBooleanArgument("expand", true))
1937 { 1937 {
1938 Json::Value result = Json::objectValue; 1938 Json::Value result = Json::objectValue;
1939 for (OrthancRestApi::SetOfStrings::const_iterator 1939 for (OrthancRestApi::SetOfStrings::const_iterator
1940 it = modalities.begin(); it != modalities.end(); ++it) 1940 it = modalities.begin(); it != modalities.end(); ++it)
1941 { 1941 {