Class CodedSequenceItem
- java.lang.Object
-
- com.pixelmed.dicom.CodedSequenceItem
-
public class CodedSequenceItem extends java.lang.Object
A class to encapsulate the attributes contained within a Sequence Item that represents a Coded Sequence item.
-
-
Field Summary
Fields Modifier and Type Field Description protected AttributeList
list
-
Constructor Summary
Constructors Constructor Description CodedSequenceItem(AttributeList l)
Construct aCodedSequenceItem
from a list of attributes.CodedSequenceItem(java.lang.String tuple)
Construct aCodedSequenceItem
from a single string representation of the tuple enclosed in parentheses.CodedSequenceItem(java.lang.String codeValue, java.lang.String codingSchemeDesignator, java.lang.String codeMeaning)
Construct aCodedSequenceItem
from string values for code value, scheme and meaning.CodedSequenceItem(java.lang.String codeValue, java.lang.String codingSchemeDesignator, java.lang.String codingSchemeVersion, java.lang.String codeMeaning)
Construct aCodedSequenceItem
from string values for code value, scheme, version and meaning.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
static CodedSequenceItem[]
getArrayOfCodedSequenceItemsOrNull(Attribute a)
Extract the items of a coded sequence attribute.static CodedSequenceItem[]
getArrayOfCodedSequenceItemsOrNull(AttributeList list, AttributeTag tag)
Extract the items of a coded sequence attribute contained within a list of attributes.AttributeList
getAttributeList()
Get the list of attributes in theCodedSequenceItem
.java.lang.String
getCodeMeaning()
Get the code meaning.java.lang.String
getCodeValue()
Get the code value.java.lang.String
getCodingSchemeDesignator()
Get the coding scheme designator.java.lang.String
getCodingSchemeVersion()
Get the coding scheme version.static CodedSequenceItem
getSingleCodedSequenceItemOrNull(Attribute a)
Extract the first (hopefully only) item of a coded sequence attribute.static CodedSequenceItem
getSingleCodedSequenceItemOrNull(AttributeList list, AttributeTag tag)
Extract the first (hopefully only) item of a coded sequence attribute contained within a list of attributes.int
hashCode()
java.lang.String
toString()
Get aString
representation of the contents of theCodedSequenceItem
.
-
-
-
Field Detail
-
list
protected AttributeList list
-
-
Constructor Detail
-
CodedSequenceItem
public CodedSequenceItem(AttributeList l)
Construct a
CodedSequenceItem
from a list of attributes.- Parameters:
l
- the list of attributes to include in the item
-
CodedSequenceItem
public CodedSequenceItem(java.lang.String codeValue, java.lang.String codingSchemeDesignator, java.lang.String codeMeaning) throws DicomException
Construct a
CodedSequenceItem
from string values for code value, scheme and meaning.- Parameters:
codeValue
- the code valuecodingSchemeDesignator
- the coding scheme designatorcodeMeaning
- the code meaning- Throws:
DicomException
- if error in DICOM encoding
-
CodedSequenceItem
public CodedSequenceItem(java.lang.String codeValue, java.lang.String codingSchemeDesignator, java.lang.String codingSchemeVersion, java.lang.String codeMeaning) throws DicomException
Construct a
CodedSequenceItem
from string values for code value, scheme, version and meaning.- Parameters:
codeValue
- the code valuecodingSchemeDesignator
- the coding scheme designatorcodingSchemeVersion
- the coding scheme versioncodeMeaning
- the code meaning- Throws:
DicomException
- if error in DICOM encoding
-
CodedSequenceItem
public CodedSequenceItem(java.lang.String tuple) throws DicomException
Construct a
CodedSequenceItem
from a single string representation of the tuple enclosed in parentheses.I.e., "(cv,csd,cm)" or "(cv,csd,csv,cm)".
The supplied tuple is expected to be enclosed in parentheses.
Any items of the tuple may be enclosed in double quotes.
White space is ignored (outside quoted strings".
- Parameters:
tuple
- single string representation of the tuple enclosed in parentheses.- Throws:
DicomException
- if error in DICOM encoding
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getAttributeList
public AttributeList getAttributeList()
Get the list of attributes in the
CodedSequenceItem
.- Returns:
- all the attributes in the
CodedSequenceItem
-
getCodeValue
public java.lang.String getCodeValue()
Get the code value.
- Returns:
- a string containing the code value, or an empty string if none
-
getCodingSchemeDesignator
public java.lang.String getCodingSchemeDesignator()
Get the coding scheme designator.
- Returns:
- a string containing the coding scheme designator, or an empty string if none
-
getCodingSchemeVersion
public java.lang.String getCodingSchemeVersion()
Get the coding scheme version.
- Returns:
- a string containing the coding scheme version, or an empty string if none
-
getCodeMeaning
public java.lang.String getCodeMeaning()
Get the code meaning.
- Returns:
- a string containing the code meaning, or an empty string if none
-
toString
public java.lang.String toString()
Get a
String
representation of the contents of theCodedSequenceItem
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string containing the code value, coding scheme designator, coding scheme version (if present) and code meaning values
-
getSingleCodedSequenceItemOrNull
public static CodedSequenceItem getSingleCodedSequenceItemOrNull(AttributeList list, AttributeTag tag)
Extract the first (hopefully only) item of a coded sequence attribute contained within a list of attributes.
- Parameters:
list
- the list in which to look for the Sequence attributetag
- the tag of the Sequence attribute to extract- Returns:
- the (first) coded sequence item if found, otherwise null
-
getSingleCodedSequenceItemOrNull
public static CodedSequenceItem getSingleCodedSequenceItemOrNull(Attribute a)
Extract the first (hopefully only) item of a coded sequence attribute.
- Parameters:
a
- the attribute- Returns:
- the (first) coded sequence item if found, otherwise null
-
getArrayOfCodedSequenceItemsOrNull
public static CodedSequenceItem[] getArrayOfCodedSequenceItemsOrNull(AttributeList list, AttributeTag tag)
Extract the items of a coded sequence attribute contained within a list of attributes.
- Parameters:
list
- the list in which to look for the Sequence attributetag
- the tag of the Sequence attribute to extract- Returns:
- the coded sequence items if found, otherwise null
-
getArrayOfCodedSequenceItemsOrNull
public static CodedSequenceItem[] getArrayOfCodedSequenceItemsOrNull(Attribute a)
Extract the items of a coded sequence attribute.
- Parameters:
a
- the attribute- Returns:
- the coded sequence items if found, otherwise null
-
-