Class CompositeInstanceContext

java.lang.Object
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,false);
  cic.removeInstance();
  cic.removeSeries();
  cic.removeEquipment();
  dstList.putAll(cic.getAttributeList());
 

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

  • Field Details

    • list

      protected AttributeList list
    • patientModuleAttributeTags

      protected static AttributeTag[] patientModuleAttributeTags
    • clinicalTrialSubjectModuleAttributeTags

      protected static AttributeTag[] clinicalTrialSubjectModuleAttributeTags
    • generalStudyModuleAttributeTags

      protected static AttributeTag[] generalStudyModuleAttributeTags
    • patientStudyModuleAttributeTags

      protected static AttributeTag[] patientStudyModuleAttributeTags
    • clinicalTrialStudyModuleAttributeTags

      protected static AttributeTag[] clinicalTrialStudyModuleAttributeTags
    • generalSeriesModuleAttributeTags

      protected static AttributeTag[] generalSeriesModuleAttributeTags
    • clinicalTrialSeriesModuleAttributeTags

      protected static AttributeTag[] clinicalTrialSeriesModuleAttributeTags
    • 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 Details

    • CompositeInstanceContext

      public CompositeInstanceContext()
    • CompositeInstanceContext

      public CompositeInstanceContext(AttributeList srcList, boolean forSR)

      Create the composite context module Attributes with values from the supplied AttributeList.

      Parameters:
      srcList - the list of attributes to use as the source
      forSR - true if need to populate the SR Document General Module specific Attributes from their image equivalents
  • Method Details

    • 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)
    • createPerformedProcedureCodeSequenceIfAbsent

      protected void createPerformedProcedureCodeSequenceIfAbsent(AttributeList srcList)
    • updateFromSource

      public void updateFromSource(AttributeList srcList, boolean forSR)

      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.

      Parameters:
      srcList - the list of attributes to use as the source
      forSR - true if need to populate the SR Document General Module specific Attributes from their image equivalents
    • removePatient

      public static void removePatient(AttributeList list)

      Remove the Patient and Clinical Trial Subject modules Attributes.

      Parameters:
      list - the list of attributes to edit
    • removeAllButPatient

      public static void removeAllButPatient(AttributeList list)

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

      Parameters:
      list - the list of attributes to edit
    • removeAllButStudy

      public static void removeAllButStudy(AttributeList list)

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

      Parameters:
      list - the list of attributes to edit
    • removeAllButSeries

      public static void removeAllButSeries(AttributeList list)

      Remove the patient, study, equipment, frame of reference and instance level modules Attributes.

      Parameters:
      list - the list of attributes to edit
    • removeAllButPatientAndStudy

      public static void removeAllButPatientAndStudy(AttributeList list)

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

      Parameters:
      list - the list of attributes to edit
    • removeStudy

      public static void removeStudy(AttributeList list)

      Remove the General Study, Patient Study and Clinical Trial Study modules Attributes.

      Parameters:
      list - the list of attributes to edit
    • removeSeries

      public static void removeSeries(AttributeList list)

      Remove the General Series and Clinical Trial Series modules Attributes.

      Parameters:
      list - the list of attributes to edit
    • removeEquipment

      public static void removeEquipment(AttributeList list)

      Remove the General Equipment module Attributes.

      Parameters:
      list - the list of attributes to edit
    • removeFrameOfReference

      public static void removeFrameOfReference(AttributeList list)

      Remove the Frame of Reference module Attributes.

      Parameters:
      list - the list of attributes to edit
    • removeInstance

      public static void removeInstance(AttributeList list)

      Remove the SOP Common and General Image module Attributes.

      Parameters:
      list - the list of attributes to edit
    • removeSRDocumentGeneral

      public static void removeSRDocumentGeneral(AttributeList list)

      Remove the SR Document General Image module Attributes.

      Parameters:
      list - the list of attributes to edit
    • removeAllButSelected

      public static void removeAllButSelected(AttributeList list, CompositeInstanceContext.Selector selector)

      Remove the unselected modules Attributes.

      Parameters:
      list - the list of attributes to edit
      selector - the modules to keep
    • removeAllSelected

      public static void removeAllSelected(AttributeList list, CompositeInstanceContext.Selector selector)

      Remove the selected modules Attributes.

      Parameters:
      list - the list of attributes to edit
      selector - the modules to remove
    • removePatient

      public void removePatient()
    • removeAllButPatient

      public void removeAllButPatient()
    • removeAllButStudy

      public void removeAllButStudy()
    • removeAllButSeries

      public void removeAllButSeries()
    • removeAllButPatientAndStudy

      public void removeAllButPatientAndStudy()
    • removeStudy

      public void removeStudy()
    • removeSeries

      public void removeSeries()
    • removeEquipment

      public void removeEquipment()
    • removeFrameOfReference

      public void removeFrameOfReference()
    • removeInstance

      public void removeInstance()
    • removeSRDocumentGeneral

      public void removeSRDocumentGeneral()
    • removeAllButSelected

      public void removeAllButSelected(CompositeInstanceContext.Selector selector)

      Remove the unselected modules Attributes.

      See removeAllButSelected.
      Parameters:
      selector - the modules to keep
    • removeAllSelected

      public void removeAllSelected(CompositeInstanceContext.Selector selector)

      Remove the selected modules Attributes.

      See removeAllSelected.
      Parameters:
      selector - the modules to remove
    • put

      public void put(Attribute a)
    • putAll

      public void putAll(AttributeList srcList)
    • toString

      public String toString()
      Overrides:
      toString in class Object