diff Sphinx/source/plugins/worklists-plugin.rst @ 64:a3df3c2b68cf

import the documentation of the Worklists sample plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Nov 2016 13:02:56 +0100
parents a52f1dc48ebc
children 468cb58b702a
line wrap: on
line diff
--- a/Sphinx/source/plugins/worklists-plugin.rst	Tue Nov 22 12:25:28 2016 +0100
+++ b/Sphinx/source/plugins/worklists-plugin.rst	Tue Nov 22 13:02:56 2016 +0100
@@ -4,49 +4,96 @@
 Sample Modality Worklists plugin
 ================================
 
-This page describes the **official sample plugin** turns Orthanc into
-a server of DICOM worklists. The worklists must be provided in some
-folder of the filesystem by an external script.
+This page describes the **official sample plugin** turning Orthanc
+into a server of DICOM worklists. General information about how
+Orthanc supports DICOM worklists through plugins is explained in the
+:ref:`FAQ <worklist>`.
+
+The sample plugin will serve the worklists stored in some folder on
+the filesystem. This mimics the behavior of the ``wlmscpfs``
+command-line tool from the `DCMTK software
+<http://support.dcmtk.org/docs/wlmscpfs.html>`__. 
+
+The worklists to be served must be put inside the folder of interest
+by an external application or script. ``dump2dcm`` might be a very
+`useful companion tool
+<http://support.dcmtk.org/docs/dump2dcm.html>`__ to generate such
+worklist files. Whenever a C-Find SCP request is issued to Orthanc,
+the plugin will read the content of the folder of interest to locate
+the worklists that match the request. As a consequence, the external
+application can dynamically modify the content of this folder while
+Orthanc is running to add/remove worklists.
 
 The source code of this sample plugin is `available in the source
 distribution of Orthanc
 <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__
-(GPLv3 license).  The plugin will serve the worklists stored in some
-folder on the filesystem. This mimics the behavior of the ``wlmscpfs``
-command-line tool from the `DCMTK software
-<http://support.dcmtk.org/docs/wlmscpfs.html>`__. ``dump2dcm`` might
-be a very `useful companion tool
-<http://support.dcmtk.org/docs/dump2dcm.html>`__ to feed the sample
-plugin with worklists for some separate maintenance script.
-
-General information about the support of DICOM worklists in Orthanc is
-explained in the :ref:`FAQ <worklist>`.
+(GPLv3+ license).
 
 
+Basic configuration
+-------------------
 
-How should I use it ?
----------------------
+.. highlight:: json
+
+1. First, generate the :ref:`default configuration of Orthanc <configuration>`.
+2. Then, modify the ``Plugins`` option to point to the folder containing
+   the shared library of the plugin.
+3. Finally, create a section "ModalityWorklists" in the configuration
+   file to configure the worklist server.
+
+A basic configuration would read as follows::
 
-- download `DCMTK utilities <http://dicom.offis.de/download/dcmtk/release/bin/>`__
-- download sample `worklist files <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__ from the Orthanc source code and copy them in a dedicated folder. 
+  {
+    [...]
+    "Plugins" : [ 
+      "."
+    ],
+    "Worklists" : {
+      "Enable": true,
+      "Database": "./WorklistsDatabase"
+    }
+  }
+
+The folder ``WorklistsDatabase`` of the `source distribution of
+Orthanc
+<https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__
+contains a database of sample worklists, that comes from the DCMTK
+source distribution, as described in the `FAQ entry #37 of the DCMTK
+project <http://forum.dcmtk.org/viewtopic.php?t=84>`__.
+
+
+Tutorial
+--------
 
 .. highlight:: javascript
  
