Class CompositeInstanceContext
- java.lang.Object
-
- com.pixelmed.dicom.CompositeInstanceContext
-
- Direct Known Subclasses:
DoseCompositeInstanceContext
public class CompositeInstanceContext extends java.lang.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
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CompositeInstanceContext.Selector
A class to select which entities are copied or propagated or removed or not during operations on CompositeInstanceContext.
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description CompositeInstanceContext()
CompositeInstanceContext(AttributeList srcList)
Deprecated.useCompositeInstanceContext(AttributeList,boolean)
insteadCompositeInstanceContext(AttributeList srcList, boolean forSR)
Create the composite context moduleAttribute
s with values from the suppliedAttributeList
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addOrReplaceIfNotEmptyOtherwiseLeaveUnchanged(AttributeList srcList, AttributeTag tag)
protected void
createPerformedProcedureCodeSequenceIfAbsent(AttributeList srcList)
protected void
createReferencedRequestSequenceIfAbsent(AttributeList srcList)
boolean
equals(java.lang.Object o)
AttributeList
getAttributeList()
Return theAttributeList
of all theAttribute
s in the context.int
hashCode()
void
put(Attribute a)
void
putAll(AttributeList srcList)
void
removeAllButPatient()
SeeremoveAllButPatient
.static void
removeAllButPatient(AttributeList list)
Remove the study, series, equipment, frame of reference and instance level moduleAttribute
s.void
removeAllButPatientAndStudy()
static void
removeAllButPatientAndStudy(AttributeList list)
Remove the series, equipment, frame of reference and instance level moduleAttribute
s.static void
removeAllButSelected(AttributeList list, CompositeInstanceContext.Selector selector)
Remove the unselected modulesAttribute
s.void
removeAllButSelected(CompositeInstanceContext.Selector selector)
Remove the unselected modulesAttribute
s.static void
removeAllSelected(AttributeList list, CompositeInstanceContext.Selector selector)
Remove the selected modulesAttribute
s.void
removeAllSelected(CompositeInstanceContext.Selector selector)
Remove the selected modulesAttribute
s.void
removeEquipment()
SeeremoveEquipment
.static void
removeEquipment(AttributeList list)
Remove the General Equipment moduleAttribute
s.void
removeFrameOfReference()
static void
removeFrameOfReference(AttributeList list)
Remove the Frame of Reference moduleAttribute
s.void
removeInstance()
SeeremoveInstance
.static void
removeInstance(AttributeList list)
Remove the SOP Common and General Image moduleAttribute
s.void
removePatient()
static void
removePatient(AttributeList list)
Remove the Patient and Clinical Trial Subject moduleAttribute
s.void
removeSeries()
SeeremoveSeries
.static void
removeSeries(AttributeList list)
Remove the General Series moduleAttribute
s.void
removeSRDocumentGeneral()
static void
removeSRDocumentGeneral(AttributeList list)
Remove the SR Document General Image moduleAttribute
s.void
removeStudy()
SeeremoveStudy
.static void
removeStudy(AttributeList list)
Remove the General Study and Patient Study moduleAttribute
s.java.lang.String
toString()
void
updateFromSource(AttributeList srcList)
Deprecated.useupdateFromSource(AttributeList,boolean)
insteadvoid
updateFromSource(AttributeList srcList, boolean forSR)
Add or replace all of the composite context moduleAttribute
s with values from the suppliedAttributeList
.
-
-
-
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, boolean forSR)
Create the composite context module
Attribute
s with values from the suppliedAttributeList
.- Parameters:
forSR
- true if need to populate the SR Document General Module specificAttribute
s from their image equivalentssrcList
- the list of attributes to use as the source
-
CompositeInstanceContext
public CompositeInstanceContext(AttributeList srcList)
Deprecated.useCompositeInstanceContext(AttributeList,boolean)
insteadCreate the composite context module
Attribute
s with values from the suppliedAttributeList
.Also populates the SR Document General Module specific
Attribute
s from their image equivalents.- Parameters:
srcList
- the list of attributes to use as the source
-
-
Method Detail
-
getAttributeList
public AttributeList getAttributeList()
Return the
AttributeList
of all theAttribute
s in the context.- Returns:
- the
AttributeList
of all theAttribute
s in the context
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.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
Attribute
s with values from the suppliedAttributeList
.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
Attribute
s 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 sourceforSR
- true if need to populate the SR Document General Module specificAttribute
s from their image equivalents
-
updateFromSource
public void updateFromSource(AttributeList srcList)
Deprecated.useupdateFromSource(AttributeList,boolean)
insteadAdd or replace all of the composite context module
Attribute
s with values from the suppliedAttributeList
.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
Attribute
s are filled in some, but not others, in order to accumulate the most information available.Also populates the SR Document General Module specific
Attribute
s from their image equivalents.- Parameters:
srcList
- the list of attributes to use as the source
-
removePatient
public static void removePatient(AttributeList list)
Remove the Patient and Clinical Trial Subject module
Attribute
s.- 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 module
Attribute
s.- 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 module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeStudy
public static void removeStudy(AttributeList list)
Remove the General Study and Patient Study module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeSeries
public static void removeSeries(AttributeList list)
Remove the General Series module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeEquipment
public static void removeEquipment(AttributeList list)
Remove the General Equipment module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeFrameOfReference
public static void removeFrameOfReference(AttributeList list)
Remove the Frame of Reference module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeInstance
public static void removeInstance(AttributeList list)
Remove the SOP Common and General Image module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeSRDocumentGeneral
public static void removeSRDocumentGeneral(AttributeList list)
Remove the SR Document General Image module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeAllButSelected
public static void removeAllButSelected(AttributeList list, CompositeInstanceContext.Selector selector)
Remove the unselected modules
Attribute
s.- Parameters:
list
- the list of attributes to editselector
- the modules to keep
-
removeAllSelected
public static void removeAllSelected(AttributeList list, CompositeInstanceContext.Selector selector)
Remove the selected modules
Attribute
s.- Parameters:
list
- the list of attributes to editselector
- the modules to remove
-
removePatient
public void removePatient()
-
removeAllButPatient
public void removeAllButPatient()
SeeremoveAllButPatient
.
-
removeAllButPatientAndStudy
public void removeAllButPatientAndStudy()
-
removeStudy
public void removeStudy()
SeeremoveStudy
.
-
removeSeries
public void removeSeries()
SeeremoveSeries
.
-
removeEquipment
public void removeEquipment()
SeeremoveEquipment
.
-
removeFrameOfReference
public void removeFrameOfReference()
-
removeInstance
public void removeInstance()
SeeremoveInstance
.
-
removeSRDocumentGeneral
public void removeSRDocumentGeneral()
-
removeAllButSelected
public void removeAllButSelected(CompositeInstanceContext.Selector selector)
Remove the unselected modules
SeeAttribute
s.removeAllButSelected
.- Parameters:
selector
- the modules to keep
-
removeAllSelected
public void removeAllSelected(CompositeInstanceContext.Selector selector)
Remove the selected modules
SeeAttribute
s.removeAllSelected
.- Parameters:
selector
- the modules to remove
-
put
public void put(Attribute a)
-
putAll
public void putAll(AttributeList srcList)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-