diff Core/DicomParsing/DicomModification.h @ 2535:d3476d90dcb7

DicomModification::SetDicomIdentifierGenerator()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Apr 2018 13:03:34 +0200
parents 2e6b7862ccf2
children 2f3007bf0708
line wrap: on
line diff
--- a/Core/DicomParsing/DicomModification.h	Tue Apr 17 11:42:01 2018 +0200
+++ b/Core/DicomParsing/DicomModification.h	Tue Apr 17 13:03:34 2018 +0200
@@ -53,6 +53,19 @@
       TagOperation_Remove
     };
 
+    class IDicomIdentifierGenerator : public boost::noncopyable
+    {
+    public:
+      virtual ~IDicomIdentifierGenerator()
+      {
+      }
+
+      virtual bool Apply(std::string& target,
+                         const std::string& sourceIdentifier,
+                         ResourceType level,
+                         const DicomMap& sourceDicom) = 0;                       
+    };
+
   private:
     class RelationshipsVisitor;
 
@@ -71,6 +84,9 @@
     bool keepStudyInstanceUid_;
     bool keepSeriesInstanceUid_;
     bool updateReferencedRelationships_;
+    DicomMap currentSource_;
+
+    IDicomIdentifierGenerator* identifierGenerator_;
 
     std::string MapDicomIdentifier(const std::string& original,
                                    ResourceType level);
@@ -151,5 +167,10 @@
 
     void ParseAnonymizationRequest(bool& patientNameReplaced,
                                    const Json::Value& request);
+
+    void SetDicomIdentifierGenerator(IDicomIdentifierGenerator& generator)
+    {
+      identifierGenerator_ = &generator;
+    }
   };
 }