com.pixelmed.apps
Class MergeCompositeContext

java.lang.Object
  extended by com.pixelmed.apps.MergeCompositeContext

public class MergeCompositeContext
extends Object

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

Patient identity is determined by being within the same study (having the same Study Instance UID), or referencing each others SOP Instance UIDs.

It is assumed that one patient's instances can only cross-reference those of the same patient and not other patients. If there are no instance cross-references, then no commonality can be established across studies and no contexts are merged across studies.

There is no assumption that any particular patient entity level key is the same (e.g., Patient ID).

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


Nested Class Summary
 class MergeCompositeContext.Group
           
protected  class MergeCompositeContext.OurFirstPassMediaImporter
           
protected  class MergeCompositeContext.OurSecondPassMediaImporter
           
 
Field Summary
protected  String dstFolderName
           
protected  Set<MergeCompositeContext.Group> groups
           
protected  Map<String,MergeCompositeContext.Group> mapOfSOPInstanceUIDToGroup
           
protected  Map<String,String> mapOfSOPInstanceUIDToStudyInstanceUID
           
protected  Map<String,MergeCompositeContext.Group> mapOfStudyInstanceUIDToGroup
           
protected  int nextSequenceNumber
           
protected  String ourAETitle
           
 
Constructor Summary
MergeCompositeContext(String[] srcs, String dstFolderName, MessageLogger logger)
           
MergeCompositeContext(String src, String dstFolderName, MessageLogger logger)
           
 
Method Summary
protected  MergeCompositeContext.Group addToGroups(AttributeList list)
           
protected  String dumpGroups()
           
protected  boolean isNonZeroLengthDummyValue(String value)
           
static void main(String[] arg)
          Merge the patient composite context of multiple instances for consistency.
protected  void mergeGroups(MergeCompositeContext.Group g1, MergeCompositeContext.Group g2)
           
protected  CompositeInstanceContext mergePatientContext(MergeCompositeContext.Group group, CompositeInstanceContext newContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ourAETitle

protected String ourAETitle

dstFolderName

protected String dstFolderName

nextSequenceNumber

protected int nextSequenceNumber

groups

protected Set<MergeCompositeContext.Group> groups

mapOfSOPInstanceUIDToStudyInstanceUID

protected Map<String,String> mapOfSOPInstanceUIDToStudyInstanceUID

mapOfSOPInstanceUIDToGroup

protected Map<String,MergeCompositeContext.Group> mapOfSOPInstanceUIDToGroup

mapOfStudyInstanceUIDToGroup

protected Map<String,MergeCompositeContext.Group> mapOfStudyInstanceUIDToGroup
Constructor Detail

MergeCompositeContext

public MergeCompositeContext(String src,
                             String dstFolderName,
                             MessageLogger logger)
                      throws IOException,
                             DicomException
Throws:
IOException
DicomException

MergeCompositeContext

public MergeCompositeContext(String[] srcs,
                             String dstFolderName,
                             MessageLogger logger)
                      throws IOException,
                             DicomException
Throws:
IOException
DicomException
Method Detail

dumpGroups

protected String dumpGroups()

isNonZeroLengthDummyValue

protected boolean isNonZeroLengthDummyValue(String value)

mergePatientContext

protected CompositeInstanceContext mergePatientContext(MergeCompositeContext.Group group,
                                                       CompositeInstanceContext newContext)

mergeGroups

protected void mergeGroups(MergeCompositeContext.Group g1,
                           MergeCompositeContext.Group g2)

addToGroups

protected MergeCompositeContext.Group addToGroups(AttributeList list)
                                           throws DicomException
Throws:
DicomException

main

public static void main(String[] arg)

Merge the patient 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 those first specified.

For example, if a folder of images for multiple patients is specified first, and then a folder of structured reports or presentation states referencing (some of) 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).

Parameters:
arg - array of 2 or more strings - one or more source folder or DICOMDIR (to merge and use as a source of context), and a destination folder