public class MCpersonName
extends java.lang.Object
This class provides the functionality to parse and compose a DICOM value according to the definition of PN value representation.
For the purpose of writing names in ideographic characters and in phonetic characters, up to 3 groups of components may be used. The delimiter for component groups shall be the equals character "=".
The three component groups of components in their order of occurrence are: a single-byte character representation, an ideographic representation, and a phonetic representation. Any component group may be absent, including the first component group. In this case, the person name may start with one or more "=" delimiters. Delimiters are required for interior null component groups. Trailing null component groups and their delimiters may be omitted.
Each of the component groups may contain representations of the following name components:
Instances of this class can be used by multiple threads concurrently.
Constructor and Description |
---|
MCpersonName(MCpnComponentGroup charRepresentation,
MCpnComponentGroup ideographicRepresentation,
MCpnComponentGroup phoneticRepresentation)
Initializes a new instance of this class based on the specified component groups.
|
MCpersonName(java.lang.String personName)
Initializes a new instance of this class using a formatted DICOM person name string.
|
MCpersonName(java.lang.String familyName,
java.lang.String givenName,
java.lang.String middleName,
java.lang.String namePrefix,
java.lang.String nameSuffix)
Initializes a new instance of this class using values for the character representation
component group.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
MCpnComponentGroup |
getCharacterRepresentation()
Gets the character representation component group of this person name.
|
java.lang.String |
getCharacterRepValue()
Gets the character representation component group of this person name as a string.
|
MCpnComponentGroup |
getIdeographicRepresentation()
Gets the ideographic representation component group of this person name.
|
java.lang.String |
getIdeographicRepValue()
Gets the ideographic representation component group of this person name as a string.
|
MCpnComponentGroup |
getPhoneticRepresentation()
Gets the phonetic representation component group of this person name.
|
java.lang.String |
getPhoneticRepValue()
Gets the phonetic representation component group of this person name as a string.
|
java.lang.String |
toString()
Gets the encoded representation of this person name.
|
public MCpersonName(MCpnComponentGroup charRepresentation, MCpnComponentGroup ideographicRepresentation, MCpnComponentGroup phoneticRepresentation)
This constructor creates a DICOM person name using up to 3 different representations of the name.
charRepresentation
- The character representation of the person name, or null
if not specified.ideographicRepresentation
- The ideographic representation of the person name, or
null
if not specified.phoneticRepresentation
- The phonetic representation of the name, or null
if not specified.public MCpersonName(java.lang.String personName)
This constructor does not validate the provided string, however if the name is invalid any
method call to the resulting instance, except toString()
will throw an exception.
personName
- A string containing the person name.public MCpersonName(java.lang.String familyName, java.lang.String givenName, java.lang.String middleName, java.lang.String namePrefix, java.lang.String nameSuffix)
Any of the five arguments can be empty or null
.
familyName
- The family name complex.givenName
- The given name complex.middleName
- The middle name.namePrefix
- The name prefix.nameSuffix
- The name suffix.MCexception
- If one of the component contains '=' or '^' characters.public MCpnComponentGroup getCharacterRepresentation()
MCpnComponentGroup
containing the character representation group
of this person name, or null
if the character representation is missing.MCexception
- If this person name is not formated according to the DICOM PN value
representation.public java.lang.String getCharacterRepValue()
null
if the character representation is missing.MCexception
- If this person name is not formated according to the DICOM PN value
representation.public MCpnComponentGroup getIdeographicRepresentation()
MCpnComponentGroup
containing the ideographic representation group
of this person name, or null
if the ideographic representation is missing.MCexception
- If this person name is not formated according to the DICOM PN value
representation.public java.lang.String getIdeographicRepValue()
null
if the ideographic representation is missing.MCexception
- If this person name is not formated according to the DICOM PN value
representation.public MCpnComponentGroup getPhoneticRepresentation()
MCpnComponentGroup
containing the phonetic representation group
of this person name, or null
if the phonetic representation is missing.MCexception
- If this person name is not formated according to the DICOM PN value
representation.public java.lang.String getPhoneticRepValue()
null
if the phonetic representation is missing.MCexception
- If this person name is not formated according to the DICOM PN value
representation.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object