comparison OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 1374:a1745d9be6e9

CaseSensitivePN configuration option
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 28 May 2015 15:30:42 +0200
parents 94ffb597d297
children 5c11c4e728eb d6971e18a324
comparison
equal deleted inserted replaced
1369:4460e2622016 1374:a1745d9be6e9
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);