uploader.models.Visit

class uploader.models.Visit(*args, **kwargs)[source]

Model a patient’s visitation to collect health data and biological samples.

patient

The patient that this visit belongs to.

Type:

django.models.ForeignKey of Patient

previous_visit

This can be used to reference another Visit to give order to visitations when collecting dates may not be compliant.

Type:

django.models.ForeignKey of self, optional

days_observed

The number of days that observations have been observed for. This applies to all observations related to this visit.

Type:

django.models.IntegerField, optional

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

adelete([using, keep_parents])

arefresh_from_db([using, fields])

asave([force_insert, force_update, using, ...])

auto_find_previous_visit()

Find the previous visit.

check(**kwargs)

clean()

Model validation.

clean_fields([exclude])

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

count_prior_visits()

date_error_message(lookup_type, field_name, ...)

delete([using, keep_parents])

from_db(db, field_names, values)

full_clean([exclude, validate_unique, ...])

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model.

get_column_names([help_text])

get_constraints()

get_deferred_fields()

Return a set containing names of deferred fields for this instance.

get_next_by_created_at(*[, field, is_next])

get_next_by_updated_at(*[, field, is_next])

get_previous_by_created_at(*[, field, is_next])

get_previous_by_updated_at(*[, field, is_next])

parse_fields_from_pandas_series(series)

Parse the pandas series for field values returning a dict.

prepare_database_save(field)

refresh_from_db([using, fields])

Reload field values from the database.

save([force_insert, force_update, using, ...])

Save the current instance.

save_base([raw, force_insert, force_update, ...])

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too.

serializable_value(field_name)

Return the value of the field name for this instance.

unique_error_message(model_class, unique_check)

validate_constraints([exclude])

validate_unique([exclude])

Check unique constraints on the model and raise ValidationError if any failed.

Attributes

bio_sample

Accessor to the related objects manager on the reverse side of a many-to-one relation.

center

created_at

A wrapper for a deferred-loading field.

days_observed

A wrapper for a deferred-loading field.

id

A wrapper for a deferred-loading field.

next_visit

Accessor to the related objects manager on the reverse side of a many-to-one relation.

objects

observation

Accessor to the related objects manager on the reverse side of a many-to-one relation.

patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

patient_id

pk

previous_visit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

previous_visit_id

updated_at

A wrapper for a deferred-loading field.

visit_number