uploader.models.Observable

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

Model an individual observable, observation, or health condition. A patient’s instances of this are stored as models.Observation.

category

Observable category selected from: BLOODWORK, COMORBIDITY, DRUG, PATIENT_INFO, PATIENT_INFO_II, PATIENT_PREP, SYMPTOM, TEST, VITALS.

Type:

django.models.CharField

name

Name of observable, e.g., age, gender, fever, diabetes, etc.

Type:

django.models.CharField

description

Verbose description of observable semantics.

Type:

django.models.CharField

alias

Alias column name for bulk data ingestion from .csv, etc.

Type:

django.models.CharField

value_class

Value type selected from: BOOL, INT, STR, FLOAT.

Type:

django.models.CharField

value_choices

Supply comma separated text choices for STR value_classes e.g., ‘LOW, MEDIUM, HIGH’.

Type:

django.models.CharField, optional

validator

This must be the fully qualified Python name e.g., ‘django.core.validators.validate_email’.

Type:

django.models.CharField, optional

center

Only visible to users of these centers. Selecting none is equivalent to all. When None, blank inline observations of this observable will be automatically added to data input forms.

Type:

django.models.ManyToManyField of user.models.Center

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

adelete([using, keep_parents])

arefresh_from_db([using, fields, from_queryset])

asave(*args, **kwargs)

check(**kwargs)

clean()

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields.

clean_fields([exclude])

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

date_error_message(lookup_type, field_name, ...)

delete([using, keep_parents])

djangofy_choices(choices)

Convert a csv string of choices to that needed by Django.

from_db(db, field_names, values)

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

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

get_category_display(*[, field])

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])

get_value_class_display(*[, field])

list_choices(choices)

Convert a csv string of choices to a list.

prepare_database_save(field)

refresh_from_db([using, fields, from_queryset])

Reload field values from the database.

save(*args[, update_view])

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

alias

A wrapper for a deferred-loading field.

category

A wrapper for a deferred-loading field.

center

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

created_at

A wrapper for a deferred-loading field.

description

A wrapper for a deferred-loading field.

id

A wrapper for a deferred-loading field.

name

A wrapper for a deferred-loading field.

objects

observation

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

observationsview_set

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

pk

sql_view_dependencies

updated_at

A wrapper for a deferred-loading field.

validator

A wrapper for a deferred-loading field.

value_choices

A wrapper for a deferred-loading field.

value_class

A wrapper for a deferred-loading field.