Mercurial > hg > orthanc
comparison Plugins/Engine/OrthancPluginDatabase.cpp @ 3051:39db63e68dcf db-changes
fix build
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 20 Dec 2018 16:49:07 +0100 |
parents | 53d583d2c775 |
children | c7db469bbe8e |
comparison
equal
deleted
inserted
replaced
3050:d8a91acb7424 | 3051:39db63e68dcf |
---|---|
1116 ResourceType queryLevel, | 1116 ResourceType queryLevel, |
1117 size_t limit) | 1117 size_t limit) |
1118 { | 1118 { |
1119 throw OrthancException(ErrorCode_NotImplemented); | 1119 throw OrthancException(ErrorCode_NotImplemented); |
1120 } | 1120 } |
1121 | |
1122 | |
1123 void OrthancPluginDatabase::LookupIdentifier(std::list<int64_t>& result, | |
1124 ResourceType level, | |
1125 const DicomTag& tag, | |
1126 IdentifierConstraintType type, | |
1127 const std::string& value) | |
1128 { | |
1129 if (extensions_.lookupIdentifier3 == NULL) | |
1130 { | |
1131 throw OrthancException(ErrorCode_DatabasePlugin, | |
1132 "The database plugin does not implement the LookupIdentifier3 primitive"); | |
1133 } | |
1134 | |
1135 OrthancPluginDicomTag tmp; | |
1136 tmp.group = tag.GetGroup(); | |
1137 tmp.element = tag.GetElement(); | |
1138 tmp.value = value.c_str(); | |
1139 | |
1140 ResetAnswers(); | |
1141 CheckSuccess(extensions_.lookupIdentifier3(GetContext(), payload_, Plugins::Convert(level), | |
1142 &tmp, Plugins::Convert(type))); | |
1143 ForwardAnswers(result); | |
1144 } | |
1145 | |
1146 | |
1147 void OrthancPluginDatabase::LookupIdentifierRange(std::list<int64_t>& result, | |
1148 ResourceType level, | |
1149 const DicomTag& tag, | |
1150 const std::string& start, | |
1151 const std::string& end) | |
1152 { | |
1153 if (extensions_.lookupIdentifierRange == NULL) | |
1154 { | |
1155 // Default implementation, for plugins using Orthanc SDK <= 1.3.2 | |
1156 | |
1157 LookupIdentifier(result, level, tag, IdentifierConstraintType_GreaterOrEqual, start); | |
1158 | |
1159 std::list<int64_t> b; | |
1160 LookupIdentifier(result, level, tag, IdentifierConstraintType_SmallerOrEqual, end); | |
1161 | |
1162 result.splice(result.end(), b); | |
1163 } | |
1164 else | |
1165 { | |
1166 ResetAnswers(); | |
1167 CheckSuccess(extensions_.lookupIdentifierRange(GetContext(), payload_, Plugins::Convert(level), | |
1168 tag.GetGroup(), tag.GetElement(), | |
1169 start.c_str(), end.c_str())); | |
1170 ForwardAnswers(result); | |
1171 } | |
1172 } | |
1121 } | 1173 } |