Class CompositeInstanceContext
- java.lang.Object
-
- com.pixelmed.dicom.CompositeInstanceContext
-
- Direct Known Subclasses:
DoseCompositeInstanceContext
public class CompositeInstanceContext extends java.lang.ObjectA 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 classCompositeInstanceContext.SelectorA 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[]clinicalTrialSubjectModuleAttributeTagsprotected static AttributeTag[]frameOfReferenceModuleAttributeTagsprotected static AttributeTag[]generalEquipmentModuleAttributeTagsprotected static AttributeTag[]generalImageModuleAttributeTagsprotected static AttributeTag[]generalSeriesModuleAttributeTagsprotected static AttributeTag[]generalStudyModuleAttributeTagsprotected AttributeListlistprotected static AttributeTag[]patientModuleAttributeTagsprotected static AttributeTag[]patientStudyModuleAttributeTagsprotected static AttributeTag[]sopCommonModuleAttributeTagsprotected 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 moduleAttributes with values from the suppliedAttributeList.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddOrReplaceIfNotEmptyOtherwiseLeaveUnchanged(AttributeList srcList, AttributeTag tag)protected voidcreatePerformedProcedureCodeSequenceIfAbsent(AttributeList srcList)protected voidcreateReferencedRequestSequenceIfAbsent(AttributeList srcList)booleanequals(java.lang.Object o)AttributeListgetAttributeList()Return theAttributeListof all theAttributes in the context.inthashCode()voidput(Attribute a)voidputAll(AttributeList srcList)voidremoveAllButPatient()SeeremoveAllButPatient.static voidremoveAllButPatient(AttributeList list)Remove the study, series, equipment, frame of reference and instance level moduleAttributes.voidremoveAllButPatientAndStudy()static voidremoveAllButPatientAndStudy(AttributeList list)Remove the series, equipment, frame of reference and instance level moduleAttributes.static voidremoveAllButSelected(AttributeList list, CompositeInstanceContext.Selector selector)Remove the unselected modulesAttributes.voidremoveAllButSelected(CompositeInstanceContext.Selector selector)Remove the unselected modulesAttributes.static voidremoveAllSelected(AttributeList list, CompositeInstanceContext.Selector selector)Remove the selected modulesAttributes.voidremoveAllSelected(CompositeInstanceContext.Selector selector)Remove the selected modulesAttributes.voidremoveEquipment()SeeremoveEquipment.static voidremoveEquipment(AttributeList list)Remove the General Equipment moduleAttributes.voidremoveFrameOfReference()static voidremoveFrameOfReference(AttributeList list)Remove the Frame of Reference moduleAttributes.voidremoveInstance()SeeremoveInstance.static voidremoveInstance(AttributeList list)Remove the SOP Common and General Image moduleAttributes.voidremovePatient()static voidremovePatient(AttributeList list)Remove the Patient and Clinical Trial Subject moduleAttributes.voidremoveSeries()SeeremoveSeries.static voidremoveSeries(AttributeList list)Remove the General Series moduleAttributes.voidremoveSRDocumentGeneral()static voidremoveSRDocumentGeneral(AttributeList list)Remove the SR Document General Image moduleAttributes.voidremoveStudy()SeeremoveStudy.static voidremoveStudy(AttributeList list)Remove the General Study and Patient Study moduleAttributes.java.lang.StringtoString()voidupdateFromSource(AttributeList srcList)Deprecated.useupdateFromSource(AttributeList,boolean)insteadvoidupdateFromSource(AttributeList srcList, boolean forSR)Add or replace all of the composite context moduleAttributes 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
Attributes with values from the suppliedAttributeList.- Parameters:
forSR- true if need to populate the SR Document General Module specificAttributes 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
Attributes with values from the suppliedAttributeList.Also populates the SR Document General Module specific
Attributes from their image equivalents.- Parameters:
srcList- the list of attributes to use as the source
-
-
Method Detail
-
getAttributeList
public AttributeList getAttributeList()
Return the
AttributeListof all theAttributes in the context.- Returns:
- the
AttributeListof all theAttributes in the context
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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
Attributes with values from the suppliedAttributeList.If an
Attributeis 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 sourceforSR- true if need to populate the SR Document General Module specificAttributes from their image equivalents
-
updateFromSource
public void updateFromSource(AttributeList srcList)
Deprecated.useupdateFromSource(AttributeList,boolean)insteadAdd or replace all of the composite context module
Attributes with values from the suppliedAttributeList.If an
Attributeis 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- the list of attributes to use as the source
-
removePatient
public static void removePatient(AttributeList list)
Remove the Patient and Clinical Trial Subject module
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 module
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 module
Attributes.- Parameters:
list- the list of attributes to edit
-
removeStudy
public static void removeStudy(AttributeList list)
Remove the General Study and Patient Study module
Attributes.- Parameters:
list- the list of attributes to edit
-
removeSeries
public static void removeSeries(AttributeList list)
Remove the General Series module
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 editselector- 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 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
SeeAttributes.removeAllButSelected.- Parameters:
selector- the modules to keep
-
removeAllSelected
public void removeAllSelected(CompositeInstanceContext.Selector selector)
Remove the selected modules
SeeAttributes.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:
toStringin classjava.lang.Object
-
-