Modifying Worklist Query

While performing C-Find SCU on Worklists, I get a query with 25 fields from Philips Ingenia Systems. Is it possible to remove the unnecessary fields from the query and trim it down only to the relevant 5 - 6 fields before querying the worklist files?

Received worklist query from remote modality INGENIA:
{
“0008,0050” : “”,
“0008,0090” : “”,
“0008,1110” : [],
“0010,0010” : “”,
“0010,0020” : “”,
“0010,0030” : “”,
“0010,0040” : “”,
“0010,1000” : “”,
“0010,1030” : “”,
“0010,2000” : “”,
“0010,2110” : “”,
“0010,2160” : “”,
“0010,21b0” : “”,
“0010,21c0” : null,
“0010,4000” : “”,
“0020,000d” : “”,
“0032,1032” : “”,
“0032,1033” : “”,
“0032,1060” : “”,
“0032,1064” :
[
{
“0008,0100” : “”,
“0008,0102” : “”,
“0008,0103” : “”,
“0008,0104” : “”
}
],
“0038,0300” : “”,
“0040,0100” :
[
{
“0008,0060” : “”,
“0032,1070” : “”,
“0040,0001” : “”,
“0040,0002” : “20230406-20230416”,
“0040,0003” : “”,
“0040,0004” : “”,
“0040,0005” : “”,
“0040,0006” : “”,
“0040,0007” : “”,
“0040,0008” :
[
{
“0008,0100” : “”,
“0008,0102” : “”,
“0008,0103” : “”,
“0008,0104” : “”
}
],
“0040,0009” : “”,
“0040,0010” : “”,
“0040,0011” : “”,
“0040,0012” : “”,
“0040,0020” : “”,
“0040,0400” : “”
}
],
“0040,1001” : “”,
“0040,1010” : “”,
“0040,1400” : “”,
“0040,2400” : “”
}

I want to trim it down to keep just “0040,0002” : “20230406-20230416”, in the worklist query.

You might want to look at this in the Orthanc Book:

https://book.orthanc-server.com/plugins/python.html#handling-worklist-scp-requests-new-in-3-2

It isn’t really clear what you mean by unnecessary. The query is what it is asking for, filtered by any keys that have values, i.e. not “”, although the Pregnancy status one might require some special handling:

If you specify a key in the query with a value that is empty, it’ll return the value for that key, filtering the results on the keys that you have set in the request.

It probably doesn’t error out if you request a key that you don’t have in your MWL structure.

That Python Plug-in, and maybe Lua also:

https://book.orthanc-server.com/users/lua.html?highlight=lua

might be what you are looking for “sanitize C-FIND requests against worklists”

Also note that the IncomingFindRequestFilter callback is not applied to C-Find requests targeting modality worklists. Since Orthanc 1.4.2, the corresponding IncomingWorklistRequestFilter callback can be used to sanitize C-FIND requests against worklists:

/sds

Thank you for your input. Is there any Environment variable to specify a lua script in docker compose (similar to the way we specify a python script)?

Probably something like this.

ORTHANC__LUA_SCRIPTS: '["/lua-scripts/OnStoredInstance.lua"]'

In the orthanc.json file the format is like this:

  // List of paths to the custom Lua scripts that are to be loaded
  // into this instance of Orthanc
  "LuaScripts" : [
  ],

This page in the orthanc book has general information about using the Docker Images, both orthanc and osimis:

https://book.orthanc-server.com/users/docker-osimis.html

I do not believe they explicitly mention the LUA config because there are many config options, but there is a general rule, quoting.

Any part of the Orthanc configuration file can be configured through an environment variable. Now that Orthanc and its plugins have hundreds of configuration parameter, listing all these environment variable would be too long. That’s why we have defined a standard way of naming the variable:

To find out an environment variable name from an Orthanc setting (i.e. DicomWeb.StudiesMetadata is the path to a setting):

  • whenever a word contains a capital letter, insert an underscore _ in front. DicomWeb.StudiesMetadata now becomes Dicom_Web.Studies_Metadata

  • whenever you go down one level in the JSON configuration, insert a double underscore __. Dicom_Web.Studies_Metadata now becomes Dicom_Web__Studies_Metadata

  • capitalize all letters. Dicom_Web__Studies_Metadata now becomes DICOM_WEB__STUDIES_METADATA

  • add ORTHANC__ in front. DICOM_WEB__STUDIES_METADATA now becomes ORTHANC__DICOM_WEB__STUDIES_METADATA

Note that, this automatic rule might fail because of 2 capital letters one after each other in some Orthanc settings. Therefore, there are some exceptions to this rule that are however quite intuitive.