pydicom.valuerep.PersonName¶
- class pydicom.valuerep.PersonName(*args, **kwargs)¶
- __init__(val, encodings=None, original_string=None)¶
Methods
__init__
(val[, encodings, original_string])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
Returns up to three decoded person name components.
Return the first (family name) group of the alphabetic person name representation as a unicode string
Return the second (given name) group of the alphabetic person name representation as a unicode string
Return the second (ideographic) person name component as a unicode string
Return the third (middle name) group of the alphabetic person name representation as a unicode string
Return the fourth (name prefix) group of the alphabetic person name representation as a unicode string
Return the fifth (name suffix) group of the alphabetic person name representation as a unicode string
Return the third (phonetic) person name component as a unicode string
- property 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
- 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
- property family_name¶
Return the first (family name) group of the alphabetic person name representation as a unicode string
New in version 1.2.
- property given_name¶
Return the second (given name) group of the alphabetic person name representation as a unicode string
New in version 1.2.
- property ideographic¶
Return the second (ideographic) person name component as a unicode string
New in version 1.2.
- property middle_name¶
Return the third (middle name) group of the alphabetic person name representation as a unicode string
New in version 1.2.
- property name_prefix¶
Return the fourth (name prefix) group of the alphabetic person name representation as a unicode string
New in version 1.2.
- property name_suffix¶
Return the fifth (name suffix) group of the alphabetic person name representation as a unicode string
New in version 1.2.
- property phonetic¶
Return the third (phonetic) person name component as a unicode string
New in version 1.2.