diff Core/DicomNetworking/DicomUserConnection.h @ 3799:320a2d224902

merge
author Alain Mazy <alain@mazy.be>
date Wed, 01 Apr 2020 10:15:33 +0200
parents 4fc24b69446a
children 3801435e34a1 7f083dfae62b
line wrap: on
line diff
--- a/Core/DicomNetworking/DicomUserConnection.h	Wed Apr 01 10:14:49 2020 +0200
+++ b/Core/DicomNetworking/DicomUserConnection.h	Wed Apr 01 10:15:33 2020 +0200
@@ -54,6 +54,13 @@
     struct PImpl;
     boost::shared_ptr<PImpl> pimpl_;
 
+    enum Mode
+    {
+      Mode_Generic,
+      Mode_ReportStorageCommitment,
+      Mode_RequestStorageCommitment
+    };
+    
     // Connection parameters
     std::string preferredTransferSyntax_;
     std::string localAet_;
@@ -67,7 +74,8 @@
 
     void CheckIsOpen() const;
 
-    void SetupPresentationContexts(const std::string& preferredTransferSyntax);
+    void SetupPresentationContexts(Mode mode,
+                                   const std::string& preferredTransferSyntax);
 
     void MoveInternal(const std::string& targetAet,
                       ResourceType level,
@@ -79,6 +87,8 @@
 
     void DefaultSetup();
 
+    void OpenInternal(Mode mode);
+
   public:
     DicomUserConnection();
 
@@ -137,7 +147,10 @@
 
     void AddStorageSOPClass(const char* sop);
 
-    void Open();
+    void Open()
+    {
+      OpenInternal(Mode_Generic);
+    }
 
     void Close();
 
@@ -145,33 +158,45 @@
 
     bool Echo();
 
-    void Store(const char* buffer, 
+    void Store(std::string& sopClassUid /* out */,
+               std::string& sopInstanceUid /* out */,
+               const char* buffer, 
                size_t size,
                const std::string& moveOriginatorAET,
                uint16_t moveOriginatorID);
 
-    void Store(const char* buffer, 
+    void Store(std::string& sopClassUid /* out */,
+               std::string& sopInstanceUid /* out */,
+               const char* buffer, 
                size_t size)
     {
-      Store(buffer, size, "", 0);  // Not a C-Move
+      Store(sopClassUid, sopInstanceUid, buffer, size, "", 0);  // Not a C-Move
     }
 
-    void Store(const std::string& buffer,
+    void Store(std::string& sopClassUid /* out */,
+               std::string& sopInstanceUid /* out */,
+               const std::string& buffer,
                const std::string& moveOriginatorAET,
                uint16_t moveOriginatorID);
 
-    void Store(const std::string& buffer)
+    void Store(std::string& sopClassUid /* out */,
+               std::string& sopInstanceUid /* out */,
+               const std::string& buffer)
     {
-      Store(buffer, "", 0);  // Not a C-Move
+      Store(sopClassUid, sopInstanceUid, buffer, "", 0);  // Not a C-Move
     }
 
-    void StoreFile(const std::string& path,
+    void StoreFile(std::string& sopClassUid /* out */,
+                   std::string& sopInstanceUid /* out */,
+                   const std::string& path,
                    const std::string& moveOriginatorAET,
                    uint16_t moveOriginatorID);
 
-    void StoreFile(const std::string& path)
+    void StoreFile(std::string& sopClassUid /* out */,
+                   std::string& sopInstanceUid /* out */,
+                   const std::string& path)
     {
-      StoreFile(path, "", 0);  // Not a C-Move
+      StoreFile(sopClassUid, sopInstanceUid, path, "", 0);  // Not a C-Move
     }
 
     void Find(DicomFindAnswers& result,
@@ -212,5 +237,17 @@
 
     bool IsSameAssociation(const std::string& localAet,
                            const RemoteModalityParameters& remote) const;
+
+    void ReportStorageCommitment(
+      const std::string& transactionUid,
+      const std::vector<std::string>& sopClassUids,
+      const std::vector<std::string>& sopInstanceUids,
+      const std::vector<StorageCommitmentFailureReason>& failureReasons);
+
+    // transactionUid: To be generated by Toolbox::GenerateDicomPrivateUniqueIdentifier()
+    void RequestStorageCommitment(
+      const std::string& transactionUid,
+      const std::vector<std::string>& sopClassUids,
+      const std::vector<std::string>& sopInstanceUids);
   };
 }