Mercurial > hg > orthanc-databases
comparison Framework/Plugins/DatabaseBackendAdapterV2.cpp @ 271:6b18d3fbee82
backward compatibility with Orthanc SDK 0.9.5
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 22 Apr 2021 10:41:29 +0200 |
parents | 34e2b93a7ac1 |
children | 16aac0287485 cd9521e04249 |
comparison
equal
deleted
inserted
replaced
270:5931c2ff22ca | 271:6b18d3fbee82 |
---|---|
1027 } | 1027 } |
1028 ORTHANC_PLUGINS_DATABASE_CATCH; | 1028 ORTHANC_PLUGINS_DATABASE_CATCH; |
1029 } | 1029 } |
1030 | 1030 |
1031 | 1031 |
1032 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) | |
1033 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 4, 0) | |
1032 static OrthancPluginErrorCode LookupIdentifierRange(OrthancPluginDatabaseContext* context, | 1034 static OrthancPluginErrorCode LookupIdentifierRange(OrthancPluginDatabaseContext* context, |
1033 void* payload, | 1035 void* payload, |
1034 OrthancPluginResourceType resourceType, | 1036 OrthancPluginResourceType resourceType, |
1035 uint16_t group, | 1037 uint16_t group, |
1036 uint16_t element, | 1038 uint16_t element, |
1057 | 1059 |
1058 return OrthancPluginErrorCode_Success; | 1060 return OrthancPluginErrorCode_Success; |
1059 } | 1061 } |
1060 ORTHANC_PLUGINS_DATABASE_CATCH; | 1062 ORTHANC_PLUGINS_DATABASE_CATCH; |
1061 } | 1063 } |
1064 # endif | |
1065 #endif | |
1062 | 1066 |
1063 | 1067 |
1064 static OrthancPluginErrorCode LookupMetadata(OrthancPluginDatabaseContext* context, | 1068 static OrthancPluginErrorCode LookupMetadata(OrthancPluginDatabaseContext* context, |
1065 void* payload, | 1069 void* payload, |
1066 int64_t id, | 1070 int64_t id, |
1463 ORTHANC_PLUGINS_DATABASE_CATCH; | 1467 ORTHANC_PLUGINS_DATABASE_CATCH; |
1464 } | 1468 } |
1465 #endif | 1469 #endif |
1466 | 1470 |
1467 | 1471 |
1472 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) | |
1473 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2) | |
1468 // New primitive since Orthanc 1.5.2 | 1474 // New primitive since Orthanc 1.5.2 |
1469 static OrthancPluginErrorCode GetChildrenMetadata(OrthancPluginDatabaseContext* context, | 1475 static OrthancPluginErrorCode GetChildrenMetadata(OrthancPluginDatabaseContext* context, |
1470 void* payload, | 1476 void* payload, |
1471 int64_t resourceId, | 1477 int64_t resourceId, |
1472 int32_t metadata) | 1478 int32_t metadata) |
1492 | 1498 |
1493 return OrthancPluginErrorCode_Success; | 1499 return OrthancPluginErrorCode_Success; |
1494 } | 1500 } |
1495 ORTHANC_PLUGINS_DATABASE_CATCH; | 1501 ORTHANC_PLUGINS_DATABASE_CATCH; |
1496 } | 1502 } |
1497 | 1503 # endif |
1498 | 1504 #endif |
1505 | |
1506 | |
1507 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) | |
1508 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2) | |
1499 // New primitive since Orthanc 1.5.2 | 1509 // New primitive since Orthanc 1.5.2 |
1500 static OrthancPluginErrorCode GetLastChangeIndex(int64_t* result, | 1510 static OrthancPluginErrorCode GetLastChangeIndex(int64_t* result, |
1501 void* payload) | 1511 void* payload) |
1502 { | 1512 { |
1503 DatabaseBackendAdapterV2::Adapter* adapter = reinterpret_cast<DatabaseBackendAdapterV2::Adapter*>(payload); | 1513 DatabaseBackendAdapterV2::Adapter* adapter = reinterpret_cast<DatabaseBackendAdapterV2::Adapter*>(payload); |
1508 *result = adapter->GetBackend().GetLastChangeIndex(accessor.GetManager()); | 1518 *result = adapter->GetBackend().GetLastChangeIndex(accessor.GetManager()); |
1509 return OrthancPluginErrorCode_Success; | 1519 return OrthancPluginErrorCode_Success; |
1510 } | 1520 } |
1511 ORTHANC_PLUGINS_DATABASE_CATCH; | 1521 ORTHANC_PLUGINS_DATABASE_CATCH; |
1512 } | 1522 } |
1513 | 1523 # endif |
1514 | 1524 #endif |
1525 | |
1526 | |
1527 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) | |
1528 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2) | |
1515 // New primitive since Orthanc 1.5.2 | 1529 // New primitive since Orthanc 1.5.2 |
1516 static OrthancPluginErrorCode TagMostRecentPatient(void* payload, | 1530 static OrthancPluginErrorCode TagMostRecentPatient(void* payload, |
1517 int64_t patientId) | 1531 int64_t patientId) |
1518 { | 1532 { |
1519 DatabaseBackendAdapterV2::Adapter* adapter = reinterpret_cast<DatabaseBackendAdapterV2::Adapter*>(payload); | 1533 DatabaseBackendAdapterV2::Adapter* adapter = reinterpret_cast<DatabaseBackendAdapterV2::Adapter*>(payload); |
1524 adapter->GetBackend().TagMostRecentPatient(accessor.GetManager(), patientId); | 1538 adapter->GetBackend().TagMostRecentPatient(accessor.GetManager(), patientId); |
1525 return OrthancPluginErrorCode_Success; | 1539 return OrthancPluginErrorCode_Success; |
1526 } | 1540 } |
1527 ORTHANC_PLUGINS_DATABASE_CATCH; | 1541 ORTHANC_PLUGINS_DATABASE_CATCH; |
1528 } | 1542 } |
1543 # endif | |
1544 #endif | |
1529 | 1545 |
1530 | 1546 |
1531 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) // Macro introduced in 1.3.1 | 1547 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) // Macro introduced in 1.3.1 |
1532 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 4) | 1548 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 4) |
1533 // New primitive since Orthanc 1.5.4 | 1549 // New primitive since Orthanc 1.5.4 |