-- Enable the ModalityWorklist plugin in your config.json by adding this section::
+- Download `DCMTK utilities
+  <http://dicom.offis.de/download/dcmtk/release/bin/>`__.
+- Download sample `worklist files
+  <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__
+  from the Orthanc source code and copy them in a dedicated folder.
+- Generate the :ref:`default configuration of Orthanc <configuration>`.
+- Enable the ModalityWorklist plugin in your configuration file by adding this section::
 	
     "Worklists" : {
       "Enable": true,
-      "Database": "WorklistsDatabase"  //this is the path to the folder with the worklist files.  Use absolute path !
+      "Database": "WorklistsDatabase"  // Path to the folder with the worklist files
     },
 
-- Add the plugin to the list of plugins to load (this is an example for Windows)::
+- Add the plugin to the list of plugins to load (this is an example
+  for Microsoft Windows)::
 	
-	"Plugins" : [
-	  "OsimisWebViewer.dll",
-	  "ModalityWorklists.dll" // on GNU/Linux, use ModalityWorklists.so
-	],
+    "Plugins" : [
+      "OsimisWebViewer.dll",
+      "ModalityWorklists.dll"   // On GNU/Linux, use libModalityWorklists.so
+    ],
 
-- Add the findscu utility to the list of know modalities (considering findscu and Orthanc runs on the same machine)::
+- The tests below will be done using the ``findscu`` command-line tool
+  from the `DCMTK utilities
+  <http://support.dcmtk.org/docs/findscu.html>`__. Assuming
+  ``findscu`` and Orthanc runs on the same computer (i.e. on the
+  ``127.0.0.1`` localhost), declare the ``FINDSCU`` AET to the list of
+  know modalities::
 	
     "DicomModalities" : {
       "horos" : [ "HOROS", "192.168.0.8", 11112 ],
@@ -55,26 +102,40 @@
 
 .. highlight:: bash
 	
-- Launch Orthanc as usual, make sure to pass him the configuration file (ex for Windows)::
+- Launch Orthanc as usual, making sure to give the proper
+  configuration file (e.g. for Microsoft Windows)::
 	
-	Orthanc.exe config.json
+    Orthanc.exe config.json
 
-- In a prompt, launch a findscu request to ask Orthanc to return all Worklists for 'CT' modalities (considering findscu and Orthanc both runs on your machine: 127.0.0.1 is the Orthanc url and 4242 is the Orthanc DICOM port)::
+- In another command-line prompt, launch a ``findscu`` request to ask
+  Orthanc to return all worklists for ``CT`` modalities::
 
     findscu -W -k "ScheduledProcedureStepSequence[0].Modality=CT" 127.0.0.1 4242
 
-- findscu should display the matching worklists
+  The ``-W`` option makes ``findscu`` issue a DICOM worklist query,
+  the ``-k`` option specifies the query of interest, ``127.0.0.1``
+  corresponds to the localhost, and ``4242`` corresponds to the
+  default DICOM TCP port of Orthanc.
+
+- ``findscu`` will display the matching worklists.
+
 
-How can I create worklist files ?
----------------------------------
+How to create a worklist file
+-----------------------------
 
-- let's start from an existing `worklist file <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/>`__.
-
-- dump the sample worklist file to a DCMTK dump file::
+.. highlight:: bash
+	
+- Start with an existing worklist file, some samples of which can be
+  found in the `Orthanc source distribution
+  <https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/WorklistsDatabase/>`__
+  (with ``.wl`` file extensions).
+- The worklist file is a DICOM file. Dump its content as a text file
+  using ``dcmdump``::
 
     dcmdump.exe wklist1.wl > sampleWorklist.txt
 	
-- you'll get something like::
+- The content of the just-generated ``sampleWorklist.txt`` file should
+  look similar to this text file::
 
     # Dicom-File-Format
     
@@ -101,32 +162,16 @@
     (0020,000d) UI [1.2.276.0.7230010.3.2.101]              #  26, 1 StudyInstanceUID
     (0032,1032) PN [SMITH]                                  #   6, 1 RequestingPhysician
     (0032,1060) LO [EXAM6]                                  #   6, 1 RequestedProcedureDescription
-    (0040,0100) SQ (Sequence with explicit length #=1)      # 176, 1 ScheduledProcedureStepSequence
-      (fffe,e000) na (Item with explicit length #=12)         # 168, 1 Item
-    	(0008,0060) CS [MR]                                     #   2, 1 Modality
-    	(0032,1070) LO [BARIUMSULFAT]                           #  12, 1 RequestedContrastAgent
-    	(0040,0001) AE [AA32\AA33]                              #  10, 2 ScheduledStationAETitle
-    	(0040,0002) DA [19951015]                               #   8, 1 ScheduledProcedureStepStartDate
-    	(0040,0003) TM [085607]                                 #   6, 1 ScheduledProcedureStepStartTime
-    	(0040,0006) PN [JOHNSON]                                #   8, 1 ScheduledPerformingPhysicianName
-    	(0040,0007) LO [EXAM74]                                 #   6, 1 ScheduledProcedureStepDescription
-    	(0040,0009) SH [SPD3445]                                #   8, 1 ScheduledProcedureStepID
-    	(0040,0010) SH [STN456]                                 #   6, 1 ScheduledStationName
-    	(0040,0011) SH [B34F56]                                 #   6, 1 ScheduledProcedureStepLocation
-    	(0040,0012) LO (no value available)                     #   0, 0 PreMedication
-    	(0040,0400) LT (no value available)                     #   0, 0 CommentsOnTheScheduledProcedureStep
-      (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
-    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
     (0040,1001) SH [RP454G234]                              #  10, 1 RequestedProcedureID
     (0040,1003) SH [LOW]                                    #   4, 1 RequestedProcedurePriority
 	
-	
-- open sampleWorklist.txt file in a text editor and modify/add/remove some Dicom Tags
-
-- then, generate a new worklist file with dump2dcm::
+- Open ``sampleWorklist.txt`` file in a standard text editor so as to
+  modify, add or remove some DICOM tags depending on your needs.
+- Generate a new DICOM worklist file from your modified file using
+  ``dump2dcm``::
 
-	dump2dcm.exe sampleWorklist.txt newWorklist.wl
+    dump2dcm.exe sampleWorklist.txt newWorklist.wl
 	
-- copy that file in the folder where Orthanc searches for its worklist files and that's it !
-
-- of course, you'll automate this worklist generation workflow with some scripting language.
+- As a last step, copy that file in the folder where Orthanc searches
+  for its worklist files. Of course, this worklist generation workflow
+  can be automated using any scripting language.