comparison OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 1201:09aa7c126be9 db-changes

URIs 'instance-tags' now indexed by the instance IDs
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 24 Oct 2014 11:43:47 +0200
parents 059391d3f8df
children 6164f7200c43
comparison
equal deleted inserted replaced
1200:1e1390665639 1201:09aa7c126be9
886 typedef std::list<std::string> Instances; 886 typedef std::list<std::string> Instances;
887 Instances instances; 887 Instances instances;
888 888
889 context.GetIndex().GetChildInstances(instances, publicId); // (*) 889 context.GetIndex().GetChildInstances(instances, publicId); // (*)
890 890
891 Json::Value result = Json::arrayValue; 891 Json::Value result = Json::objectValue;
892 892
893 for (Instances::const_iterator it = instances.begin(); 893 for (Instances::const_iterator it = instances.begin();
894 it != instances.end(); it++) 894 it != instances.end(); it++)
895 { 895 {
896 Json::Value full; 896 Json::Value full;
898 898
899 if (simplify) 899 if (simplify)
900 { 900 {
901 Json::Value simplified; 901 Json::Value simplified;
902 SimplifyTags(simplified, full); 902 SimplifyTags(simplified, full);
903 result.append(simplified); 903 result[*it] = simplified;
904 } 904 }
905 else 905 else
906 { 906 {
907 result.append(full); 907 result[*it] = full;
908 } 908 }
909 } 909 }
910 910
911 call.GetOutput().AnswerJson(result); 911 call.GetOutput().AnswerJson(result);
912 } 912 }