Difference between revisions of "Using the DicomAnonymizer dateinterval Function"
(Created page with "The DicomAnonymizer <b>dateinterval</b> function computes date intervals between a date element and a base date stored in the anonymizer's lookup table. Base dates are indexed...") |
|||
Line 1: | Line 1: | ||
− | The DicomAnonymizer <b>dateinterval</b> function computes | + | This article describes how to configure the DICOM anonymizer to use the <b>dateinterval</b> function. The intended audience for this information is clinical trial coordinators. |
+ | |||
+ | The DicomAnonymizer <b>dateinterval</b> function computes the number of days between two dates, typically a StudyDate and a base date associated with the PatientID and stored in the anonymizer's lookup table. | ||
+ | |||
+ | The function has three arguments: | ||
+ | |||
+ | *<b>DateElementName</b> specifies the date element in the DICOM dataset to serve as the end of the interval. | ||
+ | *<b>KeyType</b> specifies the subset of the lookup table containing base dates. | ||
+ | *<b>KeyElementName</b> specifies the element in the DICOM dataset to serve as the key under which to find the base date of the interval. | ||
+ | |||
+ | The function subtracts the base date from the DateElement value and converts the result to days. | ||
+ | |||
+ | For example, if it is desired to store the date interval in an element during the anonymization process, the script for the element might be written as: | ||
+ | |||
+ | :<tt><b>@always()@dateinterval(StudyDate,basedate,PatientID)</b></tt> | ||
+ | |||
+ | Note: the @always() function call is required to force the creation of the element if it is not already present in the dataset. | ||
+ | |||
+ | If the base date is not present in the lookup table, the DicomAnonymizer will quarantine the object. | ||
+ | |||
+ | A more convenient way to trap objects for which the base date is missing is to put a LookupTableChecker pipeline stage before the DicomAnonymizer. Here is a configuration illustrating how to do it: | ||
+ | |||
+ | <pre> | ||
+ | <Configuration> | ||
+ | <Server | ||
+ | maxThreads="20" | ||
+ | port="9666"/> | ||
+ | <Pipeline | ||
+ | name="Test Pipeline" | ||
+ | root="test"> | ||
+ | <DicomImportService | ||
+ | class="org.rsna.ctp.stdstages.DicomImportService" | ||
+ | logConnections="no" | ||
+ | name="DicomImportService" | ||
+ | port="104" | ||
+ | quarantine="quarantines/DicomImportService" | ||
+ | root="roots/DicomImportService"/> | ||
+ | <LookupTableChecker | ||
+ | class="org.rsna.ctp.stdstages.LookupTableChecker" | ||
+ | id="LookupTableChecker" | ||
+ | name="LookupTableChecker" | ||
+ | quarantine="quarantines/LookupTableChecker" | ||
+ | root="roots/LookupTableChecker"/> | ||
+ | <DicomAnonymizer | ||
+ | class="org.rsna.ctp.stdstages.DicomAnonymizer" | ||
+ | lookupTable="scripts/LookupTable.properties" | ||
+ | name="DicomAnonymizer" | ||
+ | quarantine="quarantines/DicomAnonymizer" | ||
+ | root="roots/DicomAnonymizer" | ||
+ | script="scripts/DicomAnonymizer.script"/> | ||
+ | <FileStorageService | ||
+ | class="org.rsna.ctp.stdstages.FileStorageService" | ||
+ | name="FileStorageService" | ||
+ | port="9667" | ||
+ | quarantine="quarantines/FileStorageService" | ||
+ | returnStoredFile="yes" | ||
+ | root="roots/FileStorageService"/> | ||
+ | </Pipeline> | ||
+ | </Configuration> | ||
+ | </pre> | ||
+ | |||
+ | When an object is encountered that will cause a <b>lookup</b> or <b>dateinterval</b> function call in the anonymization script to quarantine the object, the LookupTableChecker will put the object in its quarantine and make an index entry in its database identifying the offending elements. The LookupTableChecker servlet provides a convenient user interface to allow the table to be updated, after which the user can view the quarantine contents and click the Queue All button and process the quarantined objects. |
Revision as of 15:15, 23 February 2017
This article describes how to configure the DICOM anonymizer to use the dateinterval function. The intended audience for this information is clinical trial coordinators.
The DicomAnonymizer dateinterval function computes the number of days between two dates, typically a StudyDate and a base date associated with the PatientID and stored in the anonymizer's lookup table.
The function has three arguments:
- DateElementName specifies the date element in the DICOM dataset to serve as the end of the interval.
- KeyType specifies the subset of the lookup table containing base dates.
- KeyElementName specifies the element in the DICOM dataset to serve as the key under which to find the base date of the interval.
The function subtracts the base date from the DateElement value and converts the result to days.
For example, if it is desired to store the date interval in an element during the anonymization process, the script for the element might be written as:
- @always()@dateinterval(StudyDate,basedate,PatientID)
Note: the @always() function call is required to force the creation of the element if it is not already present in the dataset.
If the base date is not present in the lookup table, the DicomAnonymizer will quarantine the object.
A more convenient way to trap objects for which the base date is missing is to put a LookupTableChecker pipeline stage before the DicomAnonymizer. Here is a configuration illustrating how to do it:
<Configuration> <Server maxThreads="20" port="9666"/> <Pipeline name="Test Pipeline" root="test"> <DicomImportService class="org.rsna.ctp.stdstages.DicomImportService" logConnections="no" name="DicomImportService" port="104" quarantine="quarantines/DicomImportService" root="roots/DicomImportService"/> <LookupTableChecker class="org.rsna.ctp.stdstages.LookupTableChecker" id="LookupTableChecker" name="LookupTableChecker" quarantine="quarantines/LookupTableChecker" root="roots/LookupTableChecker"/> <DicomAnonymizer class="org.rsna.ctp.stdstages.DicomAnonymizer" lookupTable="scripts/LookupTable.properties" name="DicomAnonymizer" quarantine="quarantines/DicomAnonymizer" root="roots/DicomAnonymizer" script="scripts/DicomAnonymizer.script"/> <FileStorageService class="org.rsna.ctp.stdstages.FileStorageService" name="FileStorageService" port="9667" quarantine="quarantines/FileStorageService" returnStoredFile="yes" root="roots/FileStorageService"/> </Pipeline> </Configuration>
When an object is encountered that will cause a lookup or dateinterval function call in the anonymization script to quarantine the object, the LookupTableChecker will put the object in its quarantine and make an index entry in its database identifying the offending elements. The LookupTableChecker servlet provides a convenient user interface to allow the table to be updated, after which the user can view the quarantine contents and click the Queue All button and process the quarantined objects.