Mercurial > hg > orthanc-book
diff Sphinx/source/plugins/python.rst @ 700:56a06ca9ec20
Handling worklist SCP requests in Python
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 11 Jun 2021 09:22:22 +0200 |
parents | a777b9e6ef70 |
children | f093160dd7f4 |
line wrap: on
line diff
--- a/Sphinx/source/plugins/python.rst Fri Jun 11 06:56:18 2021 +0200 +++ b/Sphinx/source/plugins/python.rst Fri Jun 11 09:22:22 2021 +0200 @@ -952,9 +952,28 @@ It is now up to your Python callback to proces the C-MOVE SCU request, for instance by calling the route ``/modalities/{...}/store`` in the :ref:`REST API <rest-store-scu>` of Orthanc using -``orthanc.RestApiPost()``. - - +``orthanc.RestApiPost()``. It is highly advised to create a Python +thread to handle the request, in order to avoid blocking Orthanc as +much as possible. + + +.. _python_worklists: + +Handling worklist SCP requests (new in 3.2) +........................................... + +Starting with release 3.2 of the Python plugin, it is possible to +answer worklist queries using a Python script. This is especially +useful to create a bridge between Orthanc, HL7 messages and RIS +systems. Indeed, Python provides many tools to handle HL7 such as +`python-hl7 library <https://python-hl7.readthedocs.io/en/latest/>`__. + +The following Python script reproduces features similar to the +:ref:`sample modality worklists plugin <worklists-plugin>`: + +.. literalinclude:: python/worklist.py + :language: python + Performance and concurrency ---------------------------