Patient¶
-
class
patient.NhClinicalPatient(pool, cr)[source]¶ Represents a patient.
-
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.
-
get_patient_id_for_identifiers(*args, **kwargs)[source]¶ Get patient record with either of the supplied identifier or raise error
Parameters: - hospital_number – Other identifier for the patient record
- nhs_number – Patient identifier for the patient record
Returns: patient ID for patient with either of the identifiers
-
get_patients_on_ward(*args, **kwargs)[source]¶ Parameters: Returns: All the patients on the given ward
Return type: list of nh.clinical.patient records
-
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:
-
serialise(*args, **kwargs)[source]¶ Convert the current patient record to a dictionary. Commonly used to be sent to the front-end. The self argument must be a single nh.clinical.patient record.
Returns: Patient dictionary. Return type: dict
-
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
-