comparison OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 1383:5c11c4e728eb query-retrieve

integration mainline->query-retrieve
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 29 May 2015 14:46:55 +0200
parents b22ba8c5edbe a1745d9be6e9
children 772c8507c68d
comparison
equal deleted inserted replaced
1373:21a2929e541d 1383:5c11c4e728eb
857 if (call.ParseJsonRequest(request) && 857 if (call.ParseJsonRequest(request) &&
858 request.type() == Json::objectValue && 858 request.type() == Json::objectValue &&
859 request.isMember("Level") && 859 request.isMember("Level") &&
860 request.isMember("Query") && 860 request.isMember("Query") &&
861 request["Level"].type() == Json::stringValue && 861 request["Level"].type() == Json::stringValue &&
862 request["Query"].type() == Json::objectValue) 862 request["Query"].type() == Json::objectValue &&
863 (!request.isMember("CaseSensitive") || request["CaseSensitive"].type() == Json::booleanValue))
863 { 864 {
864 bool expand = false; 865 bool expand = false;
865 if (request.isMember("Expand")) 866 if (request.isMember("Expand"))
866 { 867 {
867 expand = request["Expand"].asBool(); 868 expand = request["Expand"].asBool();
869 }
870
871 bool caseSensitive = false;
872 if (request.isMember("CaseSensitive"))
873 {
874 caseSensitive = request["CaseSensitive"].asBool();
868 } 875 }
869 876
870 std::string level = request["Level"].asString(); 877 std::string level = request["Level"].asString();
871 878
872 DicomFindQuery query; 879 DicomFindQuery query;
879 { 886 {
880 throw OrthancException(ErrorCode_BadRequest); 887 throw OrthancException(ErrorCode_BadRequest);
881 } 888 }
882 889
883 query.SetConstraint(FromDcmtkBridge::ParseTag(members[i]), 890 query.SetConstraint(FromDcmtkBridge::ParseTag(members[i]),
884 request["Query"][members[i]].asString()); 891 request["Query"][members[i]].asString(),
892 caseSensitive);
885 } 893 }
886 894
887 std::list<std::string> resources; 895 std::list<std::string> resources;
888 ResourceFinder finder(context); 896 ResourceFinder finder(context);
889 finder.Apply(resources, query); 897 finder.Apply(resources, query);