comparison Framework/Plugins/OrthancCppDatabasePlugin.h @ 78:2ee166f77501 db-changes

renamed macro
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 06 Jan 2019 12:48:18 +0100
parents a1c6238b26f8
children 1012fe77241c
comparison
equal deleted inserted replaced
77:a2134531473c 78:2ee166f77501
250 250
251 OrthancPluginDatabaseAnswerExportedResource(context_, database_, &exported); 251 OrthancPluginDatabaseAnswerExportedResource(context_, database_, &exported);
252 } 252 }
253 253
254 254
255 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 255 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
256 void AnswerMatchingResource(const std::string& resourceId) 256 void AnswerMatchingResource(const std::string& resourceId)
257 { 257 {
258 if (allowedAnswers_ != AllowedAnswers_All && 258 if (allowedAnswers_ != AllowedAnswers_All &&
259 allowedAnswers_ != AllowedAnswers_MatchingResource) 259 allowedAnswers_ != AllowedAnswers_MatchingResource)
260 { 260 {
268 OrthancPluginDatabaseAnswerMatchingResource(context_, database_, &match); 268 OrthancPluginDatabaseAnswerMatchingResource(context_, database_, &match);
269 } 269 }
270 #endif 270 #endif
271 271
272 272
273 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 273 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
274 void AnswerMatchingResource(const std::string& resourceId, 274 void AnswerMatchingResource(const std::string& resourceId,
275 const std::string& someInstanceId) 275 const std::string& someInstanceId)
276 { 276 {
277 if (allowedAnswers_ != AllowedAnswers_All && 277 if (allowedAnswers_ != AllowedAnswers_All &&
278 allowedAnswers_ != AllowedAnswers_MatchingResource) 278 allowedAnswers_ != AllowedAnswers_MatchingResource)
492 492
493 virtual void ClearMainDicomTags(int64_t internalId) = 0; 493 virtual void ClearMainDicomTags(int64_t internalId) = 0;
494 494
495 virtual bool HasCreateInstance() const = 0; 495 virtual bool HasCreateInstance() const = 0;
496 496
497 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 497 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
498 virtual void LookupResources(const std::vector<Orthanc::DatabaseConstraint>& lookup, 498 virtual void LookupResources(const std::vector<Orthanc::DatabaseConstraint>& lookup,
499 OrthancPluginResourceType queryLevel, 499 OrthancPluginResourceType queryLevel,
500 uint32_t limit, 500 uint32_t limit,
501 bool requestSomeInstance) = 0; 501 bool requestSomeInstance) = 0;
502 #endif 502 #endif
503 503
504 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 504 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
505 virtual void CreateInstance(OrthancPluginCreateInstanceResult& result, 505 virtual void CreateInstance(OrthancPluginCreateInstanceResult& result,
506 const char* hashPatient, 506 const char* hashPatient,
507 const char* hashStudy, 507 const char* hashStudy,
508 const char* hashSeries, 508 const char* hashSeries,
509 const char* hashInstance) 509 const char* hashInstance)
511 throw std::runtime_error("Not implemented"); 511 throw std::runtime_error("Not implemented");
512 } 512 }
513 #endif 513 #endif
514 514
515 515
516 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 516 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
517 virtual void SetResourcesContent( 517 virtual void SetResourcesContent(
518 uint32_t countIdentifierTags, 518 uint32_t countIdentifierTags,
519 const OrthancPluginResourcesContentTags* identifierTags, 519 const OrthancPluginResourcesContentTags* identifierTags,
520 uint32_t countMainDicomTags, 520 uint32_t countMainDicomTags,
521 const OrthancPluginResourcesContentTags* mainDicomTags, 521 const OrthancPluginResourcesContentTags* mainDicomTags,
522 uint32_t countMetadata, 522 uint32_t countMetadata,
523 const OrthancPluginResourcesContentMetadata* metadata) = 0; 523 const OrthancPluginResourcesContentMetadata* metadata) = 0;
524 #endif 524 #endif
525 525
526 526
527 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 527 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
528 virtual void GetChildrenMetadata(std::list<std::string>& target, 528 virtual void GetChildrenMetadata(std::list<std::string>& target,
529 int64_t resourceId, 529 int64_t resourceId,
530 int32_t metadata) = 0; 530 int32_t metadata) = 0;
531 #endif 531 #endif
532 }; 532 };
1505 } 1505 }
1506 ORTHANC_PLUGINS_DATABASE_CATCH 1506 ORTHANC_PLUGINS_DATABASE_CATCH
1507 } 1507 }
1508 1508
1509 1509
1510 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 1510 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
1511 /* Use GetOutput().AnswerResource() */ 1511 /* Use GetOutput().AnswerResource() */
1512 static OrthancPluginErrorCode LookupResources( 1512 static OrthancPluginErrorCode LookupResources(
1513 OrthancPluginDatabaseContext* context, 1513 OrthancPluginDatabaseContext* context,
1514 void* payload, 1514 void* payload,
1515 uint32_t constraintsCount, 1515 uint32_t constraintsCount,
1537 ORTHANC_PLUGINS_DATABASE_CATCH 1537 ORTHANC_PLUGINS_DATABASE_CATCH
1538 } 1538 }
1539 #endif 1539 #endif
1540 1540
1541 1541
1542 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 1542 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
1543 static OrthancPluginErrorCode CreateInstance(OrthancPluginCreateInstanceResult* output, 1543 static OrthancPluginErrorCode CreateInstance(OrthancPluginCreateInstanceResult* output,
1544 void* payload, 1544 void* payload,
1545 const char* hashPatient, 1545 const char* hashPatient,
1546 const char* hashStudy, 1546 const char* hashStudy,
1547 const char* hashSeries, 1547 const char* hashSeries,
1558 ORTHANC_PLUGINS_DATABASE_CATCH 1558 ORTHANC_PLUGINS_DATABASE_CATCH
1559 } 1559 }
1560 #endif 1560 #endif
1561 1561
1562 1562
1563 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 1563 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
1564 static OrthancPluginErrorCode SetResourcesContent( 1564 static OrthancPluginErrorCode SetResourcesContent(
1565 void* payload, 1565 void* payload,
1566 uint32_t countIdentifierTags, 1566 uint32_t countIdentifierTags,
1567 const OrthancPluginResourcesContentTags* identifierTags, 1567 const OrthancPluginResourcesContentTags* identifierTags,
1568 uint32_t countMainDicomTags, 1568 uint32_t countMainDicomTags,
1584 } 1584 }
1585 #endif 1585 #endif
1586 1586
1587 1587
1588 1588
1589 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 1589 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
1590 // New primitive since Orthanc 1.5.2 1590 // New primitive since Orthanc 1.5.2
1591 static OrthancPluginErrorCode GetChildrenMetadata(OrthancPluginDatabaseContext* context, 1591 static OrthancPluginErrorCode GetChildrenMetadata(OrthancPluginDatabaseContext* context,
1592 void* payload, 1592 void* payload,
1593 int64_t resourceId, 1593 int64_t resourceId,
1594 int32_t metadata) 1594 int32_t metadata)
1693 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 4, 0) 1693 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 4, 0)
1694 extensions.lookupIdentifierRange = LookupIdentifierRange; // New in Orthanc 1.4.0 1694 extensions.lookupIdentifierRange = LookupIdentifierRange; // New in Orthanc 1.4.0
1695 # endif 1695 # endif
1696 #endif 1696 #endif
1697 1697
1698 #if ORTHANC_PLUGINS_HAS_DATABASE_OPTIMIZATIONS_1 == 1 1698 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1
1699 // Optimizations brought by Orthanc 1.5.2 1699 // Optimizations brought by Orthanc 1.5.2
1700 extensions.lookupResources = LookupResources; // Fast lookup 1700 extensions.lookupResources = LookupResources; // Fast lookup
1701 extensions.setResourcesContent = SetResourcesContent; // Fast setting tags/metadata 1701 extensions.setResourcesContent = SetResourcesContent; // Fast setting tags/metadata
1702 extensions.getChildrenMetadata = GetChildrenMetadata; 1702 extensions.getChildrenMetadata = GetChildrenMetadata;
1703 1703