com.pixelmed.dicom
Class CompositeInstanceContext

java.lang.Object
  extended by com.pixelmed.dicom.CompositeInstanceContext
Direct Known Subclasses:
DoseCompositeInstanceContext

public class CompositeInstanceContext
extends Object

A class for representing the attributes of general modules that describe the patient, study, series, instance and related "context" of the payload of a composite DICOM instance.

The purpose is to allow the context to be extracted from an existing object, stored, and then reused in new objects, either wholly or partially, by selectively removing modules for lower level information entities as appropriate. E.g.:

  CompositeInstanceContext cic = new CompositeInstanceContext(srcList);
  cic.removeInstance();
  cic.removeSeries();
  cic.removeEquipment();
  dstList.putAll(cic.getAttributeList());
 

Static methods are also provided for operating directly on an AttributeList.


Field Summary
protected static AttributeTag[] clinicalTrialSubjectModuleAttributeTags
           
protected static AttributeTag[] frameOfReferenceModuleAttributeTags
           
protected static AttributeTag[] generalEquipmentModuleAttributeTags
           
protected static AttributeTag[] generalImageModuleAttributeTags
           
protected static AttributeTag[] generalSeriesModuleAttributeTags
           
protected static AttributeTag[] generalStudyModuleAttributeTags
           
protected  AttributeList list
           
protected static AttributeTag[] patientModuleAttributeTags
           
protected static AttributeTag[] patientStudyModuleAttributeTags
           
protected static AttributeTag[] sopCommonModuleAttributeTags
           
protected static AttributeTag[] srDocumentGeneralModuleAttributeTags
           
 
Constructor Summary
CompositeInstanceContext()
           
CompositeInstanceContext(AttributeList srcList)
           
 
Method Summary
protected  void addOrReplaceIfNotEmptyOtherwiseLeaveUnchanged(AttributeList srcList, AttributeTag tag)
           
protected  void createReferencedRequestSequenceIfAbsent(AttributeList srcList)
           
 boolean equals(Object o)
           
 AttributeList getAttributeList()
          Return the AttributeList of all the Attributes in the context.
 int hashCode()
           
 void put(Attribute a)
           
 void putAll(AttributeList srcList)
           
 void removeAllButPatient()
          See removeAllButPatient.
static void removeAllButPatient(AttributeList list)
          Remove the study, series, equipment, frame of reference and instance level module Attributes.
 void removeAllButPatientAndStudy()
          See removeAllButPatientAndStudy.
static void removeAllButPatientAndStudy(AttributeList list)
          Remove the series, equipment, frame of reference and instance level module Attributes.
 void removeEquipment()
          See removeEquipment.
static void removeEquipment(AttributeList list)
          Remove the General Equipment module Attributes.
 void removeFrameOfReference()
          See removeFrameOfReference.
static void removeFrameOfReference(AttributeList list)
          Remove the Frame of Reference module Attributes.
 void removeInstance()
          See removeInstance.
static void removeInstance(AttributeList list)
          Remove the SOP Common and General Image module Attributes.
 void removePatient()
          See removePatient(AttributeList).
static void removePatient(AttributeList list)
          Remove the Patient and Clinical Trial Subject module Attributes.
 void removeSeries()
          See removeSeries.
static void removeSeries(AttributeList list)
          Remove the General Series module Attributes.
 void removeSRDocumentGeneral()
          See removeSRDocumentGeneral.
static void removeSRDocumentGeneral(AttributeList list)
          Remove the SR Document General Image module Attributes.
 void removeStudy()
          See removeStudy.
static void removeStudy(AttributeList list)
          Remove the General Study and Patient Study module Attributes.
 String toString()
           
 void updateFromSource(AttributeList srcList)
          Add or replace all of the composite context module Attributes with values from the supplied AttributeList.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

list

protected AttributeList list

patientModuleAttributeTags

protected static AttributeTag[] patientModuleAttributeTags

clinicalTrialSubjectModuleAttributeTags

protected static AttributeTag[] clinicalTrialSubjectModuleAttributeTags

generalStudyModuleAttributeTags

protected static AttributeTag[] generalStudyModuleAttributeTags

patientStudyModuleAttributeTags

protected static AttributeTag[] patientStudyModuleAttributeTags

generalSeriesModuleAttributeTags

protected static AttributeTag[] generalSeriesModuleAttributeTags

generalEquipmentModuleAttributeTags

protected static AttributeTag[] generalEquipmentModuleAttributeTags

frameOfReferenceModuleAttributeTags

protected static AttributeTag[] frameOfReferenceModuleAttributeTags

sopCommonModuleAttributeTags

protected static AttributeTag[] sopCommonModuleAttributeTags

generalImageModuleAttributeTags

protected static AttributeTag[] generalImageModuleAttributeTags

srDocumentGeneralModuleAttributeTags

protected static AttributeTag[] srDocumentGeneralModuleAttributeTags
Constructor Detail

CompositeInstanceContext

public CompositeInstanceContext()

CompositeInstanceContext

public CompositeInstanceContext(AttributeList srcList)
Method Detail

getAttributeList

public AttributeList getAttributeList()

Return the AttributeList of all the Attributes in the context.

Returns:
the AttributeList of all the Attributes in the context

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

addOrReplaceIfNotEmptyOtherwiseLeaveUnchanged

protected void addOrReplaceIfNotEmptyOtherwiseLeaveUnchanged(AttributeList srcList,
                                                             AttributeTag tag)

createReferencedRequestSequenceIfAbsent

protected void createReferencedRequestSequenceIfAbsent(AttributeList srcList)

updateFromSource

public void updateFromSource(AttributeList srcList)

Add or replace all of the composite context module Attributes with values from the supplied AttributeList.

If an Attribute is empty or missing in the supplied list, the existing value in the context is left unchanged (not removed or emptied).

This is useful when building composite context from multiple input composite instances, in which optional Attributes are filled in some, but not others, in order to accumulate the most information available.

Also populates the SR Document General Module specific Attributes from their image equivalents.

Parameters:
srcList -

removePatient

public static void removePatient(AttributeList list)

Remove the Patient and Clinical Trial Subject module Attributes.

Parameters:
list -

removeAllButPatient

public static void removeAllButPatient(AttributeList list)

Remove the study, series, equipment, frame of reference and instance level module Attributes.

Parameters:
list -

removeAllButPatientAndStudy

public static void removeAllButPatientAndStudy(AttributeList list)

Remove the series, equipment, frame of reference and instance level module Attributes.

Parameters:
list -

removeStudy

public static void removeStudy(AttributeList list)

Remove the General Study and Patient Study module Attributes.

Parameters:
list -

removeSeries

public static void removeSeries(AttributeList list)

Remove the General Series module Attributes.

Parameters:
list -

removeEquipment

public static void removeEquipment(AttributeList list)

Remove the General Equipment module Attributes.

Parameters:
list -

removeFrameOfReference

public static void removeFrameOfReference(AttributeList list)

Remove the Frame of Reference module Attributes.

Parameters:
list -

removeInstance

public static void removeInstance(AttributeList list)

Remove the SOP Common and General Image module Attributes.

Parameters:
list -

removeSRDocumentGeneral

public static void removeSRDocumentGeneral(AttributeList list)

Remove the SR Document General Image module Attributes.

Parameters:
list -

removePatient

public void removePatient()
See removePatient(AttributeList).


removeAllButPatient

public void removeAllButPatient()
See removeAllButPatient.


removeAllButPatientAndStudy

public void removeAllButPatientAndStudy()
See removeAllButPatientAndStudy.


removeStudy

public void removeStudy()
See removeStudy.


removeSeries

public void removeSeries()
See removeSeries.


removeEquipment

public void removeEquipment()
See removeEquipment.


removeFrameOfReference

public void removeFrameOfReference()
See removeFrameOfReference.


removeInstance

public void removeInstance()
See removeInstance.


removeSRDocumentGeneral

public void removeSRDocumentGeneral()
See removeSRDocumentGeneral.


put

public void put(Attribute a)

putAll

public void putAll(AttributeList srcList)

toString

public String toString()
Overrides:
toString in class Object