changeset 214:d74ed3e6423e

documented orthanc.RegisterStorageCommitmentScpCallback()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 03 Jul 2024 15:29:01 +0200
parents f8dc8dd2da76
children b124c74e6968
files CodeAnalysis/CustomFunctions.json Sources/Autogenerated/orthanc.pyi Sources/Autogenerated/sdk_GlobalFunctions.impl.h Sources/Plugin.cpp
diffstat 4 files changed, 54 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/CodeAnalysis/CustomFunctions.json	Wed Jul 03 14:56:51 2024 +0200
+++ b/CodeAnalysis/CustomFunctions.json	Wed Jul 03 15:29:01 2024 +0200
@@ -339,7 +339,37 @@
         "sdk_type" : "Callable",
         "callable_type" : "ReceivedInstanceCallback",
         "callable_protocol_args" : "received_dicom: bytes, origin: InstanceOrigin",
-        "callable_protocol_return" : "tuple(ReceivedInstanceAction, bytes)"
+        "callable_protocol_return" : "tuple[ReceivedInstanceAction, bytes]"
+      }
+    ],
+    "return_sdk_type" : "void"
+  },
+
+  {
+    "comment" : "New in release 4.1",
+    "short_name" : "RegisterStorageCommitmentScpCallback",
+    "implementation" : "RegisterStorageCommitmentScpCallback",
+    "documentation" : {
+      "description" : [ "Register a callback to handle incoming requests to the storage commitment SCP." ],
+      "args" : {
+        "callback" : "Main callback that creates the a driver to handle an incoming storage commitment request.",
+        "lookup" : "Callback function to get the status of one DICOM instance."
+      }
+    },
+    "args" : [
+      {
+        "sdk_name" : "callback",
+        "sdk_type" : "Callable",
+        "callable_type" : "StorageCommitmentScpCallback",
+        "callable_protocol_args" : "job_id: str, transaction_uid: str, sop_class_uids: list[str], sop_instance_uids: list[str], remote_aet: str, called_aet: str",
+        "callable_protocol_return" : "object",  "comment" : "This is the newly created storage commitment driver."
+      },
+      {
+        "sdk_name" : "lookup",
+        "sdk_type" : "Callable",
+        "callable_type" : "StorageCommitmentLookup",
+        "callable_protocol_args" : "sop_class_uid: str, sop_instance_uid: str, driver: object",
+        "callable_protocol_return" : "StorageCommitmentFailureReason"
       }
     ],
     "return_sdk_type" : "void"
--- a/Sources/Autogenerated/orthanc.pyi	Wed Jul 03 14:56:51 2024 +0200
+++ b/Sources/Autogenerated/orthanc.pyi	Wed Jul 03 15:29:01 2024 +0200
@@ -2300,7 +2300,7 @@
     ...
 
 class ReceivedInstanceCallback(typing.Protocol):
-    def __call__(self, received_dicom: bytes, origin: InstanceOrigin) -> tuple(ReceivedInstanceAction, bytes):
+    def __call__(self, received_dicom: bytes, origin: InstanceOrigin) -> tuple[ReceivedInstanceAction, bytes]:
         ...
 
 # Register a callback to keep/discard/modify a DICOM instance received by Orthanc from any source (C-STORE or REST API)
@@ -2352,6 +2352,25 @@
     """
     ...
 
+class StorageCommitmentScpCallback(typing.Protocol):
+    def __call__(self, job_id: str, transaction_uid: str, sop_class_uids: list[str], sop_instance_uids: list[str], remote_aet: str, called_aet: str) -> object:
+        ...
+
+class StorageCommitmentLookup(typing.Protocol):
+    def __call__(self, sop_class_uid: str, sop_instance_uid: str, driver: object) -> StorageCommitmentFailureReason:
+        ...
+
+# Register a callback to handle incoming requests to the storage commitment SCP
+def RegisterStorageCommitmentScpCallback(callback: StorageCommitmentScpCallback, lookup: StorageCommitmentLookup) -> None:
+    """
+    Register a callback to handle incoming requests to the storage commitment SCP.
+
+    Args:
+      callback (StorageCommitmentScpCallback): Main callback that creates the a driver to handle an incoming storage commitment request.
+      lookup (StorageCommitmentLookup): Callback function to get the status of one DICOM instance.
+    """
+    ...
+
 class WorklistCallback(typing.Protocol):
     def __call__(self, answers: WorklistAnswers, query: WorklistQuery, issuer_aet: str, called_aet: str) -> None:
         ...
--- a/Sources/Autogenerated/sdk_GlobalFunctions.impl.h	Wed Jul 03 14:56:51 2024 +0200
+++ b/Sources/Autogenerated/sdk_GlobalFunctions.impl.h	Wed Jul 03 15:29:01 2024 +0200
@@ -35,6 +35,7 @@
 extern PyObject *RegisterReceivedInstanceCallback(PyObject* module, PyObject *args);
 extern PyObject *RegisterRestCallback(PyObject* module, PyObject *args);
 extern PyObject *RegisterStorageArea(PyObject* module, PyObject *args);
+extern PyObject *RegisterStorageCommitmentScpCallback(PyObject* module, PyObject *args);
 extern PyObject *RegisterWorklistCallback(PyObject* module, PyObject *args);
 // End of forward declarations
 
@@ -2053,6 +2054,8 @@
     "Implemented in C++ function RegisterRestCallback()" },
   { "RegisterStorageArea", RegisterStorageArea, METH_VARARGS,
     "Implemented in C++ function RegisterStorageArea()" },
+  { "RegisterStorageCommitmentScpCallback", RegisterStorageCommitmentScpCallback, METH_VARARGS,
+    "Implemented in C++ function RegisterStorageCommitmentScpCallback()" },
   { "RegisterWorklistCallback", RegisterWorklistCallback, METH_VARARGS,
     "Implemented in C++ function RegisterWorklistCallback()" },
   { NULL, NULL }
--- a/Sources/Plugin.cpp	Wed Jul 03 14:56:51 2024 +0200
+++ b/Sources/Plugin.cpp	Wed Jul 03 15:29:01 2024 +0200
@@ -279,15 +279,6 @@
 
 
   /**
-   * New in release 4.1
-   **/
-
-  {
-    PyMethodDef f = { "RegisterStorageCommitmentScpCallback", RegisterStorageCommitmentScpCallback, METH_VARARGS, "" };
-    functions.push_back(f);
-  }
-
-  /**
    * Append all the global functions that were automatically generated
    **/