Mercurial > hg > orthanc-databases
comparison Framework/Plugins/OrthancCppDatabasePlugin.h @ 88:eb08ec14fb04 db-changes
new extension implemented: TagMostRecentPatient
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 15 Jan 2019 21:10:50 +0100 |
parents | 1012fe77241c |
children | ca0ecd412988 |
comparison
equal
deleted
inserted
replaced
87:48d445f756db | 88:eb08ec14fb04 |
---|---|
530 virtual void GetChildrenMetadata(std::list<std::string>& target, | 530 virtual void GetChildrenMetadata(std::list<std::string>& target, |
531 int64_t resourceId, | 531 int64_t resourceId, |
532 int32_t metadata) = 0; | 532 int32_t metadata) = 0; |
533 | 533 |
534 virtual int64_t GetLastChangeIndex() = 0; | 534 virtual int64_t GetLastChangeIndex() = 0; |
535 | |
536 virtual void TagMostRecentPatient(int64_t patientId) = 0; | |
535 }; | 537 }; |
536 | 538 |
537 | 539 |
538 | 540 |
539 /** | 541 /** |
1624 backend->GetOutput().SetAllowedAnswers(DatabaseBackendOutput::AllowedAnswers_None); | 1626 backend->GetOutput().SetAllowedAnswers(DatabaseBackendOutput::AllowedAnswers_None); |
1625 | 1627 |
1626 try | 1628 try |
1627 { | 1629 { |
1628 *result = backend->GetLastChangeIndex(); | 1630 *result = backend->GetLastChangeIndex(); |
1631 return OrthancPluginErrorCode_Success; | |
1632 } | |
1633 ORTHANC_PLUGINS_DATABASE_CATCH | |
1634 } | |
1635 | |
1636 | |
1637 // New primitive since Orthanc 1.5.2 | |
1638 static OrthancPluginErrorCode TagMostRecentPatient(void* payload, | |
1639 int64_t patientId) | |
1640 { | |
1641 IDatabaseBackend* backend = reinterpret_cast<IDatabaseBackend*>(payload); | |
1642 backend->GetOutput().SetAllowedAnswers(DatabaseBackendOutput::AllowedAnswers_None); | |
1643 | |
1644 try | |
1645 { | |
1646 backend->TagMostRecentPatient(patientId); | |
1629 return OrthancPluginErrorCode_Success; | 1647 return OrthancPluginErrorCode_Success; |
1630 } | 1648 } |
1631 ORTHANC_PLUGINS_DATABASE_CATCH | 1649 ORTHANC_PLUGINS_DATABASE_CATCH |
1632 } | 1650 } |
1633 | 1651 |
1715 // Optimizations brought by Orthanc 1.5.2 | 1733 // Optimizations brought by Orthanc 1.5.2 |
1716 extensions.lookupResources = LookupResources; // Fast lookup | 1734 extensions.lookupResources = LookupResources; // Fast lookup |
1717 extensions.setResourcesContent = SetResourcesContent; // Fast setting tags/metadata | 1735 extensions.setResourcesContent = SetResourcesContent; // Fast setting tags/metadata |
1718 extensions.getChildrenMetadata = GetChildrenMetadata; | 1736 extensions.getChildrenMetadata = GetChildrenMetadata; |
1719 extensions.getLastChangeIndex = GetLastChangeIndex; | 1737 extensions.getLastChangeIndex = GetLastChangeIndex; |
1738 extensions.tagMostRecentPatient = TagMostRecentPatient; | |
1720 | 1739 |
1721 if (backend.HasCreateInstance()) | 1740 if (backend.HasCreateInstance()) |
1722 { | 1741 { |
1723 extensions.createInstance = CreateInstance; // Fast creation of resources | 1742 extensions.createInstance = CreateInstance; // Fast creation of resources |
1724 } | 1743 } |