comparison OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp @ 5220:df39c7583a49 db-protobuf

preparing virtual methods for labels
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Apr 2023 18:09:04 +0200
parents 450ac804d3af
children d0f7c742d397
comparison
equal deleted inserted replaced
5218:afa96af2eb5a 5220:df39c7583a49
563 563
564 virtual void ApplyLookupResources(std::list<std::string>& resourcesId, 564 virtual void ApplyLookupResources(std::list<std::string>& resourcesId,
565 std::list<std::string>* instancesId, 565 std::list<std::string>* instancesId,
566 const std::vector<DatabaseConstraint>& lookup, 566 const std::vector<DatabaseConstraint>& lookup,
567 ResourceType queryLevel, 567 ResourceType queryLevel,
568 const std::set<std::string>& withLabels,
569 const std::set<std::string>& withoutLabels,
568 uint32_t limit) ORTHANC_OVERRIDE 570 uint32_t limit) ORTHANC_OVERRIDE
569 { 571 {
572 if (!withLabels.empty() ||
573 !withoutLabels.empty())
574 {
575 throw OrthancException(ErrorCode_InternalError); // "HasLabelsSupport()" has returned "false"
576 }
577
570 if (that_.extensions_.lookupResources == NULL) 578 if (that_.extensions_.lookupResources == NULL)
571 { 579 {
572 // Fallback to compatibility mode 580 // Fallback to compatibility mode
573 ILookupResources::Apply 581 ILookupResources::Apply
574 (*this, *this, resourcesId, instancesId, lookup, queryLevel, limit); 582 (*this, *this, resourcesId, instancesId, lookup, queryLevel, limit);
1410 { 1418 {
1411 if (that_.extensions_.tagMostRecentPatient != NULL) 1419 if (that_.extensions_.tagMostRecentPatient != NULL)
1412 { 1420 {
1413 CheckSuccess(that_.extensions_.tagMostRecentPatient(that_.payload_, patient)); 1421 CheckSuccess(that_.extensions_.tagMostRecentPatient(that_.payload_, patient));
1414 } 1422 }
1423 }
1424
1425
1426 virtual void AddLabel(int64_t resource,
1427 const std::string& label) ORTHANC_OVERRIDE
1428 {
1429 throw OrthancException(ErrorCode_InternalError); // Not supported
1430 }
1431
1432
1433 virtual void RemoveLabel(int64_t resource,
1434 const std::string& label) ORTHANC_OVERRIDE
1435 {
1436 throw OrthancException(ErrorCode_InternalError); // Not supported
1437 }
1438
1439
1440 virtual void GetLabels(std::set<std::string>& target,
1441 int64_t resource) ORTHANC_OVERRIDE
1442 {
1443 throw OrthancException(ErrorCode_InternalError); // Not supported
1415 } 1444 }
1416 }; 1445 };
1417 1446
1418 1447
1419 void OrthancPluginDatabase::CheckSuccess(OrthancPluginErrorCode code) 1448 void OrthancPluginDatabase::CheckSuccess(OrthancPluginErrorCode code)