pydicom.valuerep.PersonName3

class pydicom.valuerep.PersonName3(val, encodings=None, original_string=None)
__init__(val, encodings=None, original_string=None)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(val[, encodings, original_string]) Initialize self.
decode([encodings]) Return the patient name decoded by the given encodings.
encode([encodings]) Return the patient name decoded by the given encodings.
family_comma_given()
formatted(format_str)

Attributes

components Returns up to three decoded person name components.
family_name Return the first (family name) group of the alphabetic person name representation as a unicode string
given_name Return the second (given name) group of the alphabetic person name representation as a unicode string
ideographic Return the second (ideographic) person name component as a unicode string
middle_name Return the third (middle name) group of the alphabetic person name representation as a unicode string
name_prefix Return the fourth (name prefix) group of the alphabetic person name representation as a unicode string
name_suffix Return the fifth (name suffix) group of the alphabetic person name representation as a unicode string
phonetic Return the third (phonetic) person name component as a unicode string
components

Returns up to three decoded person name components.

New in version 1.2.

The returned components represent the alphabetic, ideographic and phonetic representations as a list of unicode strings.

decode(encodings=None)

Return the patient name decoded by the given encodings.

Parameters:encodings (list of str) – The list of encodings used for decoding the byte string. If not given, the initial encodings set in the object are used.
Returns:A person name object that will return the decoded string with the given encodings on demand. If the encodings are not given, the current object is returned.
Return type:valuerep.PersonName3
encode(encodings=None)

Return the patient name decoded by the given encodings.

Parameters:encodings (list of str) – The list of encodings used for encoding the unicode string. If not given, the initial encodings set in the object are used.
Returns:The person name encoded with the given encodings as a byte string. If no encoding is given, the original byte string is returned, if available, otherwise each group of the patient name is encoded with the first matching of the given encodings.
Return type:bytes
family_name

Return the first (family name) group of the alphabetic person name representation as a unicode string

New in version 1.2.

given_name

Return the second (given name) group of the alphabetic person name representation as a unicode string

New in version 1.2.

ideographic

Return the second (ideographic) person name component as a unicode string

New in version 1.2.

middle_name

Return the third (middle name) group of the alphabetic person name representation as a unicode string

New in version 1.2.

name_prefix

Return the fourth (name prefix) group of the alphabetic person name representation as a unicode string

New in version 1.2.

name_suffix

Return the fifth (name suffix) group of the alphabetic person name representation as a unicode string

New in version 1.2.

phonetic

Return the third (phonetic) person name component as a unicode string

New in version 1.2.