Mercurial > hg > orthanc-book
comparison 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 |
comparison
equal
deleted
inserted
replaced
699:a777b9e6ef70 | 700:56a06ca9ec20 |
---|---|
950 } | 950 } |
951 | 951 |
952 It is now up to your Python callback to proces the C-MOVE SCU request, | 952 It is now up to your Python callback to proces the C-MOVE SCU request, |
953 for instance by calling the route ``/modalities/{...}/store`` in the | 953 for instance by calling the route ``/modalities/{...}/store`` in the |
954 :ref:`REST API <rest-store-scu>` of Orthanc using | 954 :ref:`REST API <rest-store-scu>` of Orthanc using |
955 ``orthanc.RestApiPost()``. | 955 ``orthanc.RestApiPost()``. It is highly advised to create a Python |
956 | 956 thread to handle the request, in order to avoid blocking Orthanc as |
957 | 957 much as possible. |
958 | |
959 | |
960 .. _python_worklists: | |
961 | |
962 Handling worklist SCP requests (new in 3.2) | |
963 ........................................... | |
964 | |
965 Starting with release 3.2 of the Python plugin, it is possible to | |
966 answer worklist queries using a Python script. This is especially | |
967 useful to create a bridge between Orthanc, HL7 messages and RIS | |
968 systems. Indeed, Python provides many tools to handle HL7 such as | |
969 `python-hl7 library <https://python-hl7.readthedocs.io/en/latest/>`__. | |
970 | |
971 The following Python script reproduces features similar to the | |
972 :ref:`sample modality worklists plugin <worklists-plugin>`: | |
973 | |
974 .. literalinclude:: python/worklist.py | |
975 :language: python | |
976 | |
958 | 977 |
959 Performance and concurrency | 978 Performance and concurrency |
960 --------------------------- | 979 --------------------------- |
961 | 980 |
962 **Important:** This section only applies to UNIX-like systems. The | 981 **Important:** This section only applies to UNIX-like systems. The |