edfio.Patient#

class edfio.Patient(*, code='X', sex='X', birthdate=None, name='X', additional=())[source]#

Object representation of the local patient identification.

Parsing from/to the string containing the local_patient_identification header field is done according to the EDF+ specs. Subfields must be ASCII (32..126) and may not contain spaces.

Parameters:
codestr, default: "X"

The code by which the patient is known in the hospital administration.

sex{"X", "F", "M"}, default: "X"

Sex, F for female, M for male, X if anonymized.

birthdatedatetime.date | None, default: None

Patient birthdate, stored as X if None.

namestr, default: "X"

The patient’s name, stored as X if None.

additionalSequence[str], default: ()

Optional additional subfields. Will be stored in the header field separated by spaces.

Attributes

additional

Optional additional subfields.

birthdate

Patient birthdate.

code

The code by which the patient is known in the hospital administration.

name

The patient's name.

sex

Sex, F for female, M for male, X if anonymized.

Methods

__init__

get_subfield

Access a subfield of the local patient identification field by index.

property additional[source]#

Optional additional subfields.

property birthdate[source]#

Patient birthdate.

property code[source]#

The code by which the patient is known in the hospital administration.

get_subfield(idx)[source]#

Access a subfield of the local patient identification field by index.

Parameters:
idxint

The index of the subfield to access.

Returns:
str

The subfield at the specified index. If the index exceeds the actually available number of subfields, the return value is "X".

property name[source]#

The patient’s name.

property sex[source]#

Sex, F for female, M for male, X if anonymized.