Patient¶
-
class
patient.nh_clinical_patient(pool, cr)[source]¶ Represents a patient.
-
check_data(*args, **kwargs)[source]¶ Default will check if patient exists. Either hospital number (
other_identifier) or NHS number (patient_identifier) is required.If
createisTrue, then bothother_identifierandpatient_identifiermust be unique. Otherwise either or both identifiers will be accepted indataparameter.If
titleis indataparameter, then method changes title to res.partner.title id. Iftitleis not included, a new title will be created.Parameters: Raises: except_ormifexceptionarguments isTrueand if patient doesn’t exists or if duplicate patients are foundReturns: Trueif successful. OtherwiseFalseReturn type:
-
check_hospital_number(*args, **kwargs)[source]¶ Checks for a patient by hospital number.
Parameters: - hospital_number (string) – patient’s hospital number
- exception (bool) –
TrueorFalse. Default isFalse
Returns: Trueif patient exists. OtherwiseFalseReturn type: Raises: except_ormifexceptionisTrueand if the patient exists or if the patient does not
-
check_nhs_number(*args, **kwargs)[source]¶ Checks for patient by provided NHS Number.
Parameters: - nhs_number (string) – patient’s nhs number
- exception (bool) –
TrueorFalse. Default isFalse
Returns: Trueif patient exists. OtherwiseFalseReturn type: Raises: except_ormifexceptionisTrueand if the patient exists or if the patient does not
-
create(*args, **kwargs)[source]¶ Extends Odoo’s
create()to writename,other_identifierandpatient_identifierupon creation.Returns: Trueif createdReturn type: bool
-
current_location_id¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null','restrict','cascade' - auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - delegate – set it to
Trueto make fields of the target model accessible from the current model (corresponds to_inherits)
The attribute comodel_name is mandatory except in the case of related fields or field extensions.
-
display_name¶ Very similar to
Charbut used for longer contents, does not have a size and usually displayed as a multiline text box.Parameters: translate – whether the value of this field can be translated
-
dob¶
-
ethnicity¶ Parameters: - selection – specifies the possible values for this field. It is given as either a list of pairs (value, string), or a model method, or a method name.
- selection_add – provides an extension of the selection in the case of an overridden field. It is a list of pairs (value, string).
The attribute selection is mandatory except in the case of related fields or field extensions.
-
family_name¶ Basic string field, can be length-limited, usually displayed as a single-line string in clients
Parameters:
-
follower_ids¶ Many2many field; the value of such a field is the recordset.
Parameters: comodel_name – name of the target model (string) The attribute comodel_name is mandatory except in the case of related fields or field extensions.
Parameters: - relation – optional name of the table that stores the relation in the database (string)
- column1 – optional name of the column referring to “these” records in the table relation (string)
- column2 – optional name of the column referring to “those” records in the table relation (string)
The attributes relation, column1 and column2 are optional. If not given, names are automatically generated from model names, provided model_name and comodel_name are different!
Parameters: - domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- limit – optional limit to use upon read (integer)
-
full_name¶ Very similar to
Charbut used for longer contents, does not have a size and usually displayed as a multiline text box.Parameters: translate – whether the value of this field can be translated
-
gender¶ Parameters: - selection – specifies the possible values for this field. It is given as either a list of pairs (value, string), or a model method, or a method name.
- selection_add – provides an extension of the selection in the case of an overridden field. It is a list of pairs (value, string).
The attribute selection is mandatory except in the case of related fields or field extensions.
-
get_not_admitted_patient_ids(*args, **kwargs)[source]¶ Returns patients ids for patients with no open spell.
-
given_name¶ Basic string field, can be length-limited, usually displayed as a single-line string in clients
Parameters:
-
load(*args, **kwargs)[source]¶ Attempts to load the data matrix, and returns a list of ids (or
Falseif there was an error and no id could be generated) and a list of messages.The ids are those of the records created and saved (in database), in the same order they were extracted from the file. They can be passed directly to
read()Parameters: Returns: {ids: list(int)|False, messages: [Message]}
-
middle_names¶ Basic string field, can be length-limited, usually displayed as a single-line string in clients
Parameters:
-
name_get(*args, **kwargs)[source]¶ Override name_get method so we return the patient’s fullname instead of the default name field
-
not_admitted¶
-
other_identifier¶ Basic string field, can be length-limited, usually displayed as a single-line string in clients
Parameters:
-
partner_id¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null','restrict','cascade' - auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - delegate – set it to
Trueto make fields of the target model accessible from the current model (corresponds to_inherits)
The attribute comodel_name is mandatory except in the case of related fields or field extensions.
-
patient_identifier¶ Basic string field, can be length-limited, usually displayed as a single-line string in clients
Parameters:
-
sex¶ Parameters: - selection – specifies the possible values for this field. It is given as either a list of pairs (value, string), or a model method, or a method name.
- selection_add – provides an extension of the selection in the case of an overridden field. It is a list of pairs (value, string).
The attribute selection is mandatory except in the case of related fields or field extensions.
-
unlink(*args, **kwargs)[source]¶ “Deletes” a patient from the system without deleting the record from the database. This allows the retrieval of patient data if necessary.
Parameters: ids (list) – ids of patients to unlink Returns: TrueReturn type: bool
-