Package com.pixelmed.apps

## Class MergeCompositeContextForOneEntitySelectively

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

-     public class MergeCompositeContextForOneEntitySelectively
      extends java.lang.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:
    `MergeCompositeContext`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected class` | `MergeCompositeContextForOneEntitySelectively.OurFirstPassMediaImporter` |
    `protected class` | `MergeCompositeContextForOneEntitySelectively.OurSecondPassMediaImporter` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected java.lang.String` | `dstFolderName` |
    `protected java.lang.String` | `ourAETitle` |
    `protected CompositeInstanceContext.Selector` | `selector` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MergeCompositeContextForOneEntitySelectively​(CompositeInstanceContext.Selector selector, java.lang.String[] srcs, java.lang.String dstFolderName, MessageLogger logger)` | Merge the composite context of multiple instances for consistency.
    `MergeCompositeContextForOneEntitySelectively​(CompositeInstanceContext.Selector selector, java.lang.String src, java.lang.String dstFolderName, MessageLogger logger)` | Merge the composite context of multiple instances for consistency.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected boolean` | `isNonZeroLengthDummyValue​(java.lang.String value)` |
    `static void` | `main​(java.lang.String[] arg)` | Merge the composite context of multiple instances for consistency.
    `protected CompositeInstanceContext` | `mergeSelectedContext​(CompositeInstanceContext newContext)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ourAETitle

          protected java.lang.String ourAETitle

    - #### dstFolderName

          protected java.lang.String dstFolderName

    - #### selector

          protected CompositeInstanceContext.Selector selector

  - ### Constructor Detail

    - #### MergeCompositeContextForOneEntitySelectively

          public MergeCompositeContextForOneEntitySelectively​(CompositeInstanceContext.Selector selector,
                                                              java.lang.String src,
                                                              java.lang.String dstFolderName,
                                                              MessageLogger logger)
                                                       throws java.io.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:
        `java.io.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,
                                                              java.lang.String[] srcs,
                                                              java.lang.String dstFolderName,
                                                              MessageLogger logger)
                                                       throws java.io.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:
        `java.io.IOException` - if there is a problem reading or writing
        `DicomException` - if there is a problem parsing or extracting required content

  - ### Method Detail

    - #### isNonZeroLengthDummyValue

          protected boolean isNonZeroLengthDummyValue​(java.lang.String value)

    - #### mergeSelectedContext

          protected CompositeInstanceContext mergeSelectedContext​(CompositeInstanceContext newContext)

    - #### main

          public static void main​(java.lang.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