Class MergeCompositeContextForOneEntitySelectively

java.lang.Object
com.pixelmed.apps.MergeCompositeContextForOneEntitySelectively

public class MergeCompositeContextForOneEntitySelectively extends Object

A class containing an application for merging the composite context of multiple instances for consistency.

The merge can be performed at a specified entity/module level or the default patient level.

All source files are presumed to be of the same entity at the specified or default level (e.g., the same patient) and no cross-references between instances are required.

Various known dummy values are treated as if they were zero length or absent if conflicting with non-dummy values.

See Also:
  • Field Details

  • Constructor Details

    • MergeCompositeContextForOneEntitySelectively

      public MergeCompositeContextForOneEntitySelectively(CompositeInstanceContext.Selector selector, String src, String dstFolderName, MessageLogger logger) throws IOException, DicomException

      Merge the composite context of multiple instances for consistency.

      Parameters:
      selector - selected entities/modules to merge
      src - source folder or DICOMDIR
      dstFolderName - destination folder
      logger - logger to send progress, warnings and errors
      Throws:
      IOException - if there is a problem reading or writing
      DicomException - if there is a problem parsing or extracting required content
    • MergeCompositeContextForOneEntitySelectively

      public MergeCompositeContextForOneEntitySelectively(CompositeInstanceContext.Selector selector, String[] srcs, String dstFolderName, MessageLogger logger) throws IOException, DicomException

      Merge the composite context of multiple instances for consistency.

      Parameters:
      selector - selected entities/modules to merge
      srcs - source folders or DICOMDIRs
      dstFolderName - destination folder
      logger - logger to send progress, warnings and errors
      Throws:
      IOException - if there is a problem reading or writing
      DicomException - if there is a problem parsing or extracting required content
  • Method Details

    • isNonZeroLengthDummyValue

      protected boolean isNonZeroLengthDummyValue(String value)
    • mergeSelectedContext

      protected CompositeInstanceContext mergeSelectedContext(CompositeInstanceContext newContext)
    • main

      public static void main(String[] arg)

      Merge the composite context of multiple instances for consistency.

      The files are processed in the order in which they are specified on the command line, and when there is a conflict, the first values are used. This can be used to make sure that all PatientIDs, for example are coerced to the first one specified.

      For example, if a folder of images for a patient is specified first, and then a folder of structured reports or presentation states corresponding to those images but with different patient level identifiers is specified second, then the latter (the reports or presentation states) will be cooerced to have the same patient context as the former (the images).

      Entity/module arguments recognized are -patient|-study|-equipment|-frameofreference|-series|-instance|srdocumentgeneral.

      If no entity/module argument is specified, only the patient context will be merged.

      Parameters:
      arg - array of 2 or more strings - an optional list of entities/modules to merge, followed by one or more source folders or DICOMDIR (to merge and use as a source of context), and a destination folder