comparison OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp @ 4623:95ffe3b6ef7c db-changes

handling of revisions for metadata
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 16 Apr 2021 17:13:03 +0200
parents b91ed9e7f43c
children f7d5372b59b3
comparison
equal deleted inserted replaced
4622:9086aeb9d9d2 4623:95ffe3b6ef7c
704 return ReadSingleStringAnswer(target); 704 return ReadSingleStringAnswer(target);
705 } 705 }
706 706
707 707
708 virtual bool LookupMetadata(std::string& target, 708 virtual bool LookupMetadata(std::string& target,
709 int64_t& revision,
709 int64_t id, 710 int64_t id,
710 MetadataType type) ORTHANC_OVERRIDE 711 MetadataType type) ORTHANC_OVERRIDE
711 { 712 {
712 CheckSuccess(that_.backend_.lookupMetadata(transaction_, id, static_cast<int32_t>(type))); 713 CheckSuccess(that_.backend_.lookupMetadata(transaction_, &revision, id, static_cast<int32_t>(type)));
713 CheckNoEvent(); 714 CheckNoEvent();
714 return ReadSingleStringAnswer(target); 715 return ReadSingleStringAnswer(target);
715 } 716 }
716 717
717 718
783 } 784 }
784 785
785 786
786 virtual void SetMetadata(int64_t id, 787 virtual void SetMetadata(int64_t id,
787 MetadataType type, 788 MetadataType type,
788 const std::string& value) ORTHANC_OVERRIDE 789 const std::string& value,
789 { 790 int64_t revision) ORTHANC_OVERRIDE
790 CheckSuccess(that_.backend_.setMetadata(transaction_, id, static_cast<int32_t>(type), value.c_str())); 791 {
792 CheckSuccess(that_.backend_.setMetadata(transaction_, id, static_cast<int32_t>(type), value.c_str(), revision));
791 CheckNoEvent(); 793 CheckNoEvent();
792 } 794 }
793 795
794 796
795 virtual void SetProtectedPatient(int64_t internalId, 797 virtual void SetProtectedPatient(int64_t internalId,