comparison Plugins/Engine/OrthancPluginDatabase.cpp @ 3078:147497152ce3 db-changes

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 03 Jan 2019 12:47:17 +0100
parents 8bc2cb1335f4
children 65e2bfa953ef
comparison
equal deleted inserted replaced
3077:aae1d6d31fef 3078:147497152ce3
1057 { 1057 {
1058 throw OrthancException(ErrorCode_DatabasePlugin); 1058 throw OrthancException(ErrorCode_DatabasePlugin);
1059 } 1059 }
1060 else 1060 else
1061 { 1061 {
1062 const OrthancPluginChange& change = *reinterpret_cast<const OrthancPluginChange*>(answer.valueGeneric); 1062 const OrthancPluginChange& change =
1063 *reinterpret_cast<const OrthancPluginChange*>(answer.valueGeneric);
1063 assert(answerChanges_ != NULL); 1064 assert(answerChanges_ != NULL);
1064 answerChanges_->push_back 1065 answerChanges_->push_back
1065 (ServerIndexChange(change.seq, 1066 (ServerIndexChange(change.seq,
1066 static_cast<ChangeType>(change.changeType), 1067 static_cast<ChangeType>(change.changeType),
1067 Plugins::Convert(change.resourceType), 1068 Plugins::Convert(change.resourceType),
1111 if (match.resourceId == NULL) 1112 if (match.resourceId == NULL)
1112 { 1113 {
1113 throw OrthancException(ErrorCode_DatabasePlugin); 1114 throw OrthancException(ErrorCode_DatabasePlugin);
1114 } 1115 }
1115 1116
1117 printf(" ++ [%s]\n", match.resourceId);
1118
1116 assert(answerMatchingResources_ != NULL); 1119 assert(answerMatchingResources_ != NULL);
1117 answerMatchingResources_->push_back(match.resourceId); 1120 answerMatchingResources_->push_back(match.resourceId);
1118 1121
1119 if (answerMatchingInstances_ != NULL) 1122 if (answerMatchingInstances_ != NULL)
1120 { 1123 {
1174 for (size_t i = 0; i < lookup.size(); i++) 1177 for (size_t i = 0; i < lookup.size(); i++)
1175 { 1178 {
1176 lookup[i].EncodeForPlugins(constraints[i], constraintsValues[i]); 1179 lookup[i].EncodeForPlugins(constraints[i], constraintsValues[i]);
1177 } 1180 }
1178 1181
1182 ResetAnswers();
1179 answerMatchingResources_ = &resourcesId; 1183 answerMatchingResources_ = &resourcesId;
1180 answerMatchingInstances_ = instancesId; 1184 answerMatchingInstances_ = instancesId;
1181 1185
1182 ResetAnswers();
1183
1184 CheckSuccess(extensions_.lookupResources(GetContext(), payload_, lookup.size(), 1186 CheckSuccess(extensions_.lookupResources(GetContext(), payload_, lookup.size(),
1185 (lookup.empty() ? NULL : &constraints[0]), 1187 (lookup.empty() ? NULL : &constraints[0]),
1186 Plugins::Convert(queryLevel), 1188 Plugins::Convert(queryLevel),
1187 limit, (instancesId == NULL ? 0 : 1))); 1189 limit, (instancesId == NULL ? 0 : 1)));
1188 } 1190 }