Mercurial > hg > orthanc-book
changeset 165:b879a6274065
IncomingWorklistRequestFilter
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 19 Sep 2018 21:29:17 +0200 |
parents | 05aa4f426621 |
children | 3b80f348cc6b |
files | Sphinx/source/plugins/worklists-plugin.rst Sphinx/source/users/lua.rst |
diffstat | 2 files changed, 25 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/Sphinx/source/plugins/worklists-plugin.rst Tue Sep 18 17:32:04 2018 +0200 +++ b/Sphinx/source/plugins/worklists-plugin.rst Wed Sep 19 21:29:17 2018 +0200 @@ -228,28 +228,18 @@ Common problems --------------- +- C-FIND requests can be modified by implementing the + ``IncomingWorklistRequestFilter`` :ref:`Lua callback + <lua-fix-cfind>` since Orthanc 1.4.2. This can be useful to + fix/sanitize worklist queries. + - According to the `specification <http://dicom.nema.org/MEDICAL/Dicom/2015c/output/chtml/part02/sect_B.4.2.2.3.html>`__, modalities should not include their AET name in ``ScheduledStationAETitle`` on user initiated queries. Therefore, they do receive worklists that do not concern them. This may be handled by the ``FilterIssuerAet`` configuration option. Note that - this might in some cases be intended. + the default behavior might in some cases be intended. -- Orthanc 1.2.0 does not handle the ``Generic group length`` tags. - You might need to include this kind of :ref:`lua script <lua-fix-cfind>` to remove these tags from the queries:: - - function IncomingFindRequestFilter(query, origin) - - -- First display the content of the C-Find query - PrintRecursive(query) - PrintRecursive(origin) - - -- Remove the "Generic group length" tags from the query - local v = query - v['0008,0000'] = nil - v['0010,0000'] = nil - v['0020,0000'] = nil - return v - - end +- Orthanc <= 1.4.1 might behave unexpectedly in the presence of + ``Generic group length (0x????, 0x0000)`` tags. Please upgrade.
--- a/Sphinx/source/users/lua.rst Tue Sep 18 17:32:04 2018 +0200 +++ b/Sphinx/source/users/lua.rst Wed Sep 19 21:29:17 2018 +0200 @@ -426,7 +426,7 @@ such situations, it is possible to dynamically fix incoming or outgoing C-Find queries using a Lua script. -Fixing incoming C-Find requests can be done by implementing the +Sanitizing incoming C-Find requests can be done by implementing the ``IncomingFindRequestFilter(query, origin)`` callback that is called whenever the Orthanc C-Find SCP is queried by a remote modality. For instance, here is Lua script to remove a private tag that is specified @@ -447,9 +447,22 @@ The ``origin`` argument contains information about which modality has issued the request. -Note that, as of Orthanc 1.2.1, the ``IncomingFindRequestFilter`` is -not applied to C-Find requests targeting the Modality Worklists plugin. -This might be fixed in a `future release <https://bitbucket.org/sjodogne/orthanc/issues/57/c-find-matching-refactoring-required>`__. +Note that the ``IncomingFindRequestFilter`` callback is not applied to +C-Find requests targeting :ref:`modality worklists +<worklists-plugin>`. Since Orthanc 1.4.2, the corresponding +``IncomingWorklistRequestFilter`` callback can be used to sanitize +C-FIND requests against worklists:: + + function IncomingWorklistRequestFilter(query, origin) + PrintRecursive(query) + PrintRecursive(origin) + + -- Implements the same behavior as the "FilterIssuerAet" + -- option of the sample worklist plugin + query['0040,0100'][1]['0040,0001'] = origin['RemoteAet'] + + return query + end Similarly, the callback ``OutgoingFindRequestFilter(query, modality)`` is invoked whenever Orthanc acts as a C-Find SCU, which gives